sendmail

sendmailSearch this book
Previous: 37.4 PitfallsChapter 37
Debugging with -d
Next: 38. Rule-Set Testing with -bt
 

37.5 Reference in Numerical Order

The sendmail debugging switches vary from vendor to vendor and from version to version. This section is specific to V8.8.0 sendmail. These switches are perhaps best used with a copy of the sendmail source by your side. Be further advised that many of the internal details shown here will change as sendmail continues to evolve and improve.

In this section we provide a detailed description of each combination of debugging category and level. In Table 37.2 each debugging category and level that we consider useful for the system administrator who is trying to solve a mail problem is marked with "useful." The others provide such complex and sophisticated output that they may be of use only to those with access to the source. Those marked in the section column with a "n/a" are debugging switches that were introduced in the sendmail source too late for documentation in this edition. All are presented in ascending numerical order, first by category, then by level within each category.

Note that for all categories a -dcategory and a -dcategory.1 are always equivalent.

Table 37.2: Debugging Switches by Category
CategoryIt isDescription
-d0.1Section 37.5.1, -d0.1useful

Print version information

-d0.4Section 37.5.2, -d0.4useful

Our name and aliases

-d0.10Section 37.5.3, -d0.10

Operating System defines

-d0.15Section 37.5.4, -d0.15useful

Dump delivery agents

-d0.20Section 37.5.5, -d0.20useful

Print network address of each interface

-d0.22Section 37.5.6, -d0.22

Show uname() failure

-d0.40Section 37.5.7, -d0.40

Show scanning of interfaces

-d0.44Section 37.5.8, -d0.44

Print addresses of strings

-d0.90Section 37.5.9, -d0.90obsolete

Print first 10 rule sets

-d1.1Section 37.5.10, -d1.1

Show sender information

-d1.5Section 37.5.11, -d1.5

Dump the sender address

-d2.1Section 37.5.12, -d2.1

End with finis()

-d2.9Section 37.5.13, -d2.9

Show file descriptors with dumpfd()

-d3.1Section 37.5.14, -d3.1

Print the load average

-d3.5Section 37.5.15, -d3.5

Print load average

-d3.15Section 37.5.16, -d3.15

Print three load averages

-d3.20Section 37.5.17, -d3.20

Show offset for load average

-d3.30Section 37.5.18, -d3.30

Show result of decision to queue

-d4.80Section 37.5.19, -d4.80useful

Trace enoughspace()

-d5.4Section 37.5.20, -d5.4

Tick for queued events

-d5.5Section 37.5.21, -d5.5

Events set and cleared

-d5.6Section 37.5.22, -d5.6

Show events triggered

-d6.1Section 37.5.23, -d6.1useful

Show failed mail

-d6.5Section 37.5.24, -d6.5

The current error state

-d6.20Section 37.5.25, -d6.20

Show sender of return to sender

-d7.1Section 37.5.26, -d7.1

The Queue filename

-d7.2Section 37.5.27, -d7.2

Show assigned queue filename

-d7.9Section 37.5.28, -d7.9

Dump file descriptor for the qf file

-d7.20Section 37.5.29, -d7.20

Show queue names being tried

-d8.1Section 37.5.30, -d8.1useful

Failure of MX search (low level)

-d8.2Section 37.5.31, -d8.2useful

Call to getcanonname(3)

-d8.3Section 37.5.32, -d8.3useful

Trace dropped local hostnames

-d8.5Section 37.5.33, -d8.5useful

Hostname being tried in getcanonname(3)

-d8.7Section 37.5.34, -d8.7 useful

Yes/no response to -d8.5

-d8.8Section 37.5.35, -d8.8useful

MX lookup gets wrong type

-d8.20Section 37.5.36, -d8.20

Inconsistency in returned information

-d9.1Section 37.5.37, -d9.1

Canonify hostname and RFC1413 queries

-d9.3Section 37.5.38, -d9.3

Show raw RFC1413 reply

-d9.10Section 37.5.39, -d9.10

Show RFC1413 query being sent

-d10.1Section 37.5.40, -d10.1

Show recipient delivery

-d10.2Section 37.5.41, -d10.2

Dump controlling user's address

-d10.5Section 37.5.42, -d10.5

