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 (, 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 and then run the command from the prompt to verify the server runs: sudo postsrsd -d “” -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. ::: but stop before step 5

Start here: Setting up SMTP authentication

It works and a copy is at bottom called dovecot


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