home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1993 / Internet Info CD-ROM (Walnut Creek) (1993).iso / networking / mail / sendmail / sendmail.debug < prev    next >
Encoding:
Internet Message Format  |  1990-06-21  |  10.2 KB

  1. From: neal@smcnet.smc.edu (Neal Pollack, Telecomm Dept)
  2. Date: 23 May 90 18:35:29 GMT
  3. Subject: Sendmail Cheat Sheet
  4.  
  5. Thanks to Bill Lewandowski   wrl@wdl1.wdl.fac.com
  6.        Added to by    Neal Pollack     neal@smc.edu
  7.  
  8. Why confuse yourself when you can't find the docs?  Trying to memorize
  9. all of the sendmail flags and rules can seriously damage the average
  10. human brain.  Use a cheat sheet.  Maybe others will continue to add and 
  11. repost, till this becomes truly complete.  I keep a copy in the .cf file.
  12.  
  13.  
  14. #                       MAILER OPTIONS
  15. #
  16. #               f - this mailer wants a "-f from" line
  17. #               r - this mailer wants a "-r from" line
  18. #               S - call mailer as root
  19. #               n - do not insert a From line
  20. #               l - this mailer is local so final delevery will be made
  21. #               s - strip quote characters from addresses
  22. #               m - this mailer can send to more than one user on host
  23. #                   in single transaction
  24. #               F - this mailer wants a From or Resent-From line(s)
  25. #               D - this mailer wants a Date line in header
  26. #               M - this mailer wants a Message-Id header line
  27. #               x - this mailer wants a "Full-Name" header line
  28. #               P - this mailer wants a "Return-Path" header line
  29. #               u - upper case should be preserved in user names
  30. #               h - upper case should be preserved in host names
  31. #               A - this is an arpanet compatable mailer, use approprate flags
  32. #               U - use unix style "From" lines with "remote from"
  33. #               e - this is an "expensive" mailer
  34. #               X - this mailer uses the "hidden dot" algorithm from RFC821
  35. #               L - limit line lengths as specified in RFC821
  36. #               I - this mailer will be speaking SMTP to another sendmail
  37. #               C - if mail received from mailer with this flag set, any
  38. #                   addresses that do not have a "@" in them will have
  39. #                   "@domain" added to them
  40. #               E - escape lines beggining with "From" with a ">"
  41. #               R - this mailer wants a "Recieved" line in header
  42.  
  43. #
  44. # Sendmail's built-in macros:
  45. #
  46. #       $a      origin date in ARPANET format (in msg "Date:" line)
  47. #       $b      current date in ARPANET format
  48. #       $c      hop count
  49. #       $d      current date in unix (ctime) format
  50. #       $f      raw sender (from) address
  51. #       $g      translated sender address (relative to the recipient)
  52. #       $h      recipient host
  53. #       $i      the queue id
  54. #       $m      the domain name
  55. #       $p      sendmail's processid in decimal [not used herein]
  56. #       $r      protocol used
  57. #       $s      sender's hostname
  58. #       $t      the current time in seconds since 1/1/1970 (for msg ids)
  59. #       $u      is the recipient user
  60. #       $v      version # of sendmail
  61. #       $w      hostname
  62. #       $x      signature (full name) of sender
  63. #       $y      ttyid of terminal
  64. #       $z      home directory of recpient
  65.  
  66. #        R U L E S
  67. #        ---------
  68. #    The LEFT HAND SIDE:
  69. #    $*    match zero or more tokens
  70. #    $+    match one or more tokens
  71. #    $-    match exactly one token
  72. #    $=x    match any token in class x
  73. #    $~x    match any token NOT in class x
  74.  
  75. #    The RIGHT HAND SIDE:
  76. #    $n    substitute indefinite token n from LHS
  77. #    $[name$]  canonicalize name (look up with gethostent(3) )
  78. #          $[[128.32.130.2]$] would become vangogh.berkeley.edu
  79. #    $>n    call rule set n,   remainder of line substituted as usual,
  80. #        then passed to rule set n. Final value of rule n then
  81. #        becomes the substitution for this rule.
  82. #    $#mailer    resolve to "mailer", terminates, use only
  83. #            in rule 0, ends sendmail, goes to mailer.
  84. #    $@host        specify "host"
  85. #    $:user        specify "user"
  86.  
  87. #    COMMAND LINE FLAGS:
  88. #                some more common ones
  89. #    
  90. #    -n    do not do aliasing or forwarding
  91. #    -b#     Set operation mode to #, where # is;
  92. #        m    deliver mail, default
  93. #        a    run in arpanet mode
  94. #        s    speak SMTP on INPUT side
  95. #        d    run as a daemon
  96. #        t    run in test mode 
  97. #        v    just verify addresses, don't deliver
  98. #        i    initialize the alias database
  99. #        p    print the mail queue
  100. #        z    Freeze the configuration file
  101. #
  102. #    -d(level)    set debugging level
  103. #
  104. #    -C (file)    use an alternate configuration file.
  105. #
  106. #    -q (time)    Try to process the queue.  If time is given,
  107. #            sendmail will run the queue every "time" mins.
  108. #
  109.  
  110. -- 
  111. Neal Pollack - Santa Monica College Telecommunications Department   
  112. N6YFM         1900 Pico Blvd., Santa Monica, CA 90405-1628
  113. Voice: Work- 213-450-5150 x9845  Internet: neal@smc.edu
  114. UUCP: uunet!ucla-cs!smcnet!neal  or  ...!csun!smcnet!neal
  115.  
  116. Return-Path: comp.mail.sendmail
  117. >From: nelson@sun.soe.clarkson.edu (Russ Nelson)
  118. Date: 31 May 90 15:25:05 GMT
  119. Subject: The algorithm for rewriting rules
  120.  
  121. A ruleset is like a subroutine that sendmail calls when it wants an
  122. address transformed.  Sendmail calls rules 0 through 4 (or 6,
  123. depending on your version) by itself.  You can call other rulesets as
  124. subroutines.  Specific mailers can call rulesets for the sender or
  125. recipient.
  126.  
  127. I can't find the algorithm for the application of the rewriting rules.  As
  128. best I can determine from a source, this is it:
  129.  
  130.     Apply a rule.
  131.     If it matches, rewrite it and apply the same rule again.
  132.     If it doesn't match, try the next rule.
  133.  
  134.     If you start a RHS with $:, then after rewriting, apply the NEXT rule.
  135.     If you start a RHS with $@, then after rewriting, exit this ruleset.
  136.     If you start a RHS with $#, then after rewriting, exit this ruleset,
  137.       and ruleset zero will see the $#, and use that information to deliver
  138.       the mail using the given mailer.
  139.  
  140.  
  141.     The picture given in the documentation that looks roughly like this:
  142.  
  143.           /----> 0 ----> resolved address
  144.           |
  145.        |           /---> 1 ---> S ---\
  146.           |           |            |
  147.   --> 3 ----->  D  ---|            |---> 4 ----> Message
  148.               |            |
  149.                       \---> 2 ---> R ---/
  150.  
  151.     is terribly misleading.  It should really looks like this:
  152.  
  153.  ---> 3 -------> 0 ----> resolved address
  154.  
  155.                       /---> 1 ---> S ---\
  156.                       |            |
  157.  ---> 3 ----->  D  ---|            |---> 4 ----> Message
  158.               |            |
  159.                       \---> 2 ---> R ---/
  160.  
  161.     My documentation is not clear on whether the envelope's recipient
  162.     or the header's To: is used to deliver the message.
  163.  
  164. -- 
  165. --russ (nelson@clutx [.bitnet | .clarkson.edu])  Russ.Nelson@$315.268.6667
  166. Violence never solves problems, it just changes them into more subtle problems
  167.  
  168. >From: whm@arizona.edu (Bill Mitchell)
  169. Subject: List of 4.3BSD sendmail debugging flag values/actions
  170. Date: 8 May 87 01:33:09 GMT
  171. Organization: U of Arizona CS Dept, Tucson
  172.  
  173. Once again I found myself fooling with sendmail and as usual, I couldn't
  174. locate my assorted sheets of notes about what debugging flags do what.
  175. I decided to bite the bullet and go through and make notes about what
  176. all the flags do.  It turned out to only take a couple of hours and the
  177. results were fairly reasonable, so I thought I'd pass this information
  178. along, for what it's worth.  I don't think I overlooked any of the debug
  179. operations, but accidents will happen.
  180.  
  181. Note that I didn't follow the logic back far enough to note the conditions
  182. when a particular debugging action would be executed.  For example, -d0.15
  183. prints the configuration table only if the configuration file is read.
  184.  
  185. Here's the list.
  186. ---------------
  187.  0 -- main.c, recipient.c, util.c
  188.      0.1  -- don't fork in daemon mode, permit direct mailings to files,
  189.          programs, and :includes:'s.
  190.      0.4  -- print names for this host
  191.     0.15 -- print configuration table
  192.     0.44 -- printav() -- prints addresses of elements
  193.  
  194.  1 -- main.c, envelope.c
  195.      1.1 -- main() -- prints From person
  196.  
  197.  2 -- main.c
  198.      2.1 -- finis() -- print exit status and envelope flags
  199.  
  200.  5 -- clock.c
  201.     5.4 -- print calls to tick
  202.     5.5 -- print set/clrevent args
  203.     5.6 -- prints event queue on each tick
  204.  
  205.  6 -- savemail.c
  206.      6.1 -- print savemail() error mode and return-to-sender information
  207.     6.5 -- trace states in savemail() state machine
  208.  
  209.  8 -- domain.c
  210.      8.1 -- print various information regarding resolver operations
  211.     8.8 -- set RES_DEBUG
  212.  
  213. 10,11,13 -- deliver.c
  214.     10.1 -- print various address information
  215.     11.1 -- print openmailer() args
  216.     13.1 -- sendall() -- print all addresses being sent to
  217.     13.3 -- sendall() -- prints each addr in loop looking for failures
  218.     13.4 -- sendall() --  follows above, printing who gets the error
  219.  
  220. 15,16 -- daemon.c
  221.     15.1  -- print port and socket numbers in getrequests()
  222.     15.2  -- getrequests -- note forking/returning
  223.     15.15 -- activate network debugging on daemon socket
  224.     16.1  -- makeconnection() -- print host, addr, socket
  225.     16.15 -- print network debugging on daemon socket
  226.  
  227. 18 -- usersmtp.c
  228.     18.1 -- note openmailer failure, note entry to reply,
  229.          print smtpmessage() args
  230.  
  231. 20 -- parseaddr.c
  232.     20.1 -- print parseaddr() arg and result
  233.  
  234. 21 -- parseaddr.c
  235.     21.2  -- print rewrite() arg and result
  236.     21.3  -- note ruleset subroutine call
  237.     21.4  -- rewritten as ...
  238.     21.10 -- note rule failure
  239.     21.12 -- note rule attempt and success
  240.     21.15 -- print replacement string in hex chars (?)
  241.     21.35 -- print elements in pattern and subject
  242.  
  243. 25 -- recipient.c
  244.     25.1  -- print sendto() arguments
  245.     26.1  -- print recipient in recipient() and duplicate suppression
  246.  
  247. 27 -- alias.c
  248.     27.1  -- print arg to alias(), print info about alias, note failure
  249.           to open alias file, print arg to forward()
  250.  
  251. 30 -- collect.c
  252.     30.1  -- note EOH
  253.     30.2  -- print eatfrom arg
  254.     30.3  -- note addition of Apparently-To
  255.  
  256. 31,32,33,14 -- headers.c
  257.     31.6 -- print chompheader argument
  258.     32.1 -- print collected header
  259.     33.1 -- print crackaddr arg and return value
  260.     14.2 -- print headers being commaized(?)
  261.  
  262. 35 -- macro.c
  263.     35.9  -- print define() args
  264.     35.24 -- print expand() arg and return value
  265.  
  266. 36 -- stab.c
  267.     36.5 -- print stab args, sym found/not found, entered
  268.     36.9 -- print hfunc value
  269.  
  270. 37 -- readcf.c
  271.     37.1 -- print info re option setting/values
  272.  
  273. 40,41,7,51 -- queue.c
  274.     40.1 -- note queue insertion and print queue contents
  275.     40.4 -- show queue file contents
  276.     41.2 -- note open failure on cf file.
  277.     7.1  -- print info on envelope assigned to queue file
  278.     7.2  -- print selected queue file name
  279.     51.4 -- don't unlink x file
  280.  
  281. 45 -- envelope.c
  282.     45.1  -- print setsender argument
  283.     
  284. 50 -- envelope.c
  285.     50.1  -- print dropenvelope argument
  286.  
  287. 52 -- main.c
  288.     52.1 -- print i/o fd's for tty disconnection
  289.     52.5 -- don't disconnect
  290. ---------------
  291.                     Bill Mitchell
  292.                     whm@arizona.edu
  293.                     {allegra,cmcl2,ihnp4,noao}!arizona!whm
  294.