How to deploy, configure and troubleshoot Postfix on Debian 7 (Wheezy)
Postfix is a free, open source mail transfer agent (MTA) that routes and delivers electronic mail.
I recently decided it might be a good idea to deploy the package in my own local network as it is a central point of configuration to an upstream SMTP server. This will come in handy later on should I decide to physically relocate my hardware and at the same time change my internet service provider.
Run commands without the “#” at the beginning.
Configuring SMTP Authentication to Smarthost
If your upstream SMTP host requires SMTP authentication, you will need to create a password file and add it to /etc/postfix/main.cf configuration file.
Ignore if not required
- #cd /etc/postfix
- #vi password
Add the following line
smtp.relay.com [email protected]:password
- The first part needs to be the upstream SMTP server, this example is smtp.relay.com, separate by tab and type your username, add a “:” and type your password
- #chown root:root password
- #chmod 0600 password
- #postmap hash:password
- “relayhost” to your smart host upstream
- “inet_interfaces =” to all
- mynetworks = Add network address of internal network
- smtp_sasl_auth_enable = yes
- smtp_sasl_password_maps = hash:/etc/postfix/password
- smtp_sasl_security_options =
Check to see Local Address of “0.0.0.0:25” is in a state of “LISTEN”
Check to see if postfix is running by executing the following command:
- #ps aux | grep postfix
Open a second terminal and monitor the mail.log file while in another session telnet to the Postfix server on port 25 and attempt to send a message manually
- #tail –f /etc/log/mail.log
This is an example of a successful sent email
Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.