procmail
[Top] [All Lists]

Re: Autorespond to the "Reply-To" address

2000-01-31 19:06:51
"Todd Bergstrom" <tbergstrom(_at_)r-control(_dot_)com> writes:
This is a multi-part message in MIME format.

Can you please turn off the sending of HTML messages to the procmail list?
Thanks!


I am new to procmail (and I am not a programmer).  I am trying to create
an autoresponder that will respond to the Reply-To email address
specifically instead of the From email address.

My current recipe is shown below.  Any help is greatly appreciated.
tbergstrom(_at_)visi(_dot_)com


:0 hc
* ^TOme(_at_)mydomain(_dot_)com
* ^SUBJECT:*.test
* !^FROM_DAEMON
* !^X-Loop:me(_at_)mydomain(_dot_)com
 | (formail -rtb -I"Precedence: junk" \
   -I"From: <me(_at_)mydomain(_dot_)com>" \
   -A"X-Loop: me(_at_)mydomain(_dot_)com; \
   cat $HOME/response.txt \
   ) | $SENDMAIL -t

Looks great.  "formail -rt" will automatically prefer the address in a
Reply-To: header field over that in a From: header field, so you should
be good to go.  The only two changes I would suggest are to drop the -b
flag, as it doesn't do anything when you don't pass formail a message
body, and to use the ^TO_ token instead of ^TO if you're attempting to
match "me(_at_)mydomain(_dot_)com" as an address and not just part of an 
address.
What you have now will match addresses like:
        "kick-me(_at_)mydomain(_dot_)com"

(Yeah, "me(_at_)mydomain(_dot_)com" is just an example, but the idea holds.)

Hmm, looking again I would suggest being careful to match an optional
space after the colon in "X-Loop:me(_at_)(_dot_)(_dot_)(_dot_)" as some MTAs 
(sendmail at least)
will insert a space there.  That could break loop detection, so it really
does need to be fixed.

Anyway, you have the content down just fine.  With the exception of the
missing space in the X-Loop: condition your original version would work
just fine.  Good work.


Philip Guenther

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