I am trying to find a way to rewrite the envelope from address based on what the envelope from currently is. This question here also has what I need:
Sendmail: Setting envelope sender to a fixed value
That issue has the following code:
SEnvFromSMTP
R$+ <@foo.org.> $: john.doe <@example.net.>
divert(0)
This works to change the Envelope from address to john.doe@example.net if it was a @foo.org address. I need to take this example and add a few more matches. For example I may also want to change @test.com to john.doe@example.net. No manner of stacking the rewrite rules resulted in anything that worked.
I was reading this page:
http://www.sendmail.org/~ca/email/doc8.12/op-sh-5.html
I am pretty sure this will require some regex, but I am having trouble figuring out how it all needs to come together. Also really hoping to keep any added config in the sendmail.mc file.
Thanks
MAILER(smtp)dnlLOCAL_CONFIGC{FixSenderDomains}domain1.com domain2.comMAILER_DEFINITIONSSEnvFromSMTPR$+ <@ $={FixSenderDomains} .> $: john.doe <@example.net.>divert(0)It is rewriting the domain for "domain2.com" but not for "domain1.com", and yes I do have a TAB before the "$: john..." int he R line.
– alaphoid Apr 03 '17 at 14:35