The -d
command-line switch allows you
to observe
sendmail’s inner workings in
detail. But note that
sendmail’s various debugging
switches differ from vendor to vendor and from version to version.
This chapter is specific to V8.13 sendmail.
These switches are perhaps best used with a copy of the
sendmail source by your side.
Also note that many of the internal details shown here will change as sendmail continues to evolve and improve.
Although there are no additional, useful debugging switch settings in V8.13, there is one new debugging command-line switch described next.
The -D
command-line switch is used
to redirect
sendmail’s debugging output
(16.1[3ed]) into a file for later
examination. It is used as in the following example, where
file
is the name of an existing or new
file:
-D file
The -D
command-line switch (if used) must precede
the -d
switch on the same command-line, otherwise
the following error will print, and all debugging output will be
printed to the standard output (possibly causing you to miss seeing
the error):
-D file must be before -d
The file
specified with
-D
must live in a directory that is writable by
the user running sendmail
. If the file does not
exist, it will be created. If the file already exists, it will be
silently appended to.
Extra care must be exercised when using the -D
command-line switch as root because the target file
will be appended to, even if it is a symbolic link to an important
file. For example, when
/tmp/foo
is a nonroot owned symbolic
link that points to /etc/passwd
, the following
command-line, when run by root, will silently
append debugging information to the /etc/passwd
file:
# /usr/sbin/sendmail -D /tmp/foo -d0.1 -bt < /dev/null
Using -D
causes sendmail to drop privileges.
3.142.198.129