Postfix

botond published Jan. 2023, 03, 22:05 p.m. time

Content

 

Overview

Postfix is ​​an extremely popular free and open source MTA (Mail Transfer Agent) software developed by Wietse Venema in 1997 and first released in December 1998. The software was originally developed for the IBM AIX operating system, but has since been used on many other systems, including Linux, BSD, macOS, and Solaris, but will run on any Unix-like operating system that includes a C compiler.

Postfix aims to provide a secure and reliable mail service that is resistant to Internet attacks and spam. To this end, Postfix has a number of security features, such as traffic restriction, server and client authentication, virus and spam filtering, and content filtering. during its operation, the processed mail passes through a filter system that filters out spam, viruses and advertisements, after which the mail is forwarded to the destination servers. Postfix supports mail transfer over SMTP, ESMTP, STARTTLS and LMTP protocols.

The configuration of Postfix is ​​very flexible and includes many options for fine-tuning each function. Even the default settings are safe and reliable, but it is possible to add or change additional settings according to your specific needs.

 

 

Mailing methods

Postfix's mail sending functions can essentially be divided into two types:

Local mail delivery

Postfix's basic mail delivery method is the local mail delivery method. In this case, it delivers mail that UNIX users want to send to other UNIX users. In this case, correspondence is only done between users of the local UNIX system, which Postfix a local (local delivery agent) to the local text file-based mailboxes, which by default are in /var/mail/ , or /var/spool/mail/ they are in the library. In the case of the local mail sending method, no external POP3/IMAP service, and in this case Postfix does not use the SMTP (Simple Mail Transfer Protocol) protocol to deliver mail either. The local delivery agent therefore only performs simple delivery tasks within the server.

Remote mail sending

In the case of remote mail sending, Postfix uses the SMTP protocol when communicating with external mail servers, when there is a mail waiting to be sent on the server, or when a foreign mail arrives from outside that needs to be checked, etc.

When sending mail remotely, Postfix uses other delivery agents, such as Maildrop, instead of the local delivery agent.

Maildrop is a mail delivery program that can be used to connect external mail services to the Postfix mail system. Maildrop allows, for example, to pre-process mail received by Postfix and perform various operations on it, such as filtering or sorting.

Using Maildrop also helps to automatically forward emails to other systems or services, such as IMAP or POP3 servers, or Amazon's AWS Simple Notification Service (SNS).

So Postfix can be configured to deliver mail directly to remote POP3/IMAP mailboxes by nem use the local delivery agent as an intermediary. This means you don't get local aliases extraction, or $HOME/.forward file processing. This is usually used for hosted domains whose recipients do not have a UNIX HOME directory. This configuration is, for example, the usual setting on systems functioning as a web server, where e-mails are not used in the UNIX local HOME directories, but in the POP3/IMAP directories of mail accounts with the help of some POP3/IMAP server. Postfix is ​​then used in conjunction with another POP3/IMAP server such as Dovecot or Courier.

Maildrop is therefore a program that extends the Postfix system and enables the forwarding, processing and management of mail received by Postfix to be even more efficient. However, using Maildrop is optional and not required to use Postfix's core capabilities.

 

Special operating modes

Postfix's flexible configuration options allow Postfix to work in special ways. Let's see some of them.

Relay server

A relay server allows the Postfix system to forward mail through another server. Practical examples:

  • This is used when, for example, the Postfix server does not have a direct connection to the target server
  • or when the IP address of the sending server is blacklisted by the destination server.
  • or if we want to send mail from a home development or test environment, but the (usually residential) Internet service provider does not allow the use of the SMTP port in order to reduce spam activities.

In these cases, a Postfix relay server configured with a username and password can forward mail sent through it. For this, of course, the mail sending configuration of the source server (e.g. our home web server, or from which we originally want to send the letter) must also be added (as a proxy server) to the relay server.

A relay server should therefore be seen as a special configuration that allows the Postfix system to forward mail through external servers. In another description, we will look at the setting of this as well.

Proxy server

A proxy server in the case of sending mail is a configuration that allows the Postfix system to take over the role of the SMTP server of other systems, i.e. it plays an intermediate role in the transmission of mail. Practical examples:

  • for example, it allows e-mails to be pre-screened and filtered before they are forwarded
  • it is also used to increase security or load distribution
  • when used in conjunction with a relay server, for example, mail requests from the home development environment can be redirected to an external server, thus circumventing the SMTP restrictions of the home internet, since in this case mail is physically sent from the relay server, which will use the SMTP protocol of that server.

 

 

Other Features

Postfix also has many other functions, let's see some of them:

