This is going to be very short and sweet as it is primarily just a note to self. I stuggled with getting outbound mail delivery working for some time and finally got it all figured out. Using Exim4 for mail sending I did the following:
EDIT: This is a followup on a previous article for quickly getting Exim4 installed for mail sending. Read that article first here: Install Exim4 – One Command
1. Edit /etc/mailname and put in proper domain name for your server.
2. Edit this line in /etc/exim4/update-exim4.conf.conf
3. Then run the command
4. Then follow the instructions at this site to setup DKIM:
https://www.debian-administration.org/article/718/DKIM-signing_outgoing_mail_with_exim4
EDIT: I will note that the above article works except for the fact that they don’t show how to create a proper DKIM TXT record. The syntax should be along the lines of:
The article left off the first part, i.e. “v=DKIM1;” which is required…
5. Finally create a txt record in DNS for your domain for SPF along the lines of:
Optionally you can use this tool to generate an SPF record for you:
http://www.spfwizard.net/
Done!
References:
https://www.debian-administration.org/article/140/Handling_mail_for_multiple_virtual_domains_with_exim4