Email Server Setup with Postfix, SPF, DKIM, and DMARC.

I’ve had my email server set up for a few years now, but only recently realized a few large companies emails were not either receiving my email or I couldn’t receive their email. This rarely happened, but I wanted to find the culprit.

I set up SPF, DKIM, and DMARC, but remembered looking at the email details and there would be a softfail.

I didn’t think much of it because, as I mentioned, all my test emails (https://www.mail-tester.com/), friend’s emails, and work emails were being transmitted and received.

I needed to implement a sender rewriting scheme. Ubuntu has a package that people were using in version 14.04, but it was failing for Ubuntu 20.04. To fix it just install the package (postsrsd), manually add mydomain to postfix’s main.cf and then run the command from the prompt to verify the server runs: sudo postsrsd -d “example.com” -s /etc/postsrsd.secret

The service didn’t run on it’s own so I just created my own service to start on boot. Once the service was running I checked email details from a newly received email.

Here are some of the blogs and sites I found useful for setting up the email server:

Just make sure you set your relayserver…your ISP will tell you.

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-18-04 ::: but stop before step 5

https://www.binarytides.com/postfix-mail-forwarding-debian/

https://upcloud.com/community/tutorials/secure-pletseostfix-using-lets-encrypt/

Start here: Setting up SMTP authentication

It works and a copy is at bottom called dovecot

smtp_tls_protocols=!SSLv3

v2 isn’t supported so just leave as is.

Add to google account. Leave as use as alias Use port 25 and username apple and password typical and TLS (recommended)

To get to pass authentication from verified sender need to add spf and dkim

https://www.linuxbabe.com/mail-server/setting-up-dkim-and-spf

https://pepipost.com/tutorials/setup-spf-and-dkim-with-postfix-on-ubuntu/

SRS:

https://jichu4n.com/posts/setting-up-dkim-and-srs-in-postfix/