I have recently setup a few servers and installed webmin/virtualmin on them. During this process I took a dive into getting my own email server online on one of my VPS accounts and encountered some issues. I'm not sure if I discovered a bug or I am simply not configuring my services correctly. Here are the symptoms:
Upon getting my email server online using Ubuntu 12.04 I perform a few basic tests. Send an email from the email server to my gmail account and then respond to that same email to confirm incoming out outbound email delivery. At this point everything works great. I then try to setup DomainKeys Identified Mail. I enter the following options:
Signing of outgoing mail enabled? Yes Selector for DKIM record name 2014 Reject incoming email with invalid DKIM signature No Size of DKIM key 2048
Once I submit the form it generates my key and adds the appropriate entry into my DNS zones. The issue is that outgoing email never gets signed and when viewing the log I can see the following error:
"warning: connect to Milter service inet:localhost:8891: Connection refused"
This message gets repeated every couple of minutes or so. Now the strange thing is that in an attempt to resolve this issue I tried a few different things but what ultimately worked was the following:
edit the /etc/opendkim.conf change the following from Socket inet:8891@localhost to Socket inet:email@example.com
also edit /etc/postfix/main.cf change the following from smtpd_milters = inet:localhost:8891 non_smtpd_milters = inet:localhost:8891 to smtpd_milters = inet:127.0.0.1:8891 non_smtpd_milters = inet:127.0.0.1:8891
Once these changes are made outgoing emails get properly signed with a DKIM signature. Furthermore I can reproduce the error by changing the entries back to say localhost instead of 127.0.0.1 I have had the same results on Ubuntu 12.04 and Debian 7. Did not experience this on Centos 6. Problem is that if you make those changes the Virtualmin configuration page no longer recognizes that the service is running and any attempt to make changes and regenerate the key and enable the service through the web gui results in the localhost entry being added back which in turn brings the error back.
One more note, I am able to ping local host and get back a response from 127.0.01. I will concede that I am not well versed enough at configuring postfix to know if I simply have an incorrect configuration or not. Any insight into the issue would be helpful.