SurgeMail List,
We have a need to rewrite an email address in message headers. I am attempting to write an mfilter rule to make this happen. I have created the following rules.
recipients
if (isin("recipient","support@n2net.com")) then
replace("to","support@n2net.com","support@n2net.net")
end if
end recipients
This works. It replaces both the email address and the "name" portion in the To address (see below).
To: "support@n2net.net" <support@n2net.net>
HOWEVER, if the message has multiple recipients, then the rule does not work.
To: "johndoe@domain1.tld" <johndoe@domain1.tld>, "support@n2net.com" <support@n2net.com>, "janedoe@domain2.tld" <janedoe@domain2.tld>
I know the isin() test is working because I added a "call report()" to the rule block and it sends me a report email. I have tried adding wildcards to the rule (see below), but this also does not work.
replace("to","*support@n2net.com*","%1support@n2net.net%2")
Is there any way to replace all instances of an email address in a header?
Thanks in advance,
Jim Lohiser
N2Net
|