home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


sendmail

sendmailSearch this book
Previous: 4.2 Verbose (-v) Chapter 4
How to Run sendmail
Next: 4.4 Things to Try
 

4.3 Debugging (-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 . 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 37, Debugging with -d . 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 -d40 



you



 < /dev/null

Here, the -d40 is the debugging switch with a category of 40 . That category limits sendmail 's program output to information about the queue. The following output shows you some information about how your mail message was queued. A detailed explanation of this output is covered in Section 37.5.138, -d40.1 .

>>>>> queueing GAA14008 (new id) queueall=1 >>>>>
queueing 95688=you:
        mailer 4 (local), host `'
        user `you', ruser `<null>'
        next=0, alias 95460, uid 0, gid 0
        flags=6008<QPRIMARY,QPINGONFAILURE,QPINGONDELAY>
        owner=(none), home="/home/you", fullname="Your FullName"
        orcpt="(none)", statmta=(none), rstatus=(none)
<<<<< done queueing GAA14008 <<<<<

In addition to a category, a level may 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 -d0.1 -bp

The -d0 instructs sendmail to produce general debugging information. The level .1 limits sendmail to its minimal output. That level could have been omitted, because a level .1 is the default. Recall that -bp causes sendmail to print the contents of its queue. The output produced looks something like the following:

Version 8.8.4
 Compiled with: LOG NAMED_BIND NDBM NETINET NETUNIX NIS SCANF
                XDEBUG

============ 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
========================================================

Mail queue is empty

Here, the -d0.1 switch causes sendmail to print its version, some information about how it was compiled, and how it interpreted your host (domain) name. Now run the same command line again, but change the level from .1 to .11 :


% 


/usr/lib/sendmail -d0.11 -bp

The increase in the level causes sendmail to print more information:

Version 8.8.4
 Compiled with: LOG NAMED_BIND NDBM NETINET NETUNIX NIS SCANF
                XDEBUG
    OS Defines: HASFLOCK HASGETUSERSHELL HASINITGROUPS HASLSTAT
                HASSETREUID HASSETSID HASSETVBUF HASUNAME IDENTPROTO
                IP_SRCROUTE
   Config file: /etc/sendmail.cf
      Pid file: /etc/sendmail.pid
canonical name: here.us.edu
 UUCP nodename: here
        a.k.a.: [123.45.67.89]

============ 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
========================================================

Mail queue is empty