Show don't send to MeToo address

-d10.100Section 37.5.43, -d10.100

Predelivery file descriptor dump

-d11.1Section 37.5.44, -d11.1useful

Trace delivery

-d11.2Section 37.5.45, -d11.2useful

Show the uid/gid running as during delivery

-d11.20Section 37.5.46, -d11.20

Show tried D= directories

-d12.1Section 37.5.47, -d12.1useful

Show mapping of relative host

-d13.1Section 37.5.48, -d13.1useful

Show delivery

-d13.5Section 37.5.49, -d13.5

Show addresses that we should not send to

-d13.6n/a

Trace envelope stripping, dropping, and moving

-d13.10Section 37.5.50, -d13.10

Trace sendenvelope()

-d13.20Section 37.5.51, -d13.20

Show final mode

-d13.21n/a

Show final send queue

-d13.25n/a

Watch owner deliveries

-d13.29Section 37.5.52, -d13.29

Show autoqueueing

-d13.30Section 37.5.53, -d13.30

Show envelopes being split

-d14.2Section 37.5.54, -d14.2

Show header field commas

-d15.1Section 37.5.55, -d15.1

Show network get request activity

-d15.2Section 37.5.55

Incoming connections

-d15.101Section 37.5.57, -d15.101

Kernel TCP debugging

-d16.1Section 37.5.58, -d16.1

Outgoing Connections

-d16.101Section 37.5.59, -d16.101

Kernel TCP debugging

-d17.1Section 37.5.60, -d17.1

List MX hosts

-d17.9Section 37.5.61, -d17.9

Show randomizing MX records

-d18.1Section 37.5.62, -d18.1

Show SMTP replies

-d18.2Section 37.5.63, -d18.2

Show entry to MAIL From:

-d18.100Section 37.5.64, -d18.100

Pause on SMTP read error

-d19.1Section 37.5.65, -d19.1

Show ESMTP MAIL and RCPT parameters

-d20.1Section 37.5.66, -d20.1useful

Show resolving delivery agent: parseaddr()

-d21.1Section 37.5.67, -d21.1

Trace rewriting rules

-d21.2Section 37.5.68, -d21.2useful

Trace $& macros

-d21.3Section 37.5.69, -d21.3

Show subroutine calls

-d21.4Section 37.5.70, -d21.4

Result after rewriting by a rule

-d21.10Section 37.5.71, -d21.10

Announce failure

-d21.12Section 37.5.72, -d21.12

Announce success and show LHS

-d21.15Section 37.5.73, -d21.15

Show $digit replacement

-d21.35Section 37.5.74, -d21.35

Show token by token LHS matching

-d21.36Section 37.5.75, -d21.36

Trace class matching in the LHS

-d22.1Section 37.5.76, -d22.1useful

Trace tokenizing an address: prescan()

-d22.11Section 37.5.77, -d22.11useful

Show address before prescan

-d22.12Section 37.5.78, -d22.12

Show address after prescan

-d22.36Section 37.5.79, -d22.36

Show each token

-d22.101Section 37.5.80, -d22.101

Trace low-level state machine

-d24.4Section 37.5.81, -d24.4

Trace address allocation

-d24.5Section 37.5.82, -d24.5

Trace assembly of tokens

-d24.6Section 37.5.83, -d24.6

Show result of buildaddr()

