Installing Postfix
Run the following commands:
sudo apt-get update sudo apt-get install postfix
Configuring Postfix
- Run the following command:
sudo dpkg-reconfigure postfix
Configuration questions:
- Select OK to proceed.
- Choose Satellite system.
- System Mail Name: <EMAIL_DOMAIN>
- SMTP relay host: <RELAY_HOST>
Where RELAY_HOST must include the port number (e.g. 192.168.1.1:465).
- Root and postmaster mail recipient: root
- Other destinations to accept mail for: <EMAIL_DOMAIN>, localhost.localdomain, localhost
- Force synchronous updates on mail queue? No
- Local networks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
- Mailbox size limit (bytes): 0
- Local address extension character: +
- Internet protocols to use: all
Feel free to answer the preceding questions based on your setup. Just replace the EMAIL_DOMAIN (i.e. example.com) with a valid value.
- Create the file /etc/postfix/sasl_passwd with the following content:
<RELAY_HOST> username:password
- Create a postfix database based on /etc/postfix/sasl_passwd using the following command:
sudo postmap /etc/postfix/sasl_passwd
- Edit the file /etc/postfix/main.cf to have the following entries added or updated:
smtp_tls_security_level = encrypt smtp_sasl_auth_enable = yes smtp_tls_wrappermode = yes smtp_sasl_security_options = smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
- Restart the postfix service with the following command:
sudo systemctl restart postfix
Leave a Reply