Jump to content

Postfix (software)

From Wikipedia, the free encyclopedia
Postfix
Original author(s)Wietse Venema at the IBM Thomas J. Watson Research Center
Developer(s)Venema and many others
Initial releaseDecember 14, 1998; 25 years ago (1998-12-14)
Stable release
3.9.0 / March 6, 2024; 8 months ago (2024-03-06)
Preview release
3.10-202401113 / November 13, 2024; 6 days ago (2024-11-13)
Repository
Written inC[1]
Operating systemCross-platform
TypeMail transfer agent
LicenseIBM Public License or Eclipse Public License
Websitewww.postfix.org

Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail.

It is released under the IBM Public License 1.0 which is a free software license. Alternatively, starting with version 3.2.5, it is available under the Eclipse Public License 2.0 at the user's option.[2]

Originally written in 1997 by Wietse Venema at the IBM Thomas J. Watson Research Center in New York, and first released in December 1998,[3] Postfix continues as of 2023 to be actively developed by its creator and other contributors. The software is also known by its former names VMailer and IBM Secure Mailer. The name Postfix is a compound of "post" (which is another word for "mail") and "bugfix" (which is for other software that inspired Postfix development).

Typical deployment

[edit]

As an SMTP server, Postfix implements a first layer of defense against spambots and malware. Administrators can combine Postfix with other software that provides spam/virus filtering (e.g., Amavisd-new), message-store access (e.g., Dovecot), or complex SMTP-level access-policies (e.g., postfwd, milter-regex, policyd-weight).

As an SMTP client, Postfix implements a high-performance parallelized mail-delivery engine. Postfix is often combined with mailing-list software (such as Mailman).

Operating systems

[edit]

Postfix runs (or has run) on AIX, BSD, HP-UX, Linux, macOS, Solaris and, generally speaking, on every Unix-like operating system that ships with a C compiler and delivers a standard POSIX development environment. It is the default MTA for the macOS, NetBSD,[4] RedHat/CentOS[5] and Ubuntu operating systems.[6]

Architecture

[edit]

Postfix consists of a combination of server programs that run in the background, and client programs that are invoked by user programs or by system administrators.

The Postfix core consists of several dozen server programs that run in the background, each handling one specific aspect of email delivery. Examples are the SMTP server, the scheduler, the address rewriter, and the local delivery server. For damage-control purposes, most server programs run with fixed reduced privileges, and terminate voluntarily after processing a limited number of requests. To conserve system resources, most server programs terminate when they become idle.

Client programs run outside the Postfix core. They interact with Postfix server programs through mail delivery instructions in the user's ~/.forward file, and through small "gate" programs to submit mail or to request queue status information.

Other programs provide administrative support to start or stop Postfix, query status information, manipulate the queue, or to examine or update its configuration files.

Yellow ellipses
One of Postfix' many daemons serving exactly one purpose. This split-up into many smaller pieces of software is considered one of the reasons why Postfix is secure and stable.
Blue boxes
The blue boxes represent so-called lookup tables. A lookup table consists of two columns (key and value) containing information used for access control, e-mail routing etc.
Orange boxes
The orange boxes are either mail queues or files. In either case, e-mails are stored on persistent media (e.g., a hard disk).
White clouds
The clouds stand for points at which e-mails enter or leave Postfix. For example, smtpd receives mail from other mail servers or users whereas smtp relays mail to other MTAs.

Implementation

[edit]

The Postfix implementation uses safe subsets of the C language and of the POSIX system API. These subsets are buried under an abstraction layer that contains about 50% of all Postfix source code, and that provides the foundation on which all Postfix programs are built. For example, the "vstring" primitive makes Postfix code resistant to buffer overflow[7] attacks, and the "safe open" primitive makes Postfix code resistant to race condition attacks on systems that implement the POSIX file system API. This abstraction layer does not affect the attack resistance of non-Postfix code, such as code in system libraries or in third-party libraries.

Robustness

[edit]