-d25.1Section 37.5.84, -d25.1usefulTrace "sendtolist"
-d26.1Section 37.5.85, -d26.1Trace recipient queueing
-d26.8Section 37.5.86, -d26.8Trace self-destructing addresses
-d26.10Section 37.5.87, -d26.10Show full send queue in testselfdestruct
-d27.1Section 37.5.88, -d27.1usefulTrace aliasing
-d27.2Section 37.5.89, -d27.2usefulInclude file, self-reference, error on home
-d27.3Section 37.5.90, -d27.3usefulForwarding path and alias wait
-d27.4Section 37.5.91, -d27.4usefulPrint not safe
-d27.5Section 37.5.92, -d27.5Trace aliasing with printaddr()
-d27.8Section 37.5.93, -d27.8Show setting up an alias map
-d27.9Section 37.5.94, -d27.9usefulShow uid/gid changes with :include: reads
-d27.14Section 37.5.95, -d27.14Show controlling user that caused change in identity
-d27.20Section 37.5.96, -d27.20Show how alias will be looked up in a map
-d28.1Section 37.5.97, -d28.1usefulTrace user database transactions
-d28.2Section 37.5.98, -d28.2Show no match
-d28.4Section 37.5.99, -d28.4Show result of lookup
-d28.8Section 37.5.100, -d28.8Try hes_getmailhost()
-d28.16Section 37.5.101, -d28.16MX records for forward host
-d28.20Section 37.5.102, -d28.20Show udb lookup
-d28.80Section 37.5.103, -d28.80Preview lookups
-d29.1Section 37.5.104, -d29.1Special rewrite of local recipient
-d29.4Section 37.5.105, -d29.4usefulTrace fuzzy matching
-d29.5Section 37.5.106, -d29.5Preview rule set 5
-d29.7Section 37.5.107, -d29.7Show overaliasing fuzzy fallback
-d30.1Section 37.5.108, -d30Trace processing of header
-d30.2Section 37.5.109, -d30.2Eat from
-d30.3Section 37.5.110, -d30.3Show a to-less header being added
-d30.35Section 37.5.111, -d30.35Trace collect states
-d30.94Section 37.5.112, -d30.94Trace collect states
-d31.2Section 37.5.113, -d31.2usefulTrace processing of headers
-d31.6Section 37.5.141_6Is header known?
-d32.1Section 37.5.115, -d32.1Show collected headers
-d32.2Section 37.5.116, -d32.2Show ARPA mode with setsender
-d33.1Section 37.5.117, -d33.1Watch crackaddr()
-d34.1Section 37.5.118, -d34.1Watch header assembly for output
-d34.11Section 37.5.119, -d34.11usefulTrace header generation and skipping
-d35.9Section 37.5.120, -d35.9usefulMacro values defined
-d35.14Section 37.5.121, -d35.14Macro identification
-d35.24Section 37.5.122, -d35.24Macro expansion
-d36.5Section 37.5.123, -d36.5Trace processing by stab()
-d36.9Section 37.5.124, -d36.9Show hash bucket
-d36.90Section 37.5.125, -d36.90Trace function applied to all symbols
-d37.1Section 37.5.126, -d37.1usefulTrace setting of options
-d37.8Section 37.5.127, -d37.8usefulTrace adding of words to a class
-d38.2Section 37.5.128, -d38.2usefulShow map opens and failures
-d38.3Section 37.5.129, -d38.3Show passes
-d38.4Section 37.5.130, -d38.4usefulShow result of map open
-d38.9Section 37.5.131, -d38.9Trace map closings and appends
-d38.10Section 37.5.132, -d38.10Trace NIS search for end of aliases
-d38.12Section 37.5.133, -d38.12Trace map stores
-d38.19Section 37.5.134, -d38.19usefulTrace switch map finds
-d38.20Section 37.5.135, -d38.20usefulTrace map lookups
-d38.44Section 37.5.136, -d38.44Show nis_getcanonname() record
-d39.1Section 37.5.137, -d39.1Display %digit database mapping
-d40.1Section 37.5.138, -d40.1Trace processing of the queue
-d40.3Section 37.5.139, -d40.3Show envelope flags
-d40.4Section 37.5.140, -d40.4Show qf file lines as they are read
-d40.8Section 37.5.141, -d40.8Show reasons for failure
-d40.9Section 37.5.142, -d40.9Show qf and lock file descriptors
-d40.32Section 37.5.143, -d40.32Dump the send queue
-d41.1Section 37.5.144, -d41.1usefulTrace queue ordering
-d41.2Section 37.5.145, -d41.2Cannot open qf
-d41.49Section 37.5.146, -d41.49Show excluded (skipped) queue files
-d41.50Section 37.5.147, -d41.50Show every file in the queue
-d42.2Section 37.5.148, -d42.2Show connection checking
-d42.5Section 37.5.149, -d42.5Trace caching and uncaching connections
-d43.1Section 37.5.150, -d43.1Trace MIME conversions
-d43.3Section 37.5.151, -d43.3See the final MIME boundary name
-d43.5Section 37.5.152, -d43.5Watch search for boundaries
-d43.8Section 37.5.153, -d43.8Show the calculations
-d43.35Section 37.5.154, -d43.35Show boundary lines as emitted
-d43.36Section 37.5.155, -d43.36Show content transfer encoding
-d43.40Section 37.5.156, -d43.40Show parse of Content-Type: header
-d43.99Section 37.5.157, -d43.99Print the leading/following comments
-d43.100Section 37.5.158, -d43.100Mark collect() and putheader()
-d44.4Section 37.5.159, -d44.4Trace safefile()
-d44.5Section 37.5.160, -d44.5usefulTrace writable()
-d45.1Section 37.5.161, -d45.1Show envelope sender
-d45.3Section 37.5.162, -d45.3Show saved domain
-d45.5Section 37.5.163, -d45.5Show don't send to sender
-d46.9Section 37.5.164, -d46.9Show xf file's descriptors
-d48.2Section 37.5.165, -d48.2usefulTrace calls to the check_ rule sets
-d49.1Section 37.5.166, -d49.1Trace checkcompat()
-d50.1Section 37.5.167, -d50.1Show envelope being dropped
-d50.2Section 37.5.168, -d50.2Show Booleans
-d50.10Section 37.5.169, -d50.10Also show the send queue
-d51.4Section 37.5.170, -d51.4Show queue entries being unlocked
-d51.104Section 37.5.171, -d51.104Prevent unlink of xf file
-d52.1Section 37.5.172, -d52.1Show isconnect from controlling TTY
-d52.100Section 37.5.173, -d52.100Prevent disconnect from controlling tty
-d53.99Section 37.5.174, -d53.99Trace xclose()
-d54.1Section 37.5.175, -d54.1Show error return and output message
-d54.8Section 37.5.176, -d54.8Show message and flags
-d55.60Section 37.5.177, -d55.60Show file locking
-d56.1Section 37.5.178, -d56.1Persistent host status tracing
-d56.2Section 37.5.179, -d56.2More persistent host status tracing
-d56.12Section 37.5.180, -d56.12Perform a sanity check
-d56.80Section 37.5.181, -d56.80Trace creating the path to the status file
-d56.93Section 37.5.182, -d56.93Dump MCI record for the host
-d57.2Section 37.5.183, -d57.2Monitor vsnprintf() overflows
-d59.1Section 37.5.184, -d59XLA from contrib
-d60.1Section 37.5.185, -d60.1usefulTrace map lookups inside rewrite()
-d61.10Section 37.5.186, -d61.10Trace gethostbyname()
-d62.1Section 37.5.187, -d62.1Log file descriptors before and after all deliveries
-d62.8Section 37.5.188, -d62.8Log file descriptors before each delivery
-d62.10Section 37.5.189, -d62.10Log file descriptors after each delivery
-d80.1Section 37.5.190, -d80.1Content-Length: header (Sun enhancement)
-d81.1Section 37.5.191, -d81.1> option for remote mode (Sun enhancement)
-d91.100Section 37.5.192, -d91.100Log caching and uncaching connections
-d99.100Section 37.5.193, -d99.100usefulPrevent backgrounding the daemon

