Debugging Mode (-d)

The sendmail program can also produce debugging output. The sendmail program is placed in debugging mode by using the -d command-line switch. That switch produces far more information than -v does. To see for yourself, enter the following command line, but substitute your own login name in place of the you:

% /usr/lib/sendmail -d you < /dev/null

This command line produces a great deal of output. We won’t explain this output because it is explained in Chapter 15 on page 530. For now, just remember that the sendmail program’s debugging output can produce a great deal of information.

In addition to producing lots of debugging information, the -d switch can be modified to display specific debugging information. By adding a numeric argument to the -d switch, output can be limited to one specific aspect of the sendmail program’s behavior.

Type in this command line, but change you to your own login name:

% /usr/lib/sendmail -d0 you < /dev/null

Here, the -d0 is the debugging switch with a category of 0. That category limits sendmail’s program output to information about how sendmail was compiled. A detailed explanation of that output is covered in -d0.4 on page 542.

In addition to a category, a level can also be specified. The level adjusts the amount of output produced. A low level produces little output; a high level produces greater and more complex output. The string following the -d has the form:

category.level

For example, enter the following command line:

% /usr/lib/sendmail ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.