Michael Richardson writes:
>I have been trying to get replcomps to fill in a From: if it sees
>certain things in To: or CC:. In perl:
>
> if($to =~ /xelerance.com/ || $cc =~ /xelerance.com/) {
> $from = "[EMAIL PROTECTED]";
> }
Add the following to your replcomps:
%(lit)%(formataddr %<{To}%>)%(formataddr %<{Cc}%>)\
%<(match xelerance.com)From: Michael Richardson <[EMAIL PROTECTED]>\n%>\
Essentially, reset the str register, append the contents of the
To: and Cc: header components, and if the resulting string contains
"xelerance.com", output the specified From: header.
You might also want to add the line:
masquerade: draft_from
to your mts.conf so nmh claims the message is from [EMAIL PROTECTED]
in the envelope as well as the header.
Note that using the To: and Cc: fields to determine which address
a message has been sent to is unreliable, particularly for things
like mailing lists and spam. Consider getting your MTA to add an
X-Envelope-To: header, and check for that instead.
Tet
_______________________________________________
Nmh-workers mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/nmh-workers