37.5.1 -d0.1

Print version information

(useful)

The -d0.1 (a.k.a. -d0) debugging switch previously prevented sendmail from forking and detaching itself, but that function has been moved to the -d99.100 debugging switch. The -d0.1 debugging switch now just tells sendmail to print information about its version:

Version 8.8.4
Compiled with:   LOG MATCHGECOS NAMED_BIND NDBM NEWDB NETINET NETUNIX
                 NIS
SYSTEM IDENTITY (after readcf):
            (short domain name) $w = here
        (canonical domain name) $j = here.US.EDU
               (subdomain name) $m = US.EDU
                    (node name) $k = here

The Version is the current version of sendmail. Note that for Sun the number may look like SMI-8.7.5.

The Compiled with: lists the compile-time definitions that where specified when sendmail is compiled. All the available definitions are listed in Table 18.3 in Section 18.8, "Alphabetized Reference".

The SYSTEM IDENTITY shows the value assigned to four important macros. The meaning of each macro is contained in Table 31.7 in Section 31.10, "Alphabetized Reference".

37.5.2 -d0.4

Our name and aliases

(useful)

The -d0.4 debugging switch tells sendmail to print several additional lines of information:

Version 8.8.4
Compiled with:   LOG MATCHGECOS NAMED_BIND NDBM NEWDB NETINET NETUNIX
                 NIS
