Configuring Ubuntu SMTP Server

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.

  1. Install postfix
    sudo apt-get install postfix
  2. In the installation program enter the FQDN for the server
  3. Install mailutils
    sudo apt-get install mailutils
  4. 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"
  5. 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


Posted

in

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.