Postfix Transactional Email Service
Open Source Mail Transfer Agent for UNIX based Systems
Postfix is a powerful mail transfer agent for email routing and delivery. It offers useful features like junk mail control, database support and log management.
Email is one of the fastest and reliable communication medium for businesses and individuals. The software which runs this whole communication medium is called mail server and mail client. The mail server that is also known as Mail Transfer Agent is responsible for transferring email from server to server on the internet, while mail client performs the activities of retrieving these emails.
Postfix can run on UNIX based systems including AIX, BSD, HP-UX, Linux, MacOS X, Solaris and this makes it a go to choice as most of world’s system already run on UNIX based OS. Postfix is also available as a default mail transfer agent software by many operating system vendors and supports SMTP. Each vendor has its own customization to the original software as per their requirements.
Postfix offers an amazing set of powerful features like junk mail control, database support, log management and many more. It has a wide support for database like MySQL, Memcache SQLite, PostgreSQL, LDAP.
Mail-in-a-Box offers a webmail and supports IMAP/SMTP which makes it super easy to sync across your mobile devices. It also supports contacts and calendar synchronization. It comes with HTTPS TLS support and generates and renews certificates automatically using Let’s Encrypt which is a free SSL certificate provider.
To run your business operations smoothly and efficiently, a top notch and highly optimized mail software is very important and performance has been the key factor of Postfix’s popularity over other mail server software. It can send more than 300 emails per second from a single instance.
The biggest problems businesses face these days while using the email is spamming. Postfix has a built in powerful content filter, which takes the pain of spam filtering and makes you worry free to be bloated by the spam emails.
The Postfix mail queue requires that:
- Renaming a file to a near-by directory does not change the file’s inode number.
- A file is not lost after fsync() of that file (not its parent directory) returns successfully, and then the system crashes. This must be true even when that file is later renamed to a near-by directory.
- When Postfix in a virtual guest machine flushes a file with fsync(), the file information must not be cached in volatile host memory. Instead the information must immediately be written to disk (or to persistent cache) before fsync() returns in the virtual guest machine.
- Postfix can set the execute bit on a queue file. If this does not work, then no mail will ever be delivered.
In addition to the above, Postfix maildir delivery requires that:
- A file can be hard linked between different near-by directories.
- A file is not lost when it is hard-linked to a near-by directory, unlinked from the old directory, and then the system crashes.
Postfix mailbox delivery introduces no additional requirements.
Files in the Postfix command_directory require that:
- The setgid bit works. This is required to access the mail queue with the postdrop command, and to access protected UNIX-domain sockets with the postdrop and postqueue commands.
The following is a list of major Postfix features. Some features require third-party libraries (examples: LDAP, SQL, TLS). Other features are available only when the necessary operating system support exists and Postfix knows how to use it (examples: IP version 6, connection caching).
Postfix is included in Ubuntu’s default repositories, so installation is incredibly simple.
To begin, update your local
apt package cache and then install the software. We will be passing in the
DEBIAN_PRIORITY=low environmental variable into our installation command in order to answer some additional prompts:
sudo apt-get update sudo DEBIAN_PRIORITY=low apt-get install postfix
Use the following information to fill in your prompts correctly for your environment:
- General type of mail configuration?: For this, we will choose Internet Site since this matches our infrastructure needs.
- System mail name: This is the base domain used to construct a valid email address when only the account portion of the address is given. For instance, the hostname of our server is
mail.example.com, but we probably want to set the system mail name to
example.comso that given the username
user1, Postfix will use the address
- Root and postmaster mail recipient: This is the Linux account that will be forwarded mail addressed to
postmaster@. Use your primary account for this. In our case, sammy.
- Other destinations to accept mail for: This defines the mail destinations that this Postfix instance will accept. If you need to add any other domains that this server will be responsible for receiving, add those here, otherwise, the default should work fine.
- Force synchronous updates on mail queue?: Since you are likely using a journaled filesystem, accept No here.
- Local networks: This is a list of the networks that your mail server is configured to relay messages for. The default should work for most scenarios. If you choose to modify it, make sure to be very restrictive in regards to the network range.
- Mailbox size limit: This can be used to limit the size of messages. Setting it to “0” disables any size restriction.
- Local address extension character: This is the character that can be used to separate the regular portion of the address from an extension (used to create dynamic aliases).
- Internet protocols to use: Choose whether to restrict the IP version that Postfix supports. We’ll pick “all” for our purposes.
To be explicit, these are the settings we’ll use for this guide:
- General type of mail configuration?: Internet Site
- System mail name: example.com (not mail.example.com)
- Root and postmaster mail recipient: sammy
- Other destinations to accept mail for: $myhostname, example.com, mail.example.com, localhost.example.com, 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: 0
- Local address extension character: +
- Internet protocols to use: all
If you need to ever return to re-adjust these settings, you can do so by typing:
$ sudo dpkg-reconfigure postfix
The prompts will be pre-populated with your previous responses.
When you are finished, we can now do a bit more configuration to set up our system how we’d like it.