I'm using sendmail 8.14.4 on x64 Centos 6.3. and have followed the instructions provided by adamo in: How can I configure sendmail (or another mail server) to accept outbound mail, but to not send it out? to send all mails to a specific mailbox as follows:
LOCAL_RULE_0 R$* < @ $=w . > $* $#local $: $1 R$* < @ $* . > $* $#local $: quicksilver
This compiles with M4 just fine and deposits the rules in the .cf file with another that seems to be there by default.
Unfortunately sendmail does not send messages to the designated mailbox.
If I run
sendmail -d21.12 firstname.lastname@example.org
the debug output shows that it's running Parse0 but then it's skipping ParseLocal (98) as follows:
... rewrite: ruleset Parse0 returns: q < @ q . com . > rewritten as: q < @ q . com . > -----trying rule: < @ > ----- rule fails -----trying rule: $* -----rule matches: $: $> ParseLocal $1 -----skip subr ParseLocal (98) rewritten as: q < @ q . com . > -----trying rule: $* -----rule matches: $: $> Parse1 $1 rewrite: ruleset Parse1 input: q < @ q . com . > ...
A test e-mail:
echo 'this is a test'| mail -s test_email email@example.com
sends directly to firstname.lastname@example.org
sendmail -bt 0 email@example.com
translates to firstname.lastname@example.org (does not translate) but strangely
sendmail -bt 3,0 email@example.com
does translate to quicksilver
So at this point my best guess is that sendmail is either not canonifying first when sending mails or that sendmail is somehow set to not run local rules after Ruleset 0.
Any thoughts on why addresses are not being translated?