procmail
[Top] [All Lists]

Re: using From: instead of Return-Path: to reply to mail

1997-07-26 13:34:00
Richard Walker spaketh thusly at dman:

hello,

I was wondering how I could somehow ignore the Return-Path in a message
and instead use the From: field to get a return address for an
autoresponder.  The message I wish to auto-respond to comes to my mail
server in the form

X-POP3-Rcpt: ddp(_at_)no1
Return-Path: web
Date: Fri, 25 Jul 1997 22:54:11 -0400
To: webmaster(_at_)ddpweb(_dot_)com
Subject: information
From: ddp(_at_)netmegs(_dot_)com

note that the Return-Path is always web, since I am using my server on a
form to send the e-mail...  basically I want to ignore this and use the
From: field.  Otherwise my auto-responder sends mail to the webmaster. 
WHOOPS!!!

Something like this should work assuming that your autoresponder respects
the 'Reply-To: ' header over the 'Return-Path: ' header (which it
*should*).  If not, you can use `formail` to strip that header out:

        #
        # Grab the 'From: ' header (you could also '\/' this):
        #
        FROM=`formail -zcx'From: '`

        #
        # Now stick the 'From: ' header info into the 'Reply-To: ' header
        # (You may want to use a local lockfile here):
        #
        :0 fhw:
        * ^Return-Path: web$
        | formail -i"Reply-To: $FROM"

Lates!
--------------------------------------------------------------------------
Tim <bodysurf(_at_)pobox(_dot_)com>                         
mailto:bodysurf(_at_)pobox(_dot_)com
Finger bodysurf(_at_)pobox(_dot_)com for my PGP public key (Bits 1024/KeyID 
09DA5C49)
PGP Key FingerPrint (09/03/94):  4C97 F1FA 7055 6891   49D1 ADF2 DD63 0C15
--------------------> Please PGP encrypt your email <---------------------

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