|
Sendmail Quick Reference Tips and Tricks for Sendmail mailq Prints the mail queue�s contents, same as /usr/lib/sendmail bp newaliases Rebuilds the aliases database file, same as /usr/lib/sendmail bi hoststat Prints persistent host status info, same as /usr/lib/sendmail -bh purgestat Purges (zeroes) persistent host status info, same as /usr/lib/sendmail -bH smtpd Runs in daemon mode, same as /usr/lib/sendmail bd q30 mailq OmaxQueueRunSize=1 - 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 -B 7bit - Causes sendmail to clear the high-bit of every incoming byte. -B 8bitmime Causes sendmail to preserve the high-bit or every incoming byte. -ba Uses ARPAnet/Grey-Book protocols to transfer mail. -bD Runs as daemon, like bd, but does not fork and does not detach from controlling terminal. -bd Runs as daemon, forks and detaches. -bH - Purges (zeroes) persistent host status info. -bh - Prints persistent host status info. -bi - Initializes the aliases database. -bm Causes sendmail to read and send message (this is the default) -bp Prints the contents of the mail queue. -bs Runs sendmail on standard I/O. -bt Runs sendmail in rule testing mode. -bv <address> - Verifies address. -C /tmp/different.cf Uses different.cf as its configuration file. -c - Sets HoldExpensive option to true. -d <facility.level> - set debug mode.
-F <name> - Set senders full name -f <address> - Set senders address -h <count> - Set minimum hop count -i Set IgnoreDots option to true -M<macro><value> - Set macro -N<switch> - Set return DNS notify information
-n Supresses aliasing -O<option=value> - Set an option (long name) -o Set an option (short name) -pUUCP:test Sets protocol in $r macro to UUCP and $s macro to test -q30m Sets queue processing to every 30 min [email protected] Processes the queue once delivering only mail to @here.com -R hdrs bounces only the headers -R full Bounces headers and body -s Sets SaveFromLine option to true -T 5d Sets Timeout.queuereturn option to 5 days -t Gathers a list of recipients from messages headers -U make this the initial MUA to MTA submission -V test123456 Sets the DSN ENVID string to test123456 -v Runs sendmail in verbose mode -X /var/tmp/trace.mail Logs both sides of smtp transactions to trace.mail file.
Rule Testing Mode (/usr/lib/sendmail bt) ? Prints help .DrUUCP Defines macro r as UUCP =S5 Prints the contents of ruleset 5 =M Displays list of delivery agents ${name} Prints the value of macro name. $=w prints the contents of the class macro w /mx here.com Returns the MX records for here.com in the order they will be utilized /parse foo 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 /tryflags HS 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 recipient /canon foo - Transforms the hostname foo into its canonical form /map aliases foo Looks up foo in the aliases database 3,0 me@foo Runs the address me@foo through rulesets 3 and 0
|