Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [364]

By Root 2853 0
(or at least not in conflict with) your DNS MX records and your firewall policy.

sendmail provides one of the richest sets of debugging aids known to UNIX, with debug flags that are not simple Booleans or even integers but are two-dimensional quantities x.y, where x chooses the topic and y chooses the amount of information to display. A value of 0 gives no debugging and 127 wastes many trees if you print the output. Topics range from 0 to 99; currently, 68 are defined.

The file sendmail/TRACEFLAGS in the distribution lists the values in use and the files and functions in which they are used. All debugging support is at the level of the raw config file.

If sendmail is invoked with a -dx.y flag, debugging output comes to the screen (standard error). Table 19.18 on the next page shows several important values of x and some Eric-suggested values for y.

Table 19.18 Debugging topics

Gene Kim and Rob Kolstad have written a Perl script called checksendmail that invokes sendmail in address test mode on a file of test addresses that you supply. It compares the results to those expected. This script lets you test new versions of the configuration file against a test suite of your site’s typical addresses to be sure you haven’t inadvertently broken anything that used to work.

checksendmail is available from www.harker.com.

Verbose delivery


Many user agents that invoke sendmail on the command line accept a -v flag, which is passed to sendmail and makes it display the steps taken to deliver the message.

The example below uses /usr/ucb/mail. The words in bold were typed as input to the user agent, and the rest is sendmail’s verbose output.

anchor 53% mail -v evi@xor.com

Subject: just testing, please ignore

hi

.

Cc:

evi@xor.com... Connecting to xor.com. via esmtp...

220 xor.com ESMTP Sendmail 8.9.3/8.9.3; Fri, 26 Nov 1999 17:42:57 -0700 (MST)

>>> EHLO anchor.cs.colorado.edu

250-xor.com Hello anchor.cs.Colorado.EDU [128.138.242.1], pleased to meet you

250-8BITMIME

250-SIZE 5000000

250-DSN

250-ONEX

250-ETRN

250-XUSR

250 HELP

>>> MAIL From: SIZE=57

250 ... Sender ok

>>> RCPT To:

250 ... Recipient ok

>>> DATA

354 Enter mail, end with "." on a line by itself

>>> .

250 RAA00511 Message accepted for delivery

evi@xor.com... Sent (RAA00511 Message accepted for delivery)

Closing connection to xor.com.

>>> QUIT

221 xor.com closing connection

The sendmail on anchor connected to the sendmail on xor.com. Each machine used the ESMTP protocol to negotiate the exchange of the message.

Talking in SMTP


You can make direct use of SMTP when debugging the mail system. To initiate an SMTP session, telnet to TCP port 25. By default, this is the port on which sendmail listens when run in daemon (-bd) mode. Table 19.19 shows some SMTP commands.

Table 19.19 SMTP commands

a. There can be multiple RCPT commands for a message.

b. The body is terminated by entering a dot on its own line.

The whole language has only 14 commands, so it is quite easy to learn and use. It is not case sensitive. The specification for SMTP can be found in RFC821 (also, see RFC1123). RFCs 1869, 1870, 1891, and 1985 extend SMTP to ESMTP.

Most transport agents, including sendmail, speak both SMTP and ESMTP; smap is the lone exception these days. ESMTP speakers start the conversation with the EHLO command instead of HELO. If the process at the other end understands and responds with an OK, then the participants negotiate supported extensions and arrive at a lowest common denominator for the exchange. If an error is returned, then the ESMTP speaker falls back to SMTP.

Logging


sendmail uses syslog to log error and status messages with syslog facility “mail” and levels “debug” through “crit”; messages are tagged with the string “sendmail.”

See Chapter 11 for more information about syslog.

The confLOG_LEVEL option, specified on the command line or in the config file, determines the severity level that sendmail uses as a threshold

Return Main Page Previous Page Next Page

®Online Book Reader