The sendmail program offers a command-line switch
for investigating and solving mail problems. The debugging
-d switch allows you to observe sendmail's
inner workings in detail.
category.level,category.level,....-dANSI V8.8 and above
-d may appear alone, or it may be followed by
one or more
category.level pairs separated
by commas or, beginning with V8.8, by the word ANSI.
We cover the
category.level pairs first then ANSI.
category limits debugging to
an aspect of sendmail (such as queuing or aliasing).
level limits the verbosity of sendmail
(with low levels producing the least output).
category is either a positive integer or a
range of integer values specified as
category is a range,
first is a positive
integer that specifies the first category in the range. It is
followed by a hyphen character (
-) and then
last, a positive integer that specifies the last
category in the range.
The value of
first must be less than
the value of
last, or the range will be ignored.
The level is a positive integer. A level of 0 causes sendmail to produce no output for the category.
-d is specified with neither
level, an internal sendmail default is used:
This default causes sendmail to set all the categories, from zero through 99 inclusive, to a level of 1.
category is included but
omitted, the value for
level defaults to 1.
When a dot (
level are included,
category is omitted, the value for
defaults to 0.
The maximum value that may be specified for a single
is 99. Any value specified above the maximum is reduced to
the maximum. The maximum value for
level is that of an
unsigned char (255 decimal).
category or range evaluate to zero. Nondigits
level evaluate to 1.
level specifies the maximum amount of verbose output
to produce. All levels below the
also produce output.
The expression that produces the maximum debugging output is
But beware that debugging levels of 100 or greater may cause
sendmail to modify its behavior. (For example, one category
at such a high level causes sendmail to not remove its
temporary files.) For this reason,
-d0-99.99 is the maximum level
Debugging can be turned on from the command line and from within
-bt rule-testing mode (see Section 38.7, "Add Debugging for Detail").
If sendmail is wrongly compiled
with SMTPDEBUG defined (see Section 18.8.42, SMTPDEBUG),
debugging can be turned on via an SMTP DEBUG command.
Beginning with V8.8 sendmail, a special debugging word can be specified at the command line to cause debugging output to become clearer:
-dANSI V8.8 and above
ANSI is case sensitive and must be the only argument following
-d. If you wish to combine it with other debugging switches,
you must specify them separately:
ANSI causes defined macros, class macros, and operators to be displayed in reverse video:
R $+ $#local $: $1
This is truly a "hack." The escape code to highlight characters is hard-coded into sendmail. Your display must support ANSI standard escape sequences for this to work. There is no plan to use standard library support for this "aid to rule-set hackers."