procmail
[Top] [All Lists]

Re: newbie question about autoreply (vacation) subject line

2003-05-27 14:06:14
On Tuesday, May 27, 2003, at 11:49 Canada/Mountain, C. Wilson wrote:
Hello, I just started working  with procmail for about 2 weeks now. I've found a lot of information from the manpages  and the FAQ, but I just can't seem to figure out how to capture the Subject line. The following .procmailrc works great, but the Subject line is "Re: $SUBJECT" I would like it to be "Autoreply To: $SUBJECT".  I've been messing around with "formail" with little success. Could someone kindly help me out or point me to some good documentation.

DO this early in your recipes, I also grab from and to the same basic way

* ^Subject:(.*\<)\/[^  ].*
{ SUBJECT=$MATCH }

:0 Whc: vacation.lock
| /usr/bin/formail -rD 8192 vacation.cache

:0 e

* $^To:.*\<$\LOGNAME\>
# Don't reply to daemons and mailinglists
* !^FROM_DAEMON

add:
* !^Precedence:(.*\<)(bulk|list|junk)

# Mail loops are evil
* !^X-Loop: furball(_at_)kitty(_dot_)com

replace:
* !^X-Loop:(.*\<)furball(_at_)kitty(_dot_)com

| (/usr/bin/formail -rI"Precedence: junk" \
 -I "Subject: Autoreply To: $SUBJECT" \

-A"X-Loop: mneuman(_at_)cooketech(_dot_)net" ; \
cat /home/mneuman/info.txt \
) | /usr/lib/sendmail -oi -t -f furball(_at_)kitty(_dot_)com

That should do it.

Basically, you grab the subject first (I grab it just after I check for duplicate messages and write the message to the backup spool). Then you check against your vacation spool. If that check fails, then you autoreply.

Now, the precedence check is probably not really needed since you are specifically checking that the message is addressed to you, still, it can't hurt and it's possible that some lists might send a message directly to you instead of "to" the list.

--
I wrote this song two hours before we met. I didn't know your name, or what you looked like yet....



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail