This section provides some tips and tools that you can use for troubleshooting problems with the mail services.
To verify aliases and whether mail can be delivered to a given recipient:
The command displays the aliases and identifies the final address as deliverable or not.
Here is an example of the output:
% /usr/lib/sendmail -v -bv shamira@raks shamira... aliased to mwong mwong... aliased to shamira@raks shamira@raks... deliverable % |
You should take extra care to avoid loops and inconsistent databases when both local and domain-wide aliases are used. Be especially careful when you move a user from one system to another to avoid creating alias loops.
Type /usr/lib/sendmail -bt and press Return.
Information is displayed.
At the last prompt (>) type a 3,0 (zero) and the mail address you want to test.
Type Control-d to end the session.
Here is an example of the output:
% /usr/lib/sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > 3,0 shimara@raks rewrite: ruleset 3 input: shimara @ raks rewrite: ruleset 6 input: shimara <@ raks> rewrite: ruleset 6 returns: shimara <@ raks> rewrite: ruleset 3 returns: shimara <@ raks> rewrite: ruleset 0 input: shimara <@ raks> rewrite: ruleset 9 input: shimara <@ raks> rewrite: ruleset 9 returns: shimara <@ raks> rewrite: ruleset 0 returns: $# ether $# mailhost $: shimara < @ raks > > |
See Chapter 3, Customizing sendmail Configuration Files, for a complete description of the diagnostic information.
To verify connections to other systems, you can use the mconnect program to open connections to other sendmail systems over the network. The mconnect program runs interactively. You can issue various diagnostic commands. See the mconnect(1) man page for a complete description. The following example verifies that mail to the user name shamira is deliverable.
$ mconnect raks connecting to host raks (129.144.52.96), port 25 connection open 220 raks.Eng.Sun.COM Sendmail SMI-8.6/SMI-SVR4 ready at Tue, 25 Jul 1995 10:45:28 -0700 vrfy shamira 250 Michael Wong <shamira@raks.Eng.Sun.COM> > |
If you cannot use mconnect to connect to an SMTP port, check these conditions:
Is the system load too high?
Is the sendmail daemon running?
Does the system have the appropriate /etc/mail/sendmail.cf file?
Is port 25 (the port that sendmail uses) active?
For other diagnostic information, check the following sources:
Look at the received lines in the header of the message. These lines trace the route the message took as it was relayed. Note that in the UUCP network many sites do not update these lines, and in the Internet the lines often get rearranged. To straighten them out, look at the date and time in each line. Remember to account for time-zone differences.
Look at the messages from MAILER-DAEMON. These typically report delivery problems.
Check the system log that records delivery problems for your group of systems. The sendmail program always records what it is doing in the system log. You might want to modify the crontab file to run a shell script nightly that searches the log for SYSERR messages and mails any that it finds to the postmaster.
Use the mailstats program to test mail types and determine the number of messages incoming and outgoing.