procmail
[Top] [All Lists]

Re: recipie for using procmail to edit headers and re-send?

1999-10-01 06:07:13
On Thu, 30 Sep 1999 18:21:26 -0700 (PDT), Sarah Hutchinson
<sarah_h_11217(_at_)yahoo(_dot_)com> wrote:
The question is if any body has a recipe that can,
from the information in the from:
(sarah_h_11217(_at_)yahoo(_dot_)com) line and too line
(someuser;somedomain(_at_)foo(_dot_)com), clean up the e-mail so
that it looks like it came not from (in his case)
yahoo, but from another domain, and then send on the
cleaned-up e-mail to someuser(_at_)somedomain?

Perhaps you can come up with an example? This isn't very clear IMHO.
How do you know what should go in the From: line, is there a list of
"rewrite this address into this address" somewhere? Can you cope with
a restriction that real names and other "comments" in the To: line are
prohibited?

    FROM=`formail -zxFrom: | perl map-from-to-new-from`
    :0
    * ^To: [;@]+;[@;]+(_at_)foo\(_dot_)com
    * ^To: \/[;@]+;[@;]+
    | formail -I "From: $FROM" -I "To: "`echo $MATCH | tr ; @` \
      | $SENDMAIL -oi -t

This isn't very elegant or full-fledged, but it should give you some
idea. 

Is this question too involved for this list?

Probably not, but perhaps you can be more specific.

/* era */

-- 
 Too much to say to fit into this .signature anyway: <http://www.iki.fi/era/>
  Fight spam in Europe: <http://www.euro.cauce.org/> * Sign the EU petition

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