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.
| Category | It is | Description | |
|---|---|---|---|
| -d0.1 | Section 37.5.1, -d0.1 | useful | Print version information |
| -d0.4 | Section 37.5.2, -d0.4 | useful | Our name and aliases |
| -d0.10 | Section 37.5.3, -d0.10 | Operating System defines | |
| -d0.15 | Section 37.5.4, -d0.15 | useful | Dump delivery agents |
| -d0.20 | Section 37.5.5, -d0.20 | useful | Print network address of each interface |
| -d0.22 | Section 37.5.6, -d0.22 | Show uname() failure | |
| -d0.40 | Section 37.5.7, -d0.40 | Show scanning of interfaces | |
| -d0.44 | Section 37.5.8, -d0.44 | Print addresses of strings | |
| -d0.90 | Section 37.5.9, -d0.90 | obsolete | Print first 10 rule sets |
| -d1.1 | Section 37.5.10, -d1.1 | Show sender information | |
| -d1.5 | Section 37.5.11, -d1.5 | Dump the sender address | |
| -d2.1 | Section 37.5.12, -d2.1 | End with finis() | |
| -d2.9 | Section 37.5.13, -d2.9 | Show file descriptors with dumpfd() | |
| -d3.1 | Section 37.5.14, -d3.1 | Print the load average | |
| -d3.5 | Section 37.5.15, -d3.5 | Print load average | |
| -d3.15 | Section 37.5.16, -d3.15 | Print three load averages | |
| -d3.20 | Section 37.5.17, -d3.20 | Show offset for load average | |
| -d3.30 | Section 37.5.18, -d3.30 | Show result of decision to queue | |
| -d4.80 | Section 37.5.19, -d4.80 | useful | Trace enoughspace() |
| -d5.4 | Section 37.5.20, -d5.4 | Tick for queued events | |
| -d5.5 | Section 37.5.21, -d5.5 | Events set and cleared | |
| -d5.6 | Section 37.5.22, -d5.6 | Show events triggered | |
| -d6.1 | Section 37.5.23, -d6.1 | useful | Show failed mail |
| -d6.5 | Section 37.5.24, -d6.5 | The current error state | |
| -d6.20 | Section 37.5.25, -d6.20 | Show sender of return to sender | |
| -d7.1 | Section 37.5.26, -d7.1 | The Queue filename | |
| -d7.2 | Section 37.5.27, -d7.2 | Show assigned queue filename | |
| -d7.9 | Section 37.5.28, -d7.9 | Dump file descriptor for the qf file | |
| -d7.20 | Section 37.5.29, -d7.20 | Show queue names being tried | |
| -d8.1 | Section 37.5.30, -d8.1 | useful | Failure of MX search (low level) |
| -d8.2 | Section 37.5.31, -d8.2 | useful | Call to getcanonname(3) |
| -d8.3 | Section 37.5.32, -d8.3 | useful | Trace dropped local hostnames |
| -d8.5 | Section 37.5.33, -d8.5 | useful | Hostname being tried in getcanonname(3) |
| -d8.7 | Section 37.5.34, -d8.7 | useful | Yes/no response to -d8.5 |
| -d8.8 | Section 37.5.35, -d8.8 | useful | MX lookup gets wrong type |
| -d8.20 | Section 37.5.36, -d8.20 | Inconsistency in returned information | |
| -d9.1 | Section 37.5.37, -d9.1 | Canonify hostname and RFC1413 queries | |
| -d9.3 | Section 37.5.38, -d9.3 | Show raw RFC1413 reply | |
| -d9.10 | Section 37.5.39, -d9.10 | Show RFC1413 query being sent | |
| -d10.1 | Section 37.5.40, -d10.1 | Show recipient delivery | |
| -d10.2 | Section 37.5.41, -d10.2 | Dump controlling user's address | |
| -d10.5 | Section 37.5.42, -d10.5 | Show don't send to MeToo address | |
| -d10.100 | Section 37.5.43, -d10.100 | Predelivery file descriptor dump | |
| -d11.1 | Section 37.5.44, -d11.1 | useful | Trace delivery |
| -d11.2 | Section 37.5.45, -d11.2 | useful | Show the uid/gid running as during delivery |
| -d11.20 | Section 37.5.46, -d11.20 | Show tried D= directories | |
| -d12.1 | Section 37.5.47, -d12.1 | useful | Show mapping of relative host |
| -d13.1 | Section 37.5.48, -d13.1 | useful | Show delivery |
| -d13.5 | Section 37.5.49, -d13.5 | Show addresses that we should not send to | |
| -d13.6 | n/a | Trace envelope stripping, dropping, and moving | |
| -d13.10 | Section 37.5.50, -d13.10 | Trace sendenvelope() | |
| -d13.20 | Section 37.5.51, -d13.20 | Show final mode | |
| -d13.21 | n/a | Show final send queue | |
| -d13.25 | n/a | Watch owner deliveries | |
| -d13.29 | Section 37.5.52, -d13.29 | Show autoqueueing | |
| -d13.30 | Section 37.5.53, -d13.30 | Show envelopes being split | |
| -d14.2 | Section 37.5.54, -d14.2 | Show header field commas | |
| -d15.1 | Section 37.5.55, -d15.1 | Show network get request activity | |
| -d15.2 | Section 37.5.55 | Incoming connections | |
| -d15.101 | Section 37.5.57, -d15.101 | Kernel TCP debugging | |
| -d16.1 | Section 37.5.58, -d16.1 | Outgoing Connections | |
| -d16.101 | Section 37.5.59, -d16.101 | Kernel TCP debugging | |
| -d17.1 | Section 37.5.60, -d17.1 | List MX hosts | |
| -d17.9 | Section 37.5.61, -d17.9 | Show randomizing MX records | |
| -d18.1 | Section 37.5.62, -d18.1 | Show SMTP replies | |
| -d18.2 | Section 37.5.63, -d18.2 | Show entry to MAIL From: | |
| -d18.100 | Section 37.5.64, -d18.100 | Pause on SMTP read error | |
| -d19.1 | Section 37.5.65, -d19.1 | Show ESMTP MAIL and RCPT parameters | |
| -d20.1 | Section 37.5.66, -d20.1 | useful | Show resolving delivery agent: parseaddr() |
| -d21.1 | Section 37.5.67, -d21.1 | Trace rewriting rules | |
| -d21.2 | Section 37.5.68, -d21.2 | useful | Trace $& macros |
| -d21.3 | Section 37.5.69, -d21.3 | Show subroutine calls | |
| -d21.4 | Section 37.5.70, -d21.4 | Result after rewriting by a rule | |
| -d21.10 | Section 37.5.71, -d21.10 | Announce failure | |
| -d21.12 | Section 37.5.72, -d21.12 | Announce success and show LHS | |
| -d21.15 | Section 37.5.73, -d21.15 | Show $digit replacement | |
| -d21.35 | Section 37.5.74, -d21.35 | Show token by token LHS matching | |
| -d21.36 | Section 37.5.75, -d21.36 | Trace class matching in the LHS | |
| -d22.1 | Section 37.5.76, -d22.1 | useful | Trace tokenizing an address: prescan() |
| -d22.11 | Section 37.5.77, -d22.11 | useful | Show address before prescan |
| -d22.12 | Section 37.5.78, -d22.12 | Show address after prescan | |
| -d22.36 | Section 37.5.79, -d22.36 | Show each token | |
| -d22.101 | Section 37.5.80, -d22.101 | Trace low-level state machine | |
| -d24.4 | Section 37.5.81, -d24.4 | Trace address allocation | |
| -d24.5 | Section 37.5.82, -d24.5 | Trace assembly of tokens | |
| -d24.6 | Section 37.5.83, -d24.6 | Show result of buildaddr() | |
| -d25.1 | Section 37.5.84, -d25.1 | useful | Trace "sendtolist" |
| -d26.1 | Section 37.5.85, -d26.1 | Trace recipient queueing | |
| -d26.8 | Section 37.5.86, -d26.8 | Trace self-destructing addresses | |
| -d26.10 | Section 37.5.87, -d26.10 | Show full send queue in testselfdestruct | |
| -d27.1 | Section 37.5.88, -d27.1 | useful | Trace aliasing |
| -d27.2 | Section 37.5.89, -d27.2 | useful | Include file, self-reference, error on home |
| -d27.3 | Section 37.5.90, -d27.3 | useful | Forwarding path and alias wait |
| -d27.4 | Section 37.5.91, -d27.4 | useful | Print not safe |
| -d27.5 | Section 37.5.92, -d27.5 | Trace aliasing with printaddr() | |
| -d27.8 | Section 37.5.93, -d27.8 | Show setting up an alias map | |
| -d27.9 | Section 37.5.94, -d27.9 | useful | Show uid/gid changes with :include: reads |
| -d27.14 | Section 37.5.95, -d27.14 | Show controlling user that caused change in identity | |
| -d27.20 | Section 37.5.96, -d27.20 | Show how alias will be looked up in a map | |
| -d28.1 | Section 37.5.97, -d28.1 | useful | Trace user database transactions |
| -d28.2 | Section 37.5.98, -d28.2 | Show no match | |
| -d28.4 | Section 37.5.99, -d28.4 | Show result of lookup | |
| -d28.8 | Section 37.5.100, -d28.8 | Try hes_getmailhost() | |
| -d28.16 | Section 37.5.101, -d28.16 | MX records for forward host | |
| -d28.20 | Section 37.5.102, -d28.20 | Show udb lookup | |
| -d28.80 | Section 37.5.103, -d28.80 | Preview lookups | |
| -d29.1 | Section 37.5.104, -d29.1 | Special rewrite of local recipient | |
| -d29.4 | Section 37.5.105, -d29.4 | useful | Trace fuzzy matching |
| -d29.5 | Section 37.5.106, -d29.5 | Preview rule set 5 | |
| -d29.7 | Section 37.5.107, -d29.7 | Show overaliasing fuzzy fallback | |
| -d30.1 | Section 37.5.108, -d30 | Trace processing of header | |
| -d30.2 | Section 37.5.109, -d30.2 | Eat from | |
| -d30.3 | Section 37.5.110, -d30.3 | Show a to-less header being added | |
| -d30.35 | Section 37.5.111, -d30.35 | Trace collect states | |
| -d30.94 | Section 37.5.112, -d30.94 | Trace collect states | |
| -d31.2 | Section 37.5.113, -d31.2 | useful | Trace processing of headers |
| -d31.6 | Section 37.5.141_6 | Is header known? | |
| -d32.1 | Section 37.5.115, -d32.1 | Show collected headers | |
| -d32.2 | Section 37.5.116, -d32.2 | Show ARPA mode with setsender | |
| -d33.1 | Section 37.5.117, -d33.1 | Watch crackaddr() | |
| -d34.1 | Section 37.5.118, -d34.1 | Watch header assembly for output | |
| -d34.11 | Section 37.5.119, -d34.11 | useful | Trace header generation and skipping |
| -d35.9 | Section 37.5.120, -d35.9 | useful | Macro values defined |
| -d35.14 | Section 37.5.121, -d35.14 | Macro identification | |
| -d35.24 | Section 37.5.122, -d35.24 | Macro expansion | |
| -d36.5 | Section 37.5.123, -d36.5 | Trace processing by stab() | |
| -d36.9 | Section 37.5.124, -d36.9 | Show hash bucket | |
| -d36.90 | Section 37.5.125, -d36.90 | Trace function applied to all symbols | |
| -d37.1 | Section 37.5.126, -d37.1 | useful | Trace setting of options |
| -d37.8 | Section 37.5.127, -d37.8 | useful | Trace adding of words to a class |
| -d38.2 | Section 37.5.128, -d38.2 | useful | Show map opens and failures |
| -d38.3 | Section 37.5.129, -d38.3 | Show passes | |
| -d38.4 | Section 37.5.130, -d38.4 | useful | Show result of map open |
| -d38.9 | Section 37.5.131, -d38.9 | Trace map closings and appends | |
| -d38.10 | Section 37.5.132, -d38.10 | Trace NIS search for end of aliases | |
| -d38.12 | Section 37.5.133, -d38.12 | Trace map stores | |
| -d38.19 | Section 37.5.134, -d38.19 | useful | Trace switch map finds |
| -d38.20 | Section 37.5.135, -d38.20 | useful | Trace map lookups |
| -d38.44 | Section 37.5.136, -d38.44 | Show nis_getcanonname() record | |
| -d39.1 | Section 37.5.137, -d39.1 | Display %digit database mapping | |
| -d40.1 | Section 37.5.138, -d40.1 | Trace processing of the queue | |
| -d40.3 | Section 37.5.139, -d40.3 | Show envelope flags | |
| -d40.4 | Section 37.5.140, -d40.4 | Show qf file lines as they are read | |
| -d40.8 | Section 37.5.141, -d40.8 | Show reasons for failure | |
| -d40.9 | Section 37.5.142, -d40.9 | Show qf and lock file descriptors | |
| -d40.32 | Section 37.5.143, -d40.32 | Dump the send queue | |
| -d41.1 | Section 37.5.144, -d41.1 | useful | Trace queue ordering |
| -d41.2 | Section 37.5.145, -d41.2 | Cannot open qf | |
| -d41.49 | Section 37.5.146, -d41.49 | Show excluded (skipped) queue files | |
| -d41.50 | Section 37.5.147, -d41.50 | Show every file in the queue | |
| -d42.2 | Section 37.5.148, -d42.2 | Show connection checking | |
| -d42.5 | Section 37.5.149, -d42.5 | Trace caching and uncaching connections | |
| -d43.1 | Section 37.5.150, -d43.1 | Trace MIME conversions | |
| -d43.3 | Section 37.5.151, -d43.3 | See the final MIME boundary name | |
| -d43.5 | Section 37.5.152, -d43.5 | Watch search for boundaries | |
| -d43.8 | Section 37.5.153, -d43.8 | Show the calculations | |
| -d43.35 | Section 37.5.154, -d43.35 | Show boundary lines as emitted | |
| -d43.36 | Section 37.5.155, -d43.36 | Show content transfer encoding | |
| -d43.40 | Section 37.5.156, -d43.40 | Show parse of Content-Type: header | |
| -d43.99 | Section 37.5.157, -d43.99 | Print the leading/following comments | |
| -d43.100 | Section 37.5.158, -d43.100 | Mark collect() and putheader() | |
| -d44.4 | Section 37.5.159, -d44.4 | Trace safefile() | |
| -d44.5 | Section 37.5.160, -d44.5 | useful | Trace writable() |
| -d45.1 | Section 37.5.161, -d45.1 | Show envelope sender | |
| -d45.3 | Section 37.5.162, -d45.3 | Show saved domain | |
| -d45.5 | Section 37.5.163, -d45.5 | Show don't send to sender | |
| -d46.9 | Section 37.5.164, -d46.9 | Show xf file's descriptors | |
| -d48.2 | Section 37.5.165, -d48.2 | useful | Trace calls to the check_ rule sets |
| -d49.1 | Section 37.5.166, -d49.1 | Trace checkcompat() | |
| -d50.1 | Section 37.5.167, -d50.1 | Show envelope being dropped | |
| -d50.2 | Section 37.5.168, -d50.2 | Show Booleans | |
| -d50.10 | Section 37.5.169, -d50.10 | Also show the send queue | |
| -d51.4 | Section 37.5.170, -d51.4 | Show queue entries being unlocked | |
| -d51.104 | Section 37.5.171, -d51.104 | Prevent unlink of xf file | |
| -d52.1 | Section 37.5.172, -d52.1 | Show isconnect from controlling TTY | |
| -d52.100 | Section 37.5.173, -d52.100 | Prevent disconnect from controlling tty | |
| -d53.99 | Section 37.5.174, -d53.99 | Trace xclose() | |
| -d54.1 | Section 37.5.175, -d54.1 | Show error return and output message | |
| -d54.8 | Section 37.5.176, -d54.8 | Show message and flags | |
| -d55.60 | Section 37.5.177, -d55.60 | Show file locking | |
| -d56.1 | Section 37.5.178, -d56.1 | Persistent host status tracing | |
| -d56.2 | Section 37.5.179, -d56.2 | More persistent host status tracing | |
| -d56.12 | Section 37.5.180, -d56.12 | Perform a sanity check | |
| -d56.80 | Section 37.5.181, -d56.80 | Trace creating the path to the status file | |
| -d56.93 | Section 37.5.182, -d56.93 | Dump MCI record for the host | |
| -d57.2 | Section 37.5.183, -d57.2 | Monitor vsnprintf() overflows | |
| -d59.1 | Section 37.5.184, -d59 | XLA from contrib | |
| -d60.1 | Section 37.5.185, -d60.1 | useful | Trace map lookups inside rewrite() |
| -d61.10 | Section 37.5.186, -d61.10 | Trace gethostbyname() | |
| -d62.1 | Section 37.5.187, -d62.1 | Log file descriptors before and after all deliveries | |
| -d62.8 | Section 37.5.188, -d62.8 | Log file descriptors before each delivery | |
| -d62.10 | Section 37.5.189, -d62.10 | Log file descriptors after each delivery | |
| -d80.1 | Section 37.5.190, -d80.1 | Content-Length: header (Sun enhancement) | |
| -d81.1 | Section 37.5.191, -d81.1 | > option for remote mode (Sun enhancement) | |
| -d91.100 | Section 37.5.192, -d91.100 | Log caching and uncaching connections | |
| -d99.100 | Section 37.5.193, -d99.100 | useful | Prevent backgrounding the daemon |
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.100debugging switch. The-d0.1debugging 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 = hereThe
Versionis the current version of sendmail. Note that for Sun the number may look likeSMI-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 IDENTITYshows the value assigned to four important macros. The meaning of each macro is contained in Table 31.7 in Section 31.10, "Alphabetized Reference".
Our name and aliases
(useful)The
-d0.4debugging switch tells sendmail to print several additional lines of information:Version 8.8.4 Compiled with: LOG MATCHGECOS NAMED_BIND NDBM NEWDB NETINET NETUNIX NIScanonical name: here.US.EDUadditional
UUCP nodename: hereadditional
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
ServiceSwitchFileoption (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.10debugging 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$mmacro (see Section 31.10.24, $m). It also appends the part of the name to the left of the leftmost dot to the classw(see Section 32.5.8, $=w). If the canonical name doesn't contain a dot, the$mmacro is undefined, and the whole name is appended to the classw.In addition, sendmail also sets the
$kmacro (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 classwabove.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 classw. The aliases listed are only those found using gethostbyname(3). To see each entry as it is added to the classw, use the-d37.8debugging 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.4debugging 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 macrow.
Operating System Defines
The
-d0.10debugging 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.pidThe
OS Definesare described in Table 18.3 in Section 18.8. Most are automatically determined during compilation; others are specified in Makefile.The
Kernel symbolsis 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...).
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
=Mrule-testing command (Section 38.4.2, "Show Delivery Agents with =M") for an example of this output.
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.4debugging switch above. To see every name that sendmail finds, new and old alike, use the-d0.20debugging switch:128.32.201.55already found
127.0.0.1found new a.k.a.: [127.0.0.1]
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.22debugging switch:uname failed (reason for failure here)
Announce scanning of interfaces
The
-d0.40debugging switch causes sendmail to announce that it is about to scan for network interfaces:scanning for interface specific names, ifc_len=64a.k.a.: [127.0.0.1]The
ifc_lenis the size in bytes of the configuration list returned by the kernel.
Print addresses of strings
The
-d0.44debugging 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.12debugging switch would look like this:--- rule fails ---trying rule: 0009ec68=@ 0009ec78=$* --- rule failsThis 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.
Print first 10 rule sets
(obsolete)The
-d0.90debugging 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
-btrule-testing mode's=Scommand (see Section 38.4.1, "Show Rules in a Rule Set with =S").
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,
senderis the user portion of the mail address of the sender. This output is most useful when combined with the-fcommand-line switch (which sets the name of the sender from the command line; see Section 36.7.21, -f and -r).
Dump the sender address
The
-d1.5debugging 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.
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: statnume_id=qide_flags=flagsThe
numis the final value of the sendmail program's globalExitStatvariable. 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
qidis 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
flagsis a hexadecimal representation of the possible envelope flags followed by a text representation of those flags in angle brackets with the leadingEF_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 Text Hex Description EF_OLDSTYLE 0000001Use spaces (not commas) in headers EF_INQUEUE 0000002This message is fully queued EF_NO_BODY_RETN 0000004Omit message body on error EF_CLRQUEUE 0000008Disk copy is no longer needed EF_SENDRECEIPT 0000010Send a return receipt EF_FATALERRS 0000020Fatal errors occurred EF_KEEPQUEUE 0000040Keep queue files always EF_RESPONSE 0000080This is an error or return receipt EF_RESENT 0000100This message is being forwarded EF_VRFYONLY 0000200Verify only (don't expand aliases) EF_WARNING 0000400Warning message has been sent EF_QUEUERUN 0000800This envelope is from queue EF_GLOBALERRS 0001000Treat errors as global EF_PM_NOTIFY 0002000Send return mail to postmaster EF_METOO 0004000Send to me too EF_LOGSENDER 0008000Need to log the sender EF_NORECEIPT 0010000Suppress all return-receipts EF_HAS8BIT 0020000At least one 8-bit character in body EF_NL_NOT_EOL 0040000Don't accept raw newline as end-of-line EF_CRLF_NOT_EOL 0080000Don't accept carriage-return/line-feed as end-of-line EF_RET_PARAM 0100000SMTP RCPT command had RET argument EF_HAS_DF 0200000Set when df file is instantiated EF_IS_MIME 0400000Really is a MIME message EF_DONT_MIME 0800000This 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.1debugging switches but under different circumstances.
Show file descriptors with dumpfd()
The
-d2.9debugging 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=flagsmode=mode type statsHere, the
numis 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
flagsis 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
modeis printed in octal and is the st_mode associated with an fstat(2) of the file descriptor. Thetypeexamines 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
statsare printed for all but the socket. They look like this:dev=major/minorino=inumnlink=nlinku/gid=uid/gidsize=bytesHere the
dev=shows the major and minor device numbers for the device that the file descriptor is associated with. Theinumis the inode number on the disk (if there is one) andnlinkis the number of hard links to the file on disk. Theuid/gidshows the user and group ownership associated with the file descriptor. Thesizeis the number of bytes in a file, and 0 for almost everything else.For a socket, the
statspart of each line looks like this:[addr]/port->hostHere,
addris 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. Thehostis 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.9debugging switches also print a line like this for specific file descriptors. Also if sendmail is run with the-d10.100switch, 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.
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 theRefuseLA(X) option (see Section 34.8.54, RefuseLA (X)), sendmail rejects incoming SMTP connections until the load average drops.The
-d3.1debugging 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:laHere,
lais 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: ZEROThe
-d3.1debugging switch also causes sendmail to print any errors it encounters while obtaining the load average.getla: open(/dev/kmem):errorHere,
/dev/kmemis the device that is used to access kernel memory. Theerroris the system error that caused the failure, such as "Permission denied" if sendmail is not properly sgid to the group kmem.getla: nlist(unix):errorThe 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, theerroris 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) ==> 0If 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,lais the name of the kernel variable that sendmail was trying to find.
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.5debugging switch causes V8 sendmail to print the load average over the last minute:getla: averun =1min
Print three load averages
The
-d3.15debugging switch causes V8 sendmail to print all three load averages:getla: averun =1min,5min,15minHere, 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).
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.20debugging switch causes that offset to be displayed:getla: symbol address =offsetHere, the
offsetis 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.1debugging switch causes sendmail to print:getla: seek or read:errorThis can indicate a wrong or corrupted kernel image.
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=priorityIf the
CurrentLAis less than the limit set by theQueueLA(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 thepripriority. 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)
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.80debugging 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 thresholdThis debugging output says that no limit was defined with the
MinFreeBlocks(b) option.enoughspace: bavail=haveblocksneed=needblocksThis debugging output shows that the number of blocks free (available) on the disk is
haveblocksand that the number of blocks required by incoming mail isneedblocks. Note thathaveblockswill always be -1 if sendmail was compiled with SFS_TYPE set to SFS_NONE (see Section 18.8.40, SFS-TYPE).enoughspace failure: min=boptionneed=needblocksIf the required number of blocks (
needblocks) exceeds the minimum reserved as defined by theMinFreeBlocks(b) option (boption), use of the disk is disallowed.
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