Sendmail Quick Reference
Tips and Tricks for Sendmail
Prints the mail queues contents, same as /usr/lib/sendmail bp
Rebuilds the aliases database file, same as /usr/lib/sendmail bi
Prints persistent host status info, same as /usr/lib/sendmail -bh
Purges (zeroes) persistent host status info, same as /usr/lib/sendmail -bH
Runs in daemon mode, same as /usr/lib/sendmail bd q30
- Quickly print the total number of messages within mail queue
/usr/lib/sendmail q Otimeout.queuereturn=99d - Purges the mail queue without timing out any messages. Useful if the mail server
has been down longer than the queuereturn value set in the cf.
/usr/lib/sendmail bv foolist | grep v deliverable - Prints only undeliverable addresses from in the mail list foolist. Great for
use in a shell script to remove badd addresses from a mailing list.
Command Line Switches
- Causes sendmail to clear the high-bit of every incoming byte.
Causes sendmail to preserve the high-bit or every incoming byte.
Uses ARPAnet/Grey-Book protocols to transfer mail.
Runs as daemon, like bd, but does not fork and does not detach from controlling terminal.
Runs as daemon, forks and detaches.
Purges (zeroes) persistent host status info.
Prints persistent host status info.
Initializes the aliases database.
Causes sendmail to read and send message (this is the default)
Prints the contents of the mail queue.
Runs sendmail on standard I/O.
Runs sendmail in rule testing mode.
- Verifies address.
Uses different.cf as its configuration file.
-c - Sets
HoldExpensive option to true.
- set debug mode.
- -d0 Shows general config
- -d0.1 Prints version
- -d.04 Prints local hostname and any aliases for it.
- -d0.15 Prints the list of delivery agents declared
- -d0.20 Prints address of each network interface
- -d8 Traces most DNS lookups
- -d8.1 Prints failure of low level MX searches.
- -d8.2 Prints calls to getcanonname
- -d8.3 - Traces dropped local hostnames
- -d8.5 Shows hostnames tried in getcanonname
- -d8.8 Shows when MX lookups return the wrong type.
- -d11 Traces delivery agent calls
- -d11.1 Traces arguments passed to the delivery agent
- -d11.2 - Prints the user ID that the delivery agent is invoked as
- -d21 Traces rewriting of addresses
- -d21.1- Traces general ruleset rewriting
- -d21.2 Traces use of $& macro
- -d21.3 Shows $> subroutines called
- -d21.4 Displays result of rewrite
- -d21.15 Shows $digit replacement
- -d21.35 shows token by token LHS matching
- -d27 Traces aliasing
- -d27.1 Traces general aliasing
- -d27.2 Traces :include: files, alias self-references, and errors on
- -d27.3 Traces the ~/.forward path and the alias wait
- -d27.4 Prints "not safe" when a file is unsafe to trust
- -d27.9 Shows uid/gid changes when reading :include: files
- -d35 Traces macros
- -d35.9 shows macro values as they are defined
- -d35.14 Shows macro names being converted to integer ids
- -d35.24 Shows macro expansion
- -d37 Traces options and class macros
- -d37.1 Traces the setting of options
- -d37.8 Traces the adding of words to a class
- -d41 Traces the queue
- -d41.1 Traces queue ordering
- -d41.2 Shows failure to open qf files
- -d41.49 Shows skipped queue files
- -d41.50 Show every file in queue
- Set senders full name
- Set senders address
- Set minimum hop count
IgnoreDots option to true
- Set macro
- Set return DNS notify information
Never return the info
Return on successful delivery
Return on failure
Return on delayed delivery
- Set an option (long name)
an option (short name)
Sets protocol in $r macro to UUCP and $s macro to test
Sets queue processing to every 30 min
Processes the queue once delivering only mail to @here.com
bounces only the headers
Bounces headers and body
SaveFromLine option to true
Sets Timeout.queuereturn option to 5 days
a list of recipients from messages headers
this the initial MUA to MTA submission
Sets the DSN ENVID string to test123456
sendmail in verbose mode
Logs both sides of smtp transactions to trace.mail file.
Rule Testing Mode (/usr/lib/sendmail bt)
Defines macro r as UUCP
Prints the contents of ruleset 5
list of delivery agents
Prints the value of macro name.
prints the contents of the class macro w
Returns the MX records for here.com in the order they will be utilized
Parses the value of the address foo, returns the value of crackaddr(), and the final parsed address including
the delivery agent.
/try local foo
Rewrites the address foo based on the rules for local delivery
Sets the flags used by /parse and /try to H for header and S for sender, can also use E for envelope and R for
- Transforms the hostname foo into its canonical form
/map aliases foo
Looks up foo in the aliases database
Runs the address me@foo through rulesets 3 and 0