[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] forms expert
From: |
Tet |
Subject: |
Re: [Nmh-workers] forms expert |
Date: |
Thu, 06 Oct 2005 22:41:51 +0100 |
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 = "address@hidden";
> }
Add the following to your replcomps:
%(lit)%(formataddr %<{To}%>)%(formataddr %<{Cc}%>)\
%<(match xelerance.com)From: Michael Richardson <address@hidden>\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 address@hidden
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