This post details the process to create a standalone SMTP server on Ubuntu 12.04.4 LTS using Postfix.
As Microsoft do not provide basic SMTP services with Office 365 that will work with some of our services we had a requirement for a standalone SMTP server internally on our network. We only needed the ability to send email from various devices (Scan to email from Ricoh photocopiers, email services from our MIS service, etc.) so this process does not cover setting up a mail server to receive email. As we restrict access by network we are not using any form of authentication on the SMTP server currently.
I suggest you configure the box to point to external DNS servers (Google’s 8.8.8.8 and 8.8.4.4 work great) rather than your internal servers so as to avoid having issues with missing MX records for your internal domain.
Also I suggest you follow the details configure shorewall firewall before following the steps below to configure a basic SMTP server.
- Install postfix
sudo apt-get install postfix
- In the installation program enter the FQDN for the server
- Install mailutils
sudo apt-get install mailutils
- Configure the networks which will be allowed to connect, including loopback. (10.111.0.0/24 is our printer subnet)
sudo postconf -e "mynetworks = 127.0.0.0/8, 192.168.0.0/22, 10.111.0.0/24"
- Restart Postfix
sudo /etc/init.d/postfix restart
The server should now be ready! If you don’t start seeing mail flow the postfix log is a good place to start:
tail /var/log/mail.log -f