Troubleshooting Sendmail

index

Files Test Methods Errors Causes and Solutions

Files

Filename Config line Purpose Update Technique
sendmail.cf sendmail.cf 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.
sendmail.cw Cw 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
virtusertable

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 matt@mindflip.com
Subject: test
test
.
EOT
ganesha matt ~ % matt@mindflip.com... Connecting to mailhost.mindflip.com via relay...
220 arjuna.mindflip.com ESMTP Sendmail 8.9.3/8.9.3; Fri, 6 Apr 2001 04:09:32 GMT
>>> EHLO ganesha.mindflip.com
250-arjuna.mindflip.com Hello ganesha.mindflip.com [206.50.17.93], pleased to meet you
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ONEX
250-ETRN
250-XUSR
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
matt@mindflip.com... Sent (EAA29801 Message accepted for delivery)
Closing connection to mailhost.mindflip.com
>>> QUIT
221 arjuna.mindflip.com 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 fred@domain.com
fred@domain.com... deliverable: mailer esmtp, host domain.com., user fred@domain.com
arjuna matt ~ % sendmail -bv joejones@mindflip.com
joejones@mindflip.com... deliverable: mailer local, user joe

Symptoms

Mail Administrator Messages

mail -v errors

sendmail -bv errors

Causes and Solutions