Beruflich Dokumente
Kultur Dokumente
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891To generate the key run following command
:
cd /etc/mail
sudo opendkim-genkey -t -s mail -d domain.com
cp mail.private /etc/mail/dkim.keyThe DNS TXT entry should be a copy&paste of ma
il.txt
mail._domainkey.domain.com. IN TXT "v=DKIM1; g=*; k=rsa; p=openssl_public_key";1
5. OPTIONAL: Add backup MX
First of all you have to add an additional MX record with a higher priority:
@ mailserver.domain.com. MX 10 3600
@ backupmailserver.domain.com. MX 20 3600Everyone is first trying to send the em
ail to mailserver.domain.com, if it is not reachable backupmailserver.domain.com
is used.
The higher the priority the lower the chance that someone is using the MX server
.
Next change of the backup mail server is the main.cf:
relay_domains = $mydestination, hash:/etc/postfix/relay_domains
transport_maps = hash:/etc/postfix/relay_transportNow we have to define the rela
y domains:
nano /etc/postfix/relay_domainsContent:
domain1.com anything
domain2.com anything
domain3.com anythingA backup MX can be responsible for more than one domain.
Now we have to define what the backup mail server should do with an incoming ema
il:
nano /etc/postfix/relay_transportConent:
domain1.com relay:mailserver.domain1.com
domain2.com relay:mailserver.domain2.com
domaint3.com relay:mailserver.domain3.comJust forward them to the real mail serv
ers.
Last step is to map both files:
cd /etc/postfix
postmap relay_domains
postmap relay_transportIf you want you can add a time to live for the emails too
:
maximal_queue_lifetime = 60d So the backup server will store the mails for 60 da
ys. Hopefully your main mail server will not be offline for more than 60 days.
16. Restart you vps
Done.