Search code examples
dnspostfix-mtadkimwebmin

Error when trying to enable DKIM in Virtualmin


I am trying to enable DKIM signing in Virtualmin per these instructions.
When I save the changes, it begins adding DKIM records to the various virtual domains, until it hits a specific domain which has lots of alias domains. It stops with this error:

Failed to save DKIM settings : Missing file to open at virtual_server::/usr/libexec/webmin/virtual-server/feature-dns.pl line 2782

The applicable code in this .pl file is:

 else {
    # On local BIND
    $file = &get_domain_dns_file($ad);
 >> line 2782:   &open_tempfile(EMPTY, ">$file", 0, 1);
    &close_tempfile(EMPTY);
    &create_alias_records($file, $ad,
        $ad->{'dns_ip'} || $ad->{'ip'});
    $recs = [ get_domain_dns_records($ad) ];
 }

Then I tried adding this domain to the box "Never sign domains". It still hung at the same domain, this time trying to "remove DKIM records".

Virtualmin version 4.04 GPL Webmin version: 1.660 Linux version: Centos 6.5 64-bit Running Postfix, Dovecot, Bind, Apache HTTP 2.x etc. Multiple virtual domains in Virtualmin

Thanks for any help.


Solution

  • Version 4.04 of Virtualmin was released well over a year ago. Upgrade to the latest version, which is 4.15-2. As far as I know DKIM works readily on CentOS 6 with the current version.

    You will also need to upgrade Webmin, as that is also many revisions behind the current version.

    If you installed Virtualmin using the install.sh script, you should be able to simply perform an apt-get upgrade to get the latest packages from our repositories. If you haven't updated your system in over a year, you surely have numerous and probably quite serious security vulnerabilities (Webmin/Virtualmin even had a few local file access vulnerabilities last year that were fixed around about version 1.720/4.13).

    If the problem persists with a current version of Virtualmin, let me know, and I'll help you sort it out.