procmail
[Top] [All Lists]

Re: (procmail) Re: setting up an autoreply

1998-08-04 13:15:31
webgrrls(_at_)xsite(_dot_)net wrote:

<> Isn't this really what I'm trying to do? Since I am searching for a
<> subject line of:
<>      [admin] subscribe
<> my recipe would look like this:
<> 
<>           * !^From +webgrrls
<>           * !^Subject:.*Chicago Webgrrls Listserv FAQ
<>           * !^FROM_DAEMON
<>           * ^Subject:.*[admin] subscribe
<>           | (formail -r ; cat info_file) | $SENDMAIL -oi -t
<> 
<> Does the * in "^Subject:.*[admin] subscribe" act like a wild card, or does
<> it have another function here? i.e. the recipe as above would catch and
<> reply to messages with "Re: [admin] subscribe" in the subject line? Since
<> I would not want this to happen, could I delete the *?

The ".*" is a regex pattern -- "." means match any single character
(that's not a carriage return) and "*" means zero or more instances. SO
".*" means zero or more non carriage return characters.

   * ^Subject:.*[admin] subscribe

means a line beginning with "Subject" (^ is an anchor for the beginning of a
line) and containing the string "[admin] subscribe"

The only concern I have with the above recipe is whether the subscription
notification comes from the list software or the person who wants to be
subscribed.  You haven't been too clear on that.

If the latter case, then using formail -rt (You should use the "t" switch
to get a return address). will work fine.  BUT, if the list software
generates the message, the way MajorDomo does, then you need to go
digging thru the body of the message:

   AUTO=${HOME}/List
   FORMAIL=/path/to/formail

   :0 h
   * ! FROM_DAEMON
   * !^X-Loop:.*webgrrls-loop-check
   * ^Subject:.*\[admin\][       ]+subscribe
   {
      :0 B
      * From:[   ]+\/.*
      | ( $FORMAIL -rk -I"X-Loop: webgrrls-loop-check" \
           -I"To: $MATCH" \
           -I"From: webgrrls List Owner <address(_at_)domain(_dot_)TLD>" \
           -i"Subject: (Automated Message) Welcome to the List" ;\
         cat ${AUTO}/Welcome.txt ; \
      ) | $SENDMAIL -oi -t
   }

This is patterned after the recipe I use to respond to sundry bounce
messages I get from MajorDomo.  Critiques welcomed ... 

Reto
-- 
R A Lichtensteiger       rali(_at_)meitca(_dot_)com -or- 
rali(_at_)world(_dot_)std(_dot_)com
                         http://www.meitca.com/ITA/People/rali
    "Yes, you're doing things right, but are you doing the right things?"
    "Nope.  I'm just doing something dumb fast."

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