Disabling/enabling a virtualserver with Mail feature clears `/etc/dkim-domains.txt`

SYSTEM INFORMATION
OS type and version Debian Linux 12
Webmin version 2.670
Usermin version 2.570
Virtualmin version 8.2.0 GPL
Theme version 26.70
Apache version 2.4.68
Package updates All installed packages are up to date

Enabling or disabling a Virtual Server causes the file /etc/dkim-domains.txt to become 0 bytes in size. This only happens if the Mail for domain feature is enabled.

Enabling/disabling Virtual Servers without this feature does not affect the dkim file.

I first noticed this on 2026-08-18 (so it’s not introduced in the last Virtualmin update).

I couldn’t test this on another system, but on this one system the behaviour seems consistent.
Does it happen on your system?

Hello,

Thanks for the heads up!

This is a very unusual and unexpected issue. I cannot reproduce it. @Jamie, do you perhaps have a clue?

If there is anything I can test, please let me know. I can provide debugging logs, or give you access to take a look.
Perhaps it is caused by some custom setting or something? idk.

I just tested on another system (also of the Debian family), and I have the following observations:

  • I noticed the issue also happened upon Virtual Server creation (with Mail option selected), at the stage Adding to email domains list .. .. done..
  • Upon disabling/enabling Virtual Server, the dkim file is getting reset at the stage Processing postfix mail config... .. done processing postfix mail config..
  • Updating a Virtual Server settings to enable the Mail for domain feature, causes the dkim reset at the stage Saving server details .. .. done.
  • Deleting a sub-Server that has the Mail for domain feature enabled, ONLY causes the dkim reset if the domain exists in the dkim file, and at the stages Processing postfix mail config... .. done processing postfix mail config. Disabling DKIM signing for example.org .. .. done. (too fast to pinpoint which one).

Between these tests, I’m manually restoring the contents of /etc/dkim-domains.txt and using watch ... cat ... to see when it gets reset.