I could sure use it! TMDA when generating challenge messages sends a 'From:' based on the $RECIPIENT variable. Unfortunately, my primary addresses are all aliases, where I'd like those to be canonical, and $RECIPIENT is post-expansion. With the documented ORIGINAL_RECIPIENT to hand, this isn't a big deal until TMDA gets fixed - write a quick wrapper script that calls TMDA with $RECIPIENT set equal to $ORIGINAL_RECIPIENT. However, it isn't set, even where the destination address of the email and the expanded address are clearly different.
There's another thought, but I don't know which is safest. Because the aliases are all constant addresses after expansion in the 'From:' headers, and don't contain any extension characters, couldn't I put it into canonical(5) maps? There'd be no interference from SMTP server or clients, and I could always restrict it to just sender header (messages go out with <> envelope). The only question then is: how do I prevent mail arriving with the aliases expanded over SMTP from remote clients from themselves getting rewritten? Or, I could play with the recipient address of mail inbound. Which does cleanup prioritise, alias expansion or canonical maps? I could undo the $RECIPIENT expansion for the benefit of TMDA for just those aliases using it. Cheers, Sabahattin