canonical name: here.US.EDU                           <- additional
 UUCP nodename: here                                  <- additional
        a.k.a.: [123.45.67.89]                        <- additional
============ SYSTEM IDENTITY (after readcf) ============
            (short domain name) $w = here
        (canonical domain name) $j = here.US.EDU
               (subdomain name) $m = US.EDU
                    (node name) $k = here
========================================================

To find the canonical name of the local host, sendmail calls gethostname(). If that call fails, the name localhost is used. The hostname is then looked up with the internal routine sm_gethostbyname(), which gathers additional information (such as other names and addresses for the machine) and fixes several bugs in some operating system's versions of the gethostby... routines. Next the canonical name for the local host is looked up. For operating systems that normally support switched services, the name is looked up as specified. For systems that specify switched services in the configuration file's ServiceSwitchFile option (see Section 34.8.61, ServiceSwitchFile), switched services are not used because the configuration file has not been read yet. (This canonicalization process can be traced with the -61.10 debugging switch.) If the canonical is found and that name contains a dot, sendmail saves the part of the name to the right of the leftmost dot as the domain name in the $m macro (see Section 31.10.24, $m). It also appends the part of the name to the left of the leftmost dot to the class w (see Section 32.5.8, $=w). If the canonical name doesn't contain a dot, the $m macro is undefined, and the whole name is appended to the class w.

In addition, sendmail also sets the $k macro (see Section 31.10.21, $k) to be the correct UUCP name for the machine. It uses uname(3), if available, to find that name (see Section 18.8.51, TRUST-POPEN); otherwise, it uses the same strategy as for class w above.

Then sendmail lists any other names or addresses (this latter in square brackets) that it found. If it finds any, it prints the name prefixed by a.k.a.: and appends each to the class w. The aliases listed are only those found using gethostbyname(3). To see each entry as it is added to the class w, use the -d37.8 debugging switch.

Finally, sendmail scans the network hardware to find any other names associated with interfaces. If the ioctl(2) call to get that information fails, the -d0.4 debugging switch causes sendmail to print that failure:

SIOGIFCONF failed: <- reason here

If any are found, each is printed with an a.k.a.: prefix and added to the class macro w.

37.5.3 -d0.10

Operating System Defines

The -d0.10 debugging switch causes sendmail to print all the operating system specific definitions that were used to compile your specific version of sendmail. This output prints after the "Compiled with:" information described above:

OS Defines: HASFLOCK HASGETUSERSHELL HASINITGROUPS HASLSTAT
                HASSETREUID HASSETSID HASSETVBUF HASUNAME IDENTPROTO
                IP_SRCROUTE
Kernel symbols: /vmunix
   Config file: /etc/sendmail.cf
  Proc Id file: /etc/sendmail.pid

The OS Defines are described in Table 18.3 in Section 18.8. Most are automatically determined during compilation; others are specified in Makefile.

The Kernel symbols is the name of file that is accessed to determine the load average. It is automatically defined correctly when conf.c is compiled. The location of the configuration file and the process identifier file are defined in the Makefile and conf.h in the sendmail source (see Section 18.8.34, PATH...).

37.5.4 -d0.15

Dump delivery agents

(useful)

The -d0.15 debugging switch causes sendmail to display how it interpreted its delivery agent definitions. The clarity and completeness of the delivery agent information vary with the version of sendmail. See the =M rule-testing command (Section 38.4.2, "Show Delivery Agents with =M") for an example of this output.

37.5.5 -d0.20

Print network address of each interface

(useful)

When sendmail scans the network hardware to find other names for the local host, it uses only those names that are new. Each new name was printed by the -d0.4 debugging switch above. To see every name that sendmail finds, new and old alike, use the -d0.20 debugging switch:

128.32.201.55                                       <- already found
127.0.0.1                                           <- found new
        a.k.a.: [127.0.0.1]

37.5.6 -d0.22

Show uname() failure

