procmail
[Top] [All Lists]

Re: Quickie...

1997-12-16 15:34:35
On Tue, 16 Dec 1997, Michael C. Tiernan wrote:
      I want to take the "From:" address off a piece of mail and
      then do a replacement of "Reply-To:" with it. 

# if you want the "From:" name and address:
        FROM=`formail -zx'From:'`

# if you want the "From:" address only (mind case of -X option):
        FROM=`formail -X'From:'|formail -zrxto`

# if you want want formail to take it's best shot at picking the address
to use among different possible sender fields:
        FROM=`formail -zrtxto`

# Then change the header using the var FROM:

        :0 f
        | formail -a "Reply-To: $FROM"

The -a option adds the field if one doesn't already exist. Use -I to wipe
out any preexisting reply-to and insert your's. Use -i to insert your
reply-to, and move the original reply-to to "Old-Reply-To:"

Alternatively, you can skip putting the From: into a var, and just use one
call of formail to change the "From:" field to a "Reply-To:". But you'd
lose the "From:", which you probably don't want to do. 

        :0 f
        | formail -R "Reply-To:" "From:"

( None of the above is suited to procmail formulated auto-replies. That's
a horse from another safari ;-) 

David Hunt

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Quickie..., david hunt <=