Step 1 – Install
pkgin install postfix
echo 'postfix=YES' >> /etc/rc.conf && service postfix start
Step 2 – /etc/postfix/main.cf
myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 127.0.0.0/8 [::1]/128
# TLS
smtpd_tls_cert_file = /etc/ssl/certs/mail.example.com.crt
smtpd_tls_key_file = /etc/ssl/private/mail.example.com.key
smtpd_tls_security_level = may
smtp_tls_security_level = may
# Mailbox
home_mailbox = Maildir/
message_size_limit = 52428800
# Anti-spam
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
Step 3 – Reload and test
postfix check
systemctl reload postfix 2>/dev/null || rcctl reload postfix
echo "Test" | mail -s "Test" [email protected]