Ordinarily, if the UUCP name for the local host cannot be found (if uname(3) fails), sendmail silently uses the leftmost component of the canonical name as the UUCP name. To see whether uname(3) failed - and, if so why - you can use the -d0.22 debugging switch:

uname failed (reason for failure here)

37.5.7 -d0.40

Announce scanning of interfaces

The -d0.40 debugging switch causes sendmail to announce that it is about to scan for network interfaces:

scanning for interface specific names, ifc_len=64
        a.k.a.: [127.0.0.1]

The ifc_len is the size in bytes of the configuration list returned by the kernel.

37.5.8 -d0.44

Print addresses of strings

The -d0.44 debugging switch causes sendmail to prefix certain lists of strings that it prints with the address in memory of each string and an equal sign. With this debugging level, part of the output produced by the -d21.12 debugging switch would look like this:

--- rule fails
---trying rule:
        0009ec68=@
        0009ec78=$*
--- rule fails

This debugging level can be useful to the programmer who wishes to modify the sendmail source. It might, for example, be helpful in designing more efficient string storage.

37.5.9 -d0.90

Print first 10 rule sets

(obsolete)

The -d0.90 debugging switch causes sendmail to display its internal interpretations of the first 10 rewriting rules it took from the configuration file. The rule sets are printed in numeric order, rather than in the order in which they appeared in the configuration file. The rewriting rules are printed under each rule set (but these are in the order in which they appeared in the configuration file). Rule sets that are declared but lack rewriting rules are not printed. Note that defined macros in the RHS are expanded (the value used) when the configuration file is parsed. Also note that expressions like $+ may be printed as control characters (e.g., ^A) under older versions of sendmail.

The preferred way to view individual rule sets is with the -bt rule-testing mode's =S command (see Section 38.4.1, "Show Rules in a Rule Set with =S").

37.5.10 -d1.1

Show sender information

Although there are many kinds of information that one might like to trace about the sender of an email message, sendmail provides the means to trace only one of them. The -d1.1 (a.k.a. -d1) debugging switch causes sendmail to print its interpretation of whom the message is from (the name of the sender as it was used in the envelope):

From person = "sender"

Here, sender is the user portion of the mail address of the sender. This output is most useful when combined with the -f command-line switch (which sets the name of the sender from the command line; see Section 36.7.21, -f and -r).

37.5.11 -d1.5

Dump the sender address

The -d1.5 debugging switch causes additional information about the sender to be printed. That output looks like this:

main: QDONTSEND output of printaddr() here (see Section 37.3.1, "The Output Produced by printaddr()")

The QDONTSEND means that the sender is not a recipient and so should not get a copy of the message. That is followed by the output of the printaddr() routine.

37.5.12 -d2.1

End with finis()

Ordinarily, sendmail exits silently when it is done (unless an error causes an error message to be printed). The -d2.1 (a.k.a. -d2) debugging switch causes sendmail to print three useful values when it exits. The message it prints looks like this:

====finis: stat num e_id=qid e_flags=flags

The num is the final value of the sendmail program's global ExitStat variable. It is usually updated to contain the latest error value as defined in <sysexits.h>. See Section 36.5, "sendmail's exit() Status" for a detailed description of the possible exit values.

The qid is either the queue identifier (such as SAA24069) or the NOQUEUE if the message was never assigned an identifier (such as if it was never queued).

The flags is a hexadecimal representation of the possible envelope flags followed by a text representation of those flags in angle brackets with the leading EF_ removed, for example,

201003<OLDSTYLE,INQUEUE,GLOBALERRS,HAS_DF>

These are the envelope flags that were in effect with the current envelope when sendmail exited. The possible values are shown in Table 37.3.

