Mail servers are critical components in the infrastructure of any organization that relies on email communication. They ensure the reliable delivery and receipt of emails, manage user mailboxes, and provide security features to protect against spam and unauthorized access. The choice of mail server software can significantly impact the performance, security, and manageability of an email system. This document not only outlines the essential components and protocols involved in mail servers but also provides a comparison of some of the most widely used mail server software options available for Linux systems.
- Mail Transfer Agent (MTA): Responsible for sending and receiving emails between mail servers (e.g., Postfix, Sendmail, Exim).
- Mail Delivery Agent (MDA): Handles the delivery of email to the recipient’s mailbox (e.g., Dovecot, Procmail).
- Mail User Agent (MUA): An application used by users to access and manage their email (e.g., Outlook, Thunderbird).
SMTP (Simple Mail Transfer Protocol): The standard protocol for sending emails between servers. It is also used for sending mail from a client to a mail server.
- Port 25: Default port for SMTP.
- Port 587: This is the default mail submission port. When an email client or outgoing server is submitting an email to be routed by a proper mail server, it should always use SMTP port 587 as the default port. This port, coupled with TLS encryption, will ensure that email is submitted securely and following the guidelines set out by the IETF.
- Port 465: SMTPS (SMTP over SSL) for encrypted communication. IANA has reassigned a new service to this port, and it should no longer be used for SMTP communications.
- Port 2525: This port is not endorsed by the IETF nor IANA. Instead, it can provide it as an alternate port, which mirrors port 587, in the event the above ports are blocked. Because 2525 is a non-traditional high port number, it is typically allowed on consumer ISPs and Cloud Hosting providers, like Google Compute Engine. If you’ve tried the above ports, but experience connectivity issues, try port 2525. This port could also supports TLS encryption.
POP3 (Post Office Protocol 3): Used for retrieving email from a mail server. It downloads the emails to the local device, often deleting them from the server after retrieval.
- Port 110: Default port – this is the default POP3 non-encrypted port.
- Port 995: Encrypted (POP3S) – this is the port you need to use if you want to connect using POP3 securely.
IMAP (Internet Message Access Protocol): Allows clients to read emails from the mail server without downloading them, synchronizing across multiple devices.
- Port 143: Default port - this is the default IMAP non-encrypted port.
- Port 993: Encrypted (IMAPS) – this is the port you need to use if you want to connect using IMAP securely.
- Sending Email: When you send an email, your client (MUA) uses SMTP to communicate with the outgoing mail server (MTA), which forwards the email to the recipient’s mail server.
- Receiving Email: The recipient’s mail server (MTA) receives the email, and an MDA delivers it to the recipient’s mailbox. The recipient can then use a client (MUA) to access the email using IMAP or POP3.
- Use SSL/TLS for encrypting SMTP, IMAP, and POP3 communication to protect the data.
- Implement SPF, DKIM, and DMARC records for email authentication, ensuring that your mail server’s emails are less likely to be marked as spam.
Feature |
Postfix |
Sendmail |
Exim |
Ease of Configuration |
Easy |
Complex |
Moderate |
Security |
High |
Moderate |
High |
Performance |
High |
Moderate |
High |
Documentation |
Extensive |
Moderate |
Extensive |
Community Support |
Large |
Moderate |
Large |
Flexibility |
High |
High |
High |
Default Installation |
Minimal |
Full |
Minimal |
License |
IBM Public License |
Sendmail License |
GPL |
This table provides a quick comparison of the three popular mail servers: Postfix, Sendmail, and Exim. Each has its strengths and weaknesses, and the best choice depends on the specific needs and expertise of the system administrator.
Do you need help or support? Feel free to contact us!