In short: Before you touch sendmail.cf, understand how mail leaves an AIX LPAR: MUA → Sendmail → queue → SMTP relay → mailbox.
Prerequisites
No prior knowledge of Sendmail is required. This article is designed for beginners and intermediate AIX administrators who want to understand the concepts before configuration.
One of the most common tasks performed by an AIX server is sending automated email notifications—backup reports, filesystem alerts, database notices, monitoring alarms, and cron output.
Although sending an email appears simple, many administrators are unsure what happens after mail, mailx, or sendmail. This article covers the path from an AIX application to the recipient's mailbox and the components involved, before you configure SMTP relays or services such as AWS SES.
1. Why Email is Important in Enterprise AIX
Enterprise AIX systems rarely have users logged in continuously. Administrators rely on automated emails from scripts and applications when important events occur—backup reports, filesystem alerts, database status, monitoring alarms, cron output, and security notices—so they can respond without watching every server.
2. High-Level Email Architecture
Before exploring each component individually, let's look at the complete email flow in a simplified architecture diagram.
Application / Script / Cron Job
|
v
mail / mailx / sendmail
|
v
Sendmail (Mail Transfer Agent)
|
| SMTP
v
SMTP Relay Server
|
v
Recipient Mail Server
|
v
User MailboxEvery email generated from an AIX server follows this logical path. The only difference between organizations is the SMTP relay server being used. Some organizations use Microsoft Exchange, while others rely on cloud-based email services such as Amazon Simple Email Service.
3. Components of an Email System
Email infrastructure is built from several independent components, each with a specific role:
- Mail User Agent (MUA)
- Mail Transfer Agent (MTA)
- Mail Delivery Agent (MDA)
- SMTP Protocol
- DNS Mail Exchange (MX) Records
- Recipient Mail Server
4. Mail User Agent (MUA)
A Mail User Agent is the software responsible for creating an email message. It allows a user or an application to compose a message and submit it for delivery.
On an AIX server, administrators generally use command-line utilities instead of graphical email clients. Common tools include mail, mailx, and mutt.
echo "Backup completed successfully." | mail -s "Backup Status" admin@example.comThe mail command itself does not establish a network connection to the recipient's mail server. Its responsibility ends after preparing the message and handing it over to the Mail Transfer Agent.
5. Mail Transfer Agent (MTA)
Once an email has been created by the Mail User Agent, it is handed over to a Mail Transfer Agent. The MTA is the core component responsible for moving email from one system to another.
In IBM AIX, the default Mail Transfer Agent is Sendmail. Other UNIX and Linux systems may use Postfix, Exim, or Qmail, but Sendmail has traditionally shipped with AIX.
- Accepts messages from applications and users.
- Places outgoing emails into a mail queue.
- Resolves recipient domains using DNS.
- Communicates with remote SMTP servers.
- Retries delivery if the destination server is unavailable.
- Maintains mail logs for troubleshooting.
- Performs SMTP authentication when required.
- Supports encrypted communication using TLS.
How Sendmail Fits into AIX
Whenever an application generates an email, Sendmail acts as the intermediary between the application and the remote mail server.
Application
|
v
mail / mailx
|
v
Sendmail (Mail Transfer Agent)
|
| SMTP
v
SMTP Relay Server
|
v
Recipient Mail ServerSendmail receives the message, processes headers, determines the destination, performs DNS lookups if necessary, establishes an SMTP connection, and attempts delivery. If the remote server is temporarily unavailable, the message is stored in the mail queue and retried automatically.
6. Mail Delivery Agent (MDA)
While the Mail Transfer Agent transports email between systems, the Mail Delivery Agent delivers incoming email into a user's mailbox after the destination mail server accepts it.
Examples include mail.local, procmail, Dovecot LDA, and Cyrus Delivery Agent.
Internet
|
v
Recipient Mail Server
|
v
Mail Delivery Agent
|
v
User Mailbox7. Understanding SMTP
Mail Transfer Agents exchange messages over TCP/IP using the Simple Mail Transfer Protocol (SMTP).
Client ----> HELO mail.example.com
Server ----> 250 Hello
Client ----> MAIL FROM:<backup@example.com>
Server ----> 250 OK
Client ----> RCPT TO:<admin@example.com>
Server ----> 250 Accepted
Client ----> DATA
Server ----> 354 Start mail input
Client ----> Email Body
Client ----> .
Server ----> 250 Message Queued
Client ----> QUITAdministrators rarely interact with these SMTP commands directly, but understanding them makes troubleshooting significantly easier.
SMTP Ports
| Port | Purpose |
|---|---|
| 25 | Traditional server-to-server email transfer. |
| 465 | SMTP over SSL, also called implicit TLS. |
| 587 | Authenticated SMTP submission, commonly recommended. |
Modern cloud email providers such as AWS SES, Microsoft Exchange Online, and many enterprise SMTP gateways recommend using port 587 together with TLS encryption and SMTP authentication.
8. DNS Mail Exchange (MX) Records
Before an email can be delivered, the sending server must determine which mail server is responsible for receiving email for the destination domain. This information is stored in DNS using Mail Exchange records.
Recipient Address: admin@example.com
Domain Extracted: example.com
DNS MX Record: MX 10 mail.example.com
SMTP Target: mail.example.comWithout MX records, Mail Transfer Agents cannot reliably determine where to deliver mail for a domain.
9. Local Mail vs. Remote Mail Delivery
Local Mail Delivery
Local mail delivery occurs when both the sender and recipient exist on the same AIX system. In this scenario, the message never leaves the server and no network communication takes place.
echo "System maintenance completed." | mail rootApplication
|
v
mail / mailx
|
v
Sendmail
|
v
Local Mailbox (/var/spool/mail/root)Remote Mail Delivery
Remote mail delivery is used when the recipient belongs to another server or an external domain such as Gmail, Outlook, or a corporate email system.
echo "Backup completed successfully." | mail -s "Backup Status" admin@example.com10. Why Enterprise Environments Use SMTP Relay Servers
Many administrators assume an AIX server delivers mail directly to Gmail, Outlook, or other Internet servers. In enterprise designs, AIX usually forwards all outgoing mail to a dedicated SMTP relay, which then delivers to final destinations.
- Centralized authentication and TLS.
- Spam filtering and malware scanning.
- Centralized logging and auditing.
- Better delivery reputation and IP protection.
- Simpler management across many servers.
11. Complete End-to-End Email Flow
At every stage, a different component performs a specific task. Understanding these responsibilities makes it much easier to identify where problems occur when email delivery fails.
1. Application or shell script
2. mail / mailx command
3. Sendmail (Mail Transfer Agent)
4. SMTP relay server
5. DNS MX lookup
6. Recipient mail server
7. Mail Delivery Agent
8. Recipient mailbox
12. Key Concepts Recap
| Component | Responsibility |
|---|---|
| Mail User Agent (MUA) | Creates and submits email messages. |
| Mail Transfer Agent (MTA) | Transfers email between mail servers. |
| Mail Delivery Agent (MDA) | Stores incoming email in the recipient's mailbox. |
| SMTP | Protocol used for email transmission. |
| DNS MX Record | Identifies the mail server responsible for a domain. |
| SMTP Relay | Provides secure and centralized email forwarding. |
Key Takeaways
- Applications create email but do not deliver it.
- Sendmail acts as the Mail Transfer Agent.
- SMTP is the protocol used to transport email.
- DNS MX records identify the destination mail server.
- SMTP relay servers improve security, reliability, and compliance.
Frequently Asked Questions
What is Sendmail?
Sendmail is the default Mail Transfer Agent on AIX responsible for routing and delivering email.
What is the difference between mail and Sendmail?
The mail command creates an email, while Sendmail delivers it.
Why do enterprises use SMTP relays?
SMTP relays provide authentication, TLS encryption, centralized logging, spam protection, and reliable delivery.