Table 37.3: Hexadecimal Envelope Flags
TextHexDescription
EF_OLDSTYLE0000001Use spaces (not commas) in headers
EF_INQUEUE0000002This message is fully queued
EF_NO_BODY_RETN0000004Omit message body on error
EF_CLRQUEUE0000008Disk copy is no longer needed
EF_SENDRECEIPT0000010Send a return receipt
EF_FATALERRS0000020Fatal errors occurred
EF_KEEPQUEUE0000040Keep queue files always
EF_RESPONSE0000080This is an error or return receipt
EF_RESENT0000100This message is being forwarded
EF_VRFYONLY0000200Verify only (don't expand aliases)
EF_WARNING0000400Warning message has been sent
EF_QUEUERUN0000800This envelope is from queue
EF_GLOBALERRS0001000Treat errors as global
EF_PM_NOTIFY0002000Send return mail to postmaster
EF_METOO0004000Send to me too
EF_LOGSENDER0008000Need to log the sender
EF_NORECEIPT0010000Suppress all return-receipts
EF_HAS8BIT0020000At least one 8-bit character in body
EF_NL_NOT_EOL0040000Don't accept raw newline as end-of-line
EF_CRLF_NOT_EOL0080000Don't accept carriage-return/line-feed as end-of-line
EF_RET_PARAM0100000SMTP RCPT command had RET argument
EF_HAS_DF0200000Set when df file is instantiated
EF_IS_MIME0400000Really is a MIME message
EF_DONT_MIME0800000This message is not MIME-able

For example, if the message were fully queued and required a DSN return receipt, the flags would print as

e_flags=12<INQUEUE,SENDRECEIPT>

Note that this line of output is also produced by the -d13.1, -d40.3, and -d50.1 debugging switches but under different circumstances.

37.5.13 -d2.9

Show file descriptors with dumpfd()

The -d2.9 debugging switch tells sendmail to display the properties of each open file descriptor. That output is produced by the dumpfd() routine, and each line of output is for a single file descriptor:

num: fl=flags mode=mode type stats

Here, the num is the number of the open file descriptor. Note that descriptors 0, 1, and 2 are usually tied to the standard input, output, and error output.

The flags is a hexadecimal representation of the state flags associated with a file descriptor. F_GETFL is used with ioctl(2) to fetch each, and all are described in <sys/fcntlcom.h>.

The mode is printed in octal and is the st_mode associated with an fstat(2) of the file descriptor. The type examines the file type portion of the st_mode and prints SOCK for a socket, CHR: for a character special device, BLK: for a block special device, FIFO: for a first-in-first-out file, DIR: for a directory, LNK: for a symbolic link, and nothing otherwise (e.g., nothing if it is a file).

The stats are printed for all but the socket. They look like this:

dev=major/minor ino=inum nlink=nlink u/gid=uid/gid size=bytes

Here the dev= shows the major and minor device numbers for the device that the file descriptor is associated with. The inum is the inode number on the disk (if there is one) and nlink is the number of hard links to the file on disk. The uid/gid shows the user and group ownership associated with the file descriptor. The size is the number of bytes in a file, and 0 for almost everything else.

For a socket, the stats part of each line looks like this:

[addr]/port-> host

Here, addr is the IP address of the local end of the socket. If the connection is of type AF_INET, the port number of the connection is also shown as /port. The host is the hostname, as returned by getpeername(3), of the connecting host. If any of these cannot be found, the error string associated with errno is printed parenthetically in its place.

The -d7.9, -d40.9, and -d46.9 debugging switches also print a line like this for specific file descriptors. Also if sendmail is run with the -d10.100 switch, or if sendmail fails to open a tf queue file (see Section 23.2.6, "The Temporary qf Rewrite Image: tf"), or if sendmail exited because of too many open files, it will syslog all its open file descriptors within this format.

37.5.14 -d3.1

Print load average

The sendmail program queues mail, rather than delivering it, if the load average (number of processes in the run queue) exceeds the value set by the QueueLA (x) option (see Section 34.8.50, QueueLA (x)). Exceeding that value also prevents messages that are already in the queue from being delivered (prevents a queue run). If the load average becomes higher than the value of the RefuseLA (X) option (see Section 34.8.54, RefuseLA (X)), sendmail rejects incoming SMTP connections until the load average drops.

The -d3.1 debugging switch (a.k.a. -d3) causes sendmail to print the load average found by its internal getla() routine each time that routine is called:

getla: la

Here, la is the current load average printed as an integer. If sendmail was compiled with LA_TYPE==LA_ZERO (see Section 18.8.14, LA-TYPE), the following will be printed to show that your sendmail binary completely lacks load averaging support:

getla: ZERO

The -d3.1 debugging switch also causes sendmail to print any errors it encounters while obtaining the load average.

getla: open(/dev/kmem): error

Here, /dev/kmem is the device that is used to access kernel memory. The error is the system error that caused the failure, such as "Permission denied" if sendmail is not properly sgid to the group kmem.

getla: nlist(unix): error

The nlist(3) function extracts a list of symbols from an executable binary (among them the symbol for the load average). The binary that it extracts is the kernel whose pathname is unix (such as /vmunix for SunOS 4.x). Here, the error is the reason nlist(3) failed. One possibility is that you booted from a nonstandard kernel name (such as /vmunix.new) and the expected file didn't exist:

getla: nlist(unix, la) ==> 0

If the expected kernel exists (unix) but the machine was booted from a different kernel, the symbol representing the load average may not be found. In that instance, la is the name of the kernel variable that sendmail was trying to find.

37.5.15 -d3.5

Print load average

The load average that sendmail uses is averaged over the last minute. Internally, the kernel keeps track of three load averages. In addition to the last minute, it also tracks the last 5 and 15 minutes. The -d3.5 debugging switch causes V8 sendmail to print the load average over the last minute:

getla: averun = 1min

37.5.16 -d3.15

Print three load averages

The -d3.15 debugging switch causes V8 sendmail to print all three load averages:

getla: averun = 1min, 5min, 15min

Here, the three load averages are printed either in integer or in floating point, depending on the setting of LA_TYPE (see Section 18.8.14).

37.5.17 -d3.20

Show offset for load average

The nlist(3) routine (described above) provides the offset into the kernel file where the value of the load average is found. The -d3.20 debugging switch causes that offset to be displayed:

getla: symbol address = offset

Here, the offset is printed in hexadecimal. The load average is read by seeking in the kernel file and reading it. If the seek or read fails, the -d3.1 debugging switch causes sendmail to print:

getla: seek or read: error

This can indicate a wrong or corrupted kernel image.

37.5.18 -d3.30

Show result of decision to queue

The internal routine shouldqueue() is called just before a mail message is delivered to recipients. That routine determines whether mail will be delivered or queued on the basis of the current load average and message priority. Upon entry it prints:

shouldqueue: CurrentLA=load, pri=priority

If the CurrentLA is less than the limit set by the QueueLA (x) option (see Section 34.8.50), sendmail prints:

FALSE (CurrentLA < QueueLA)

Then the calculation described in Section 34.8.49, QueueFactor (q) for the QueueFactor (q) option is performed using the pri priority. The result is printed as one of the following, where TRUE represents a zero result and FALSE represents a nonzero result:

TRUE (by calculation)
FALSE (by calculation)

37.5.19 -d4.80

Trace enoughspace()

(useful)

The MinFreeBlocks (b) option (see Section 34.8.40, MinFreeBlocks (b)) defines the minimum number of disk blocks that must be reserved on the queue disk. If an incoming SMTP message will fill the disk beyond this minimum, the message is rejected.

The -d4.80 debugging switch [1] traces the enoughspace() routine in conf.c. That routine examines the disk space and allows or disallows incoming mail.

[1] No -d4.1 (a.k.a. -d4) information is available.

enoughspace: no threshold

This debugging output says that no limit was defined with the MinFreeBlocks (b) option.

enoughspace: bavail=haveblocks need=needblocks

This debugging output shows that the number of blocks free (available) on the disk is haveblocks and that the number of blocks required by incoming mail is needblocks. Note that haveblocks will always be -1 if sendmail was compiled with SFS_TYPE set to SFS_NONE (see Section 18.8.40, SFS-TYPE).

enoughspace failure: min=boption need=needblocks

If the required number of blocks (needblocks) exceeds the minimum reserved as defined by the MinFreeBlocks (b) option (boption), use of the disk is disallowed.

37.5.20 -d5.4

Tick for queued events

Throughout its many possible levels of forks and children, sendmail must keep track of timeouts - the maximum amount of time it should wait for an event to occur. For example, a child must not wait forever for an SMTP greeting message, because the program at the other end may never provide that message (because it died or is just too busy).

To keep track of which child should be notified at which time, sendmail maintains an internal queue of events. The sendmail program uses the SIGALARM signal and the alarm(2) system call to set the interval it waits to next check its queue of events for timeouts. That interval (called a tick) is the period of the timeout itself, or if the timeout is scheduled for the pr