Conceptually, Postfix manages pipelines of processes that pass the responsibility for message delivery and error notification from one process to the next. All message and notification "state" information is persisted in the file system. The processes in a pipeline operate mostly without centralized control; this relative autonomy simplifies error recovery. When a process fails before completing its part of a file or protocol transaction, its predecessor in the pipeline backs off and retries the request later, and its successor in the pipeline discards unfinished work. Many Postfix daemons can simply "die" when they run into a problem; they are automatically restarted when the next service request arrives. This approach makes Postfix highly resilient, as long as the operating system or hardware don't fail catastrophically.

Performance

[edit]

One single Postfix instance has been clocked at ~300 message deliveries/second[8] across the Internet, running on commodity hardware (a vintage-2003 Dell 1850 system with battery-backed MegaRAID controller and two SCSI disks). This delivery rate is an order of magnitude below the "intrinsic" limit of 2500 message deliveries/second[8] that was achieved with the mail queue on a RAM disk while delivering to the "discard" transport (with a dual-core Opteron system in 2007).

Mail systems such as Postfix and Qmail achieve high performance by delivering mail in parallel sessions. With mail systems such as Sendmail and Exim that do one delivery at a time, high performance can be achieved by submitting limited batches of mail in parallel, so that each batch is delivered by a different process. Postfix and Qmail require parallel submission into different MTA instances once they reach their intrinsic performance limit, or the performance limits of the hardware or operating system.

The delivery rates cited above are largely theoretical. With bulk mail delivery, the actual delivery rate primarily depends on the receiver's mail receiving policies and by the sender's reputation.

Base configuration

[edit]

The main.cf file stores site-specific Postfix configuration parameters while master.cf defines daemon processes.[9] The Postfix Basic Configuration tutorial covers the core settings that each site needs to consider, and the Postfix Standard Configuration Examples document discusses configuration settings for a few common environments. The Postfix Address Rewriting document covers address rewriting and mail routing. The full documentation collection is at Postfix Documentation

More complex Postfix implementations may include: integration with other applications such as SpamAssassin; support for multiple virtual domain names - and use databases such as MySQL to control complex configurations.

Surveys

[edit]

In Shodan scan results from November 2024,[10] Postfix was detected 2.74 million times, Exim 2.86 million times. Some sites block Shodan probes, but it is unclear whether this would materially affect the Postfix to Exim ratio.

In a 10 times smaller study published on November 1, 2024 by E-Soft, Inc.,[11] 0.20 million mail servers ran Postfix, making it a more distant second behind Exim with 0.30 million. The E-Soft survey is often cited, but it specifically targets domains that provide web services and therefore covers a much smaller population.

See also

[edit]

References

[edit]
  1. ^ Lextrait, Vincent (July 2010). "The Programming Languages Beacon, v10.3". Archived from the original on 30 May 2012. Retrieved 5 September 2010.
  2. ^ "Postfix stable release 3.2.5, and legacy releases 3.1.8, 3.0.12, and 2.11.11". January 2018. Retrieved 30 January 2018.
  3. ^ Markoff, John (December 1998). "Sharing Software, IBM to Release Mail Program Blueprint". The New York Times. Retrieved 17 September 2017.
  4. ^ "The NetBSD Guide. Chapter 27. Mail and news". Retrieved 2010-05-10.
  5. ^ "CHAPTER 24. POSTFIX".
  6. ^ "Postfix". Community Documentation, Ubuntu Wiki. Retrieved 2012-03-09.
  7. ^ Hontañón, Ramón J (July 10, 2001). Linux Security. San Francisco: Sybex. p. 166. ISBN 978-0-7821-2741-6. Retrieved 2011-09-21.
  8. ^ a b "Bulk Mailing Performance". Retrieved 2012-09-09.
  9. ^ Postfix-Tutorial.com: Postfix, Courier/POP, SASL & Spamassassin – with MySQL admin
  10. ^ "Facet Analysis". Shodan Search Engine. Retrieved 1 November 2024.
  11. ^ "Mail (MX) Server Survey". securityspace.com. E-Soft, Inc. 1 November 2024. Retrieved 11 November 2024.

Further reading

[edit]
[edit]