What You'll Learn
- What Sendmail is and why IBM AIX uses it.
- How the Sendmail daemon works.
- Understanding the Sendmail mail queue.
- The purpose of important Sendmail configuration files.
- How Sendmail processes outgoing email.
- Common Sendmail commands every AIX administrator should know.
- Preparation for configuring SMTP relay services such as AWS SES.
Prerequisites
Before reading this article, you should understand the basic email architecture explained in Article 1 – Understanding Email Architecture in AIX. If you already know the roles of the Mail User Agent (MUA), Mail Transfer Agent (MTA), Mail Delivery Agent (MDA), SMTP, and DNS MX records, you're ready to explore how Sendmail implements these concepts on IBM AIX.
1. What is Sendmail?
Sendmail is the default Mail Transfer Agent (MTA) provided with IBM AIX. It is responsible for accepting email messages generated by applications or users, processing those messages, placing them into a mail queue when necessary, and delivering them either locally or to a remote SMTP server.
Unlike an email client such as Outlook or Thunderbird, Sendmail does not provide a graphical interface for composing or reading emails. Instead, it runs as a background service and acts as the engine responsible for transporting email from one system to another.
Whenever an administrator executes commands such as mail or mailx, those utilities simply create the email message. The actual delivery is performed by Sendmail.
Application / Shell Script
|
|
v
mail / mailx
|
|
v
Sendmail
|
|
v
SMTP Relay Server
|
|
v
Recipient Mailbox
The mail command creates an email message. Sendmail delivers the message. This distinction is one of the most important concepts every AIX administrator should understand.
2. Why Does IBM AIX Use Sendmail?
Sendmail has been the standard Mail Transfer Agent on UNIX systems for decades and continues to ship with IBM AIX because it is mature, stable, highly configurable, and well suited for enterprise environments.
Although newer Mail Transfer Agents such as Postfix and Exim have gained popularity on Linux distributions, many enterprise AIX environments continue using Sendmail because of its proven reliability and compatibility with existing automation and operational procedures.
For most organizations, Sendmail is no longer configured as a public-facing mail server. Instead, it operates as an SMTP client that forwards all outgoing email to a centralized SMTP relay such as AWS Simple Email Service (SES), Microsoft Exchange Online, or another enterprise mail gateway.
This approach provides several benefits:
- Centralized authentication and authorization.
- Encrypted communication using TLS.
- Improved email delivery reputation.
- Spam and malware filtering.
- Centralized logging and auditing.
- Simplified management across hundreds of servers.
Real-World Example
Imagine an AIX server running nightly Oracle database backups. Once the backup completes, a shell script executes the mail command to notify the database administrator. The script does not connect directly to Gmail or Outlook. Instead, the email is handed to Sendmail, which forwards it to the organization's SMTP relay. The relay authenticates itself, encrypts the connection using TLS, and delivers the email to the administrator's mailbox.
3. Key Features of Sendmail
Sendmail provides a rich set of features that make it suitable for enterprise environments.
- Supports SMTP protocol for email transmission.
- Processes both local and remote email delivery.
- Maintains a mail queue for retrying failed deliveries.
- Supports TLS encryption.
- Supports SMTP authentication using SASL.
- Provides extensive logging for troubleshooting.
- Supports mail aliases and mailing lists.
- Integrates with enterprise SMTP relay services.
These capabilities allow Sendmail to act as a reliable bridge between applications running on an AIX server and the organization's email infrastructure.
4. Sendmail Architecture
To understand how Sendmail processes email, it's important to look at its internal workflow. Every message generated by an application follows a predictable sequence before reaching the recipient.
Application / Shell Script
|
|
v
mail / mailx
|
|
v
+------------------+
| Sendmail |
| Mail Transfer |
| Agent |
+------------------+
|
|
v
Mail Queue
|
|
v
SMTP Connection
|
|
v
SMTP Relay
|
|
v
Recipient Mail Server
|
|
v
User Mailbox
Whenever an application submits an email, Sendmail first accepts the message, validates its format, determines the destination, and places it into the mail queue if immediate delivery is not possible. The daemon then establishes an SMTP connection with the configured mail server or relay and transfers the message.
Applications never communicate directly with Gmail, Outlook, or Exchange. Every outgoing message passes through Sendmail before it leaves the AIX server.
5. Understanding the Sendmail Daemon
Sendmail operates as a background daemon that continuously waits for incoming mail requests. Like many system services in AIX, it runs independently of user sessions and starts automatically during system startup.
The daemon performs several important responsibilities:
- Accepts messages from local applications.
- Listens for SMTP connections (when enabled).
- Processes the mail queue.
- Attempts delivery of queued messages.
- Logs delivery status and errors.
Unlike the mail command, which exits immediately after submitting an email, the Sendmail daemon continues running in the background and manages message delivery.
On AIX, Sendmail is typically started through the System Resource Controller (SRC).
startsrc -s sendmail -a "-bd -q30m"
The startup options have specific meanings.
| Option | Description |
|---|---|
| -bd | Runs Sendmail as a background daemon and listens for SMTP connections. |
| -q30m | Processes the mail queue every 30 minutes. |
In many enterprise environments, Sendmail does not receive mail from the Internet. Instead, it operates solely as an SMTP client, forwarding outgoing email to a trusted relay server.
6. Understanding the Mail Queue
One of Sendmail's most important features is the mail queue. Rather than immediately discarding messages when delivery fails, Sendmail stores them safely until another delivery attempt can be made.
Application
|
|
v
Sendmail
|
|
v
Mail Queue
|
|
+-------> SMTP Available -----> Delivered
|
|
+-------> SMTP Failure -------> Retry Later
This mechanism ensures that temporary network problems do not result in lost emails.
Messages remain in the queue whenever delivery cannot be completed because of conditions such as:
- Temporary DNS failures.
- SMTP relay unavailable.
- Network connectivity issues.
- Firewall restrictions.
- Remote mail server temporarily offline.
Once the problem has been resolved, Sendmail automatically retries delivery during the next queue processing interval.
The mail queue acts as a safety buffer between applications and the network. Even if the SMTP relay is temporarily unavailable, applications can continue generating email without interruption.
7. Queue Processing
Sendmail periodically scans the mail queue and attempts to deliver any pending messages. The frequency of this process is determined by the queue interval specified when the daemon starts.
Common queue intervals include:
| Option | Meaning |
|---|---|
| -q15m | Process the queue every 15 minutes. |
| -q30m | Process the queue every 30 minutes. |
| -q1h | Process the queue every hour. |
Choosing an appropriate queue interval depends on business requirements. Critical production systems often use shorter intervals to ensure rapid email delivery, while less critical systems may process the queue less frequently.
8. Important Sendmail Configuration Files
Sendmail uses several configuration files, each serving a different purpose. Understanding these files is essential before making configuration changes in later articles.
| File | Purpose |
|---|---|
| /etc/mail/sendmail.cf | Main Sendmail configuration file. |
| /etc/mail/submit.cf | Configuration used by local mail submission programs. |
| /etc/mail/aliases | Defines local mail aliases. |
| /etc/mail/local-host-names | Specifies hostnames accepted by Sendmail. |
| /etc/mail/helpfile | SMTP help messages. |
| /etc/mail/statistics | Mail delivery statistics. |
Among these files, sendmail.cf is the most important because it controls how Sendmail behaves, how it connects to SMTP servers, and how messages are routed. However, administrators should avoid manually editing this file without first understanding its structure and purpose.
In the following articles, we'll explore these configuration files in detail while configuring Sendmail to authenticate securely with AWS Simple Email Service (SES) using SASL and TLS.
9. Mail Aliases
Managing multiple email recipients individually can quickly become difficult in large environments. To simplify administration, Sendmail supports mail aliases, allowing administrators to redirect messages from one local user to another user or even to multiple recipients.
For example, instead of sending email directly to several administrators, messages can be addressed to a single alias.
Application
|
|
v
root
|
|
v
aliases
|
|
+------------> admin1@example.com
|
+------------> admin2@example.com
|
+------------> admin3@example.com
Aliases are stored in the following file:
/etc/mail/aliases
After modifying the aliases file, Sendmail must rebuild the alias database before the changes become active.
newaliases
Instead of hardcoding email addresses inside scripts, create logical aliases such as backup-team, db-admin, or storage-alerts. This allows recipient changes without modifying production scripts.
10. Logging and Monitoring
When email delivery fails, logs become one of the most valuable troubleshooting resources. Sendmail records information about message processing, connection attempts, delivery status, and errors generated during communication with remote mail servers.
Depending on the system configuration, administrators may use several sources when investigating mail-related issues.
| Location | Purpose |
|---|---|
| /var/spool/mqueue | Stores queued email awaiting delivery. |
| syslog | Sendmail activity and SMTP communication. |
| errpt | AIX operating system errors. |
| /etc/mail | Configuration and alias files. |
When troubleshooting email delivery, administrators should first verify that the Sendmail daemon is running, confirm that the mail queue is not growing unexpectedly, and review the system logs for SMTP or DNS related errors.
- Is the Sendmail daemon running?
- Is the SMTP relay reachable?
- Can the server resolve DNS names?
- Is the mail queue increasing?
- Are firewall rules blocking SMTP traffic?
11. Common Sendmail Commands
Every AIX administrator should be familiar with the following Sendmail commands. These commands are frequently used during service management and troubleshooting.
| Command | Description |
|---|---|
| lssrc -s sendmail | Check whether the Sendmail daemon is running. |
| startsrc -s sendmail | Start the Sendmail service. |
| stopsrc -s sendmail | Stop the Sendmail service. |
| refresh -s sendmail | Reload the configuration without restarting the daemon. |
| mailq | Display queued email messages. |
| sendmail -bp | Display the mail queue. |
| newaliases | Rebuild the aliases database. |
Unlike many Linux distributions that rely on systemd, IBM AIX manages Sendmail using the System Resource Controller (SRC). This provides a consistent interface for starting, stopping, and monitoring system services.
If you're new to AIX administration, you'll frequently use the SRC commands (startsrc, stopsrc, and lssrc) not only for Sendmail, but also for many other system services.
12. Typical Mail Flow
Let's bring everything together and examine the complete path taken by an email generated on an AIX server.
Shell Script
|
|
v
mail / mailx
|
|
v
Sendmail
|
|
v
Mail Queue
|
|
v
SMTP Relay
(AWS SES / Exchange)
|
|
v
Recipient Mail Server
|
|
v
Recipient Mailbox
Each component performs a dedicated task, ensuring that applications remain independent of the underlying email infrastructure.
13. Common Sendmail Problems
Most Sendmail issues are not caused by Sendmail itself. They are typically related to networking, DNS, authentication, or SMTP relay configuration.
| Problem | Possible Cause |
|---|---|
| Mail remains in queue | SMTP relay unavailable or network issue. |
| Connection timed out | Firewall blocking SMTP traffic. |
| Host unknown | DNS resolution failure. |
| Relay denied | SMTP authentication missing or incorrect. |
| Authentication failed | Invalid username or password. |
Fortunately, every one of these scenarios will be covered in the upcoming articles of this series.
14. Sendmail Best Practices
- Use an authenticated SMTP relay instead of direct Internet delivery.
- Enable TLS encryption whenever supported.
- Monitor the mail queue regularly.
- Review Sendmail logs after configuration changes.
- Use aliases instead of hardcoding email addresses.
- Keep a backup of Sendmail configuration files.
- Test email delivery after every system update.
Modern organizations generally use Sendmail only as a lightweight SMTP client while delegating spam filtering, DKIM, SPF, DMARC, rate limiting, and Internet mail delivery to enterprise relay services such as AWS SES or Microsoft Exchange Online.
15. Summary
| Feature | Description |
|---|---|
| Sendmail | Default Mail Transfer Agent (MTA) on IBM AIX. |
| Daemon | Background process responsible for email delivery. |
| Mail Queue | Stores messages awaiting delivery or retry. |
| Aliases | Simplifies recipient management. |
| SRC | Used to manage the Sendmail service on AIX. |
| SMTP Relay | Provides secure and centralized email delivery. |
Key Takeaways
- Sendmail is the engine responsible for transporting email.
- The daemon continuously processes outgoing mail requests.
- The mail queue prevents message loss during temporary failures.
- Aliases simplify administration and reduce maintenance.
- SRC commands are the standard way to manage Sendmail on AIX.
- Enterprise environments typically relay all mail through services such as AWS SES.
16. Frequently Asked Questions
Can Sendmail send email without an SMTP relay?
Yes. Sendmail can deliver email directly to remote mail servers using DNS MX lookups. However, most enterprise environments use authenticated SMTP relays for improved security and reliability.
Does Sendmail need to run continuously?
Yes. The Sendmail daemon runs in the background to process queued messages and handle SMTP communication whenever email is generated.
Where is the main Sendmail configuration stored?
The primary configuration file is /etc/mail/sendmail.cf. Additional files such as aliases and submit.cf provide supporting configuration.
Now that you understand how Sendmail works internally, it's time to install and prepare it for modern SMTP authentication.
Article 3 – Installing Sendmail from AIX Toolbox
In the next article, we'll install the latest Sendmail packages from the AIX Toolbox, verify dependencies, compare IBM-provided and Toolbox versions, confirm SASL support, and prepare the environment for integration with AWS Simple Email Service (SES).