Troubleshooting Sendmail


Files Test Methods Errors Causes and Solutions


Filename Config line Purpose Update Technique is the primary configuration file for sendmail. Although almost all sendmail configuration options can be set from within this file, because of the inherent risks in editing it, most implementations break most functions out into separate config files. Restart sendmail. Cw indicates which domains the server will deliver mail for locally Usually automatic.
aliases aliases maps unqualified (default domain) mail aliases to a user, multiple users, other aliases, etc. newaliases

Test Methods

mail -v

Note: The -v (verbose) option only applies to the Berkeley mail executable, not the System V one. If you are running System V or a System V-like operating system (Solaris, for example), the Berkeley mail is often installed in /usr/ucb.

On its own, mail is a fairly modest MTA (mail transfer agent). Its verbose mode (specified with the -v option), however, is a powerful troubleshooting tool. Not only do you see the specific SMTP directives sent to the outgoing mailserver, you see the full output of any error messages it returns.

Successful mail delivery looks like this:

ganesha matt ~ % /usr/ucb/mail -v
Subject: test
ganesha matt ~ % Connecting to via relay...
220 ESMTP Sendmail 8.9.3/8.9.3; Fri, 6 Apr 2001 04:09:32 GMT
>>> EHLO Hello [], pleased to meet you
250 HELP
>>> MAIL From: SIZE=79
250 ... Sender ok
>>> RCPT To:
250 ... Recipient ok
>>> DATA
354 Enter mail, end with "." on a line by itself
>>> .
250 EAA29801 Message accepted for delivery Sent (EAA29801 Message accepted for delivery)
Closing connection to
>>> QUIT
221 closing connection

sendmail -bv

sendmail itself contains some interesting debugging functionality, the most interesting of which is the "verify" mode, specified by -bv. In order for this technique to be helpful, it has to be run from the mailserver itself.

sendmail -bv results in no message actually being sent, but will tell you how the message would have been delivered (after all aliases and other rewrites).

Here are some examples:

arjuna matt ~ % sendmail -bv deliverable: mailer esmtp, host, user
arjuna matt ~ % sendmail -bv deliverable: mailer local, user joe


Mail Administrator Messages

mail -v errors

sendmail -bv errors

Causes and Solutions