3 -> 0 -> delivery agent if F=A, then username -> 5 -> delivery agent 3 -> 2 -> R= -> 4 -> recipient 3 -> 1 -> S= -> 4 -> sender LHS Rules: $* 0 or more tokens $+ 1 or more tokens $- 1 token $@ 0 tokens (V8) $=x Any token in class x $~x Any token not in class x RHS Rules: $i Token i $>x Source ruleset x $# Delivery agent ($@ host $: user) $[ Canonicalize $( db lookup $&f expand f at runtime only RHS Prefixes: $: rewrite only once $@ rewrite and return Mailer Flags: 0 Turn off MX lookups 3 Extend quoted-printable to EBCDIC 5 Use S5 after local aliases 7 7-bit only 8 Suppress EightBitMode=m in MIME : Check for :include: files | Check for pipes to programs / Check for file addresses @ Extended SMTP A User can be LHS of alias b Add blank line after message c Exclude comment from $g in headers C Add @domain to recipient d Don't enclose route addresses in <> D Must have Date header e Mark "expensive" agents E Change extra From to >From f Delivery agent adds -f to argv F Need From header g Suppress From:<> h Preserve uppercase in hostname i Do UDB sender rewrite on envelope I Send SMTP VERB j Perform UDB rewrite of header recipients k Don't check for loops in HELO command l Delivery agent is local (final) L SMTP line limits m Multiple recipients possible M Need Message-ID header n No unix-style From o Always run delivery agent as recipient p Process return path correctly (deprecated) P Need Return-Path q 250 instead of 252 for SMTP VRFY r Delivery agent adds -r to argv R Use reserved TCP port s Strip quotes S Assume specified uid/gid u Preserve uppercase for username U Use UNIX-style From line w Check for /etc/passwd entry x Need Full-Name header X Need RFC821 hidden dot Predefined Macros: $_ RFC1413-validation and IP source route $a Origin date in RFC822 format $b Current date in RFC822 format $c Hope count $d Current date in ctime(3) format $f Sender's address (processed by rules 3, 1, 4) $g Sender's address relative to recipient (processed by 3, 1, S=, 4) $h Host part of the recipient address $j Official canonical name $k UUCP node name $l From format (prior to version 8.7) $m Domain part of hostname $n Error message sender (such as mailer-daemon) $o Token separation operators (prior to version 8.7) $p Process ID $q Default format of sender's address (prior to version 8.7) $r Protocol by which message was received $s Sender's host name $t Current time in seconds $u Recipient's username $v Sendmail version $w Short name of host $x Full name of sender $y Name of controlling tty $z Recipient's home directory Notes: It is imperative that masquerading be done in ruleset 5, not 0. I tried to do it in ruleset zero, and this *almost* worked. However, it would no longer correctly get the full name of the user from the local /etc/passwd file.