nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] forms expert

2005-10-06 14:40:36

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 = "mcr@xelerance.com";
       }

Add the following to your replcomps:

%(lit)%(formataddr %<{To}%>)%(formataddr %<{Cc}%>)\
%<(match xelerance.com)From: Michael Richardson <mcr@xelerance.com>\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 mcr@xelerance.com
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
Nmh-workers@nongnu.org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>