Email forwarding

With the help of the email forwarding function, it is possible to automatically forward incoming mail to one or more email addresses to one or more other email addresses. Practical examples:

  • Company managers: Many company managers have several email addresses, for example one for personal communication and one for work matters, etc. With the help of the email forwarding function, company managers can easily redirect all emails to a single email address, which is easier to manage.
  • Groupwork: If a work group has a common email address, the forwarding function can be useful so that all members receive all incoming messages. For example, an educational institution can have a common email address for all teachers, and with the help of the forwarding function, all teachers receive all important messages.
  • Workplace substitution: If an employee goes on vacation or stays away from work for a longer period of time, the forwarding function allows all incoming emails to be forwarded to the replacement email address. This helps the replacement colleague to handle important matters while the colleague is away.
  • Marketing campaigns: If a company launches marketing campaigns, the forwarding function allows the forwarding of all campaign-related emails to a dedicated email address. This helps to easily manage the responses to the campaign and to monitor the effectiveness of the campaigns.
  • General communication: With the help of the forwarding function, it is possible to forward all emails to a single email address that users can easily manage. This can be especially useful if someone uses several email addresses and does not want all emails to arrive individually.

Spam filtering

Postfix has a built-in spam filter that allows you to filter and reject spam messages in incoming mail. A number of rule systems can be applied to the filter, some of which are included in Postfix itself, while others are provided by external software. Based on the rules, Postfix decides whether an incoming mail is spam or not. Such rules include, for example, those that monitor the sender's and recipient's IP addresses and their PTR record, the content of the message text, the data of the message header and other similar information.

A variety of third-party spam filtering software is available for Postfix, which can be used to customize the filtering rules. Such software, for example, SpamAssassin, ClamAV and the DSPAM. Rules are customized and filter software is used in Postfix configuration files, which are usually edited and managed using an external interface.

Extended authentication methods

Postfix supports extended authentication methods such as:

  • DomainKeys Identified Mail (DKIM)
  • Sender Policy Framework (SPF)
  • Domain-based Message Authentication, Reporting and Conformance (DMARC)

File-based configuration

Postfix stores all settings in configuration files, which allows for easy maintenance and backups.

User filtering

Postfix allows you to filter users so that only certain people can send them mail.

Monitoring tools

Postfix also comes with a number of management tools, such as Postfix Admin, which is a web-based user interface for administering your Postfix email server. It allows you to manage users and domains, and helps you create and manage mail accounts, aliases, and autoresponders. Postfix Admin has many beneficial features, including:

  • Simple interface: Postfix Admin's web user interface is easy to use and clear, making it easy to manage users and domains.
  • User accounts: Postfix Admin allows you to create and manage user accounts, including email addresses and passwords.
  • Management of domains: Postfix Admin helps you create and manage domains, allows you to configure domains and e-mail addresses associated with domains.
  • Automatic responses: Postfix Admin allows you to create autoresponders (or autoresponders) that automatically respond to e-mail messages based on certain criteria.
  • Manage aliases: Postfix Admin allows you to create and manage aliases (or secondary email addresses).
  • Virtual users and domains: Virtual users and domains allow Postfix to handle sending and receiving email without the need for a full user system. This means that Postfix stores email addresses and their associated domains in a database and does not use system user accounts or the user system.
    This can be useful if, for example, several domains need a mail server, but we don't want users to log into a full-fledged system to send and receive mail. Using virtual users and domains requires a database containing all email addresses and their associated domains, as well as tools such as Postfix Admin that allow you to manage email addresses and domains.
Here it is important to note that if on our server ISPConfig or other web hosting control panel works - which fully provides these functions as well -, in this case we avoid using Postfix Admin, because the settings may conflict with the settings of the control panel used. The Postfix Admin panel is therefore used when, for example, a simpler one is needed LAMP we have a server on which there is no other control panel installed.

Scalability

Postfix is ​​a highly scalable mail server suitable for running from small to large systems. Some main features that facilitate this:

  • is able to use more CPUs or cores, which allows for better performance even when handling large volumes of mail.
  • it can run in asynchronous mode, which allows the server to handle multiple clients simultaneously while reducing system overload.
  • supports more efficient use of resources, such as concurrent access limits, process and thread limits, and database caching.
  • administrators can easily add more servers to the system to improve system performance or distribute the load when it grows.
  • supports design for larger systems, such as larger databases and larger storage units, which allow for the storage and management of larger volumes of email.

In summary, the scalability of Postfix means that system administrators can easily manage growing demands and effectively improve system performance, stability, and security through more efficient use of resources.