Here in New Zealand our biggest ISP, Xtra, have recently moved to have their emails handled by Yahoo... so, all of a sudden 10 days ago all our customers emails started to get put straight into the 'Bulk Mail' spam folder.
Here is a slightly long-winded list of steps I took to get Domain Keys working on FreeBSD with Exim.
At the start I want to say thanks to many of you for your suggestions on setting up Domain Keys. I had some annoying troubles which I will outline here with the solutions I found - hopfully it will help someone out who is having the same hassles.
My experience of setting up Domain Keys on FreeBSD with Exim
1. Upgrade cPanel
I upgraded cPanel to 11 Current.
2. Run domain_keys_installer Script
Tried to run the following install script: /usr/local/cpanel/bin/domain_keys_installer <username for cpanel>
but got the following error: "Domain Keys are not installed on this machine"
3. Configured Exim port and reinstalled Exim
Added the following line to /etc/make.conf as a defult option when making ports (in this case for exim in particular): WITH_DOMAINKEYS=yes
Then I ran the following script to rebuild and reinstall exim /scripts/eximup --force
4. Tested
At this stage exim was installed with the Domain Keys, but I still got the same error listed when I ran the command in step 2 above - "Domain Keys are not installed on this machine"
5. Backed up exim configuration
Backed up my my Exim configuration from /etc/exim.conf and /usr/local/etc/exim/configure.
I didn't actually do this, but you should!
6. Ran /scripts/buildeximconf
This added the required file /etc/domain_keys_active to the etc directory and added the required commands to the exim configuration so that it would add the keys when sending mail
7. Ran the domain_keys_installer script as in step 2
Success! This time it worked - no errors and it created the private keys for the domain in the correct directory /var/cpanel/domain_keys/<private and public> and added the domain key to the /etc/namedb/<domainname>.db files for the user.
8. Restarted the Bind service
9. Restarted the Exim service and tested thoroughly to make sure it still sent and received mail
10. Checked to see if the Domain Keys worked by sending an email to dk at dk.crynwr.com
Failed :-(
11. Tested sending message through ssh command line
At this stage I went on a bit of a goose chase - took a while to realise that I needed to go on with step 14...
12. Tried manually creating keys
Used the information at the exim wiki to manually configure things:
http://wiki.exim.org/DomainKeys
Restarted Exim and Tested as in 10 and 11 above and it worked!
13. Changed it back to the cPanel configuration
Restarted Exim - Failed :-( Copied the private key that I created in step 12 into the folder where cPanel stores the private keys it creates, and it still failed... But it worked if I pointed the exim config to the directory I manually created the key in - ie. problem with directory permissions
14. Change directory owner
I didn't want to chmod the /var/cpanel/domain_keys/private directory to 664, as this would allow server users to view my private keys. I changed the group/user on the domain key private directory to mailnull:mailnull so that the exim process could read the directory. Is this the correct procedure?
15. Restared Exim and tested..
Yahoo! I mean - It Worked! (The phrase Yahoo leaves a bad taste in my mouth now).
My emails are still being trashed by Yahoo, but it says that my Domain Keys are right and that the emails are genuine... but it still trashes them... Oh the joy of big companies. Hopefully they will take me off their filter now... waiting to hear... the suspense is killing me...
If you are in New Zealand, my suggestion, leave Xtra as soon as possible and go to Orcon - awesome service, great prices and fast broadband.
Hope this helps someone - let me know if it does - all my pain can't be for nothing I hope...