Simple mail server

Before installation

mysite.com MX record points to mysite.com

Step 1

Need to do https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-16-04

Step 2

Setup all, except ClamAV (if RAM is enough, ClamAV can be installed) https://help.ubuntu.com/community/PostfixAmavisNew How to siable ClamAV:

# @\bypass_virus_checks_maps = (
#    \%bypass_virus_checks, \@\bypass_virus_checks_acl, \$bypass_virus_checks_re);

Step 3

Instead Dovecot i prefer this https://help.ubuntu.com/community/PostfixBasicSetupHowto

Installing courier IMAP and POP3

apt install courier-pop
apt install courier-imap

Then

service courier-authdaemon start

systemctl enable courier-authdaemon

/etc/init.d/postfix restart

Step 4

Setup SPF

https://www.digitalocean.com/community/tutorials/how-to-create-a-spf-record-for-your-domain-with-google-apps

Step 5

Setup DKIM

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy

Step 6

Setup DMARK

https://habrahabr.ru/company/mailru/blog/170957/

mailserver @blog