Outgoing emails w/ Postfix

Mail aliases

#netbsd/slackware
cp -i /etc/mail/aliases /etc/mail/aliases.dist
vi /etc/mail/aliases

#debian/ubuntu
cp -i /etc/aliases /etc/aliases.dist
vi /etc/aliases

root:       REAL-EMAIL-ADMIN

newaliases
#postalias /etc/mail/aliases

Postfix KISS

NO NEED TO LISTEN ON INET/INET6 (unix socket is enough)

mv -i /etc/postfix/master.cf /etc/postfix/master.cf.dist
sed '/^[[:space:]]*$/d; /^[[:space:]]*#/d' /etc/postfix/master.cf.dist > /etc/postfix/master.cf
vi /etc/postfix/master.cf

#smtp      inet  n       -       y       -       -       smtpd

can you reach your relay?

smarthost=x.x.x.x
#nmap -p 25,465,587 $smarthost
nc -vz $smarthost 25 465 587

now define it

#/usr/share/postfix/main.cf.debian
mv -i /etc/postfix/main.cf /etc/postfix/main.cf.dist
sed '/^[[:space:]]*$/d; /^[[:space:]]*#/d' /etc/postfix/main.cf.dist > /etc/postfix/main.cf
vi /etc/postfix/main.cf

relayhost = x.x.x.x

Operations

postfix check && echo OK || echo NOK
service postfix restart

Acceptance

tail -F /var/log/maillog
tail -F /var/log/mail.log
date | mail -s `hostname` root

Resources

Postfix https://calomel.org/postfix.html

Chapter 27. Mail and news https://www.netbsd.org/docs/guide/en/chap-mail.html


HOME | GUIDES | BENCHMARKS | html