procmail
[Top] [All Lists]

Re: matching addr in msg body for formail

2003-11-14 16:08:00
Hello,

Okay, I'm stumped.  Here's my recipe, borrowed in very 
large part from Ruud's recipe, but please, if anyone can help,
I'd appreciate it.

What follows is the recipe, message body to match, and then the log.
I am unable to get the 2nd match on the line "requests" in order to get
$List and $Subscriber assigned.  

My head is getting flatter by the minute as I beat it on my desk...

deb


RECIPE:
:0 c 
* ^From:(_dot_)*majordomo(_at_)lists(_dot_)com
* !^X-Loop: elists-approval(_at_)lists(_dot_)com
* B ?? ^^--$$.*<\/[^>]+> requests that you approve the following:\
             $$[        ]+unsubscribe .*
{ 
    M = "$MATCH" 

    :0
        * M ?? ^^\/[^>]+
        { ReqAddr="$MATCH" }

        :0
        * M ?? ^^[^>]+> requests that you approve the following:\
                 $$[    ]+unsubscribe \/.*
        { M = "$MATCH" }

    :0
        * M ?? ^^\/[^ ]+
        { List = "$MATCH" }

    :0
        * M ?? ^^[^ ]+ \/[^ ]+
        { Subscriber = "$MATCH" }


        :0
    | (formail -r -I"From: MajorDomo-Owner(_at_)lists(_dot_)com" \
      -I"To: $ReqAddr" \
      -A"X-Loop: elists-approval(_at_)lists(_dot_)com" ; \
      cat $AUTORESPONSE ) | $SENDMAIL -t
 }

##################################################################
MESSAGE BODY:

--

Deb <deb(_at_)lists(_dot_)com> requests that you approve the following:

        unsubscribe elists someone(_at_)example(_dot_)com

If you approve, please send a message such as the following back to
majordomo(_at_)lists(_dot_)com (with the appropriate PASSWORD filled in, of 
course):

        approve PASSWORD \
        unsubscribe elists \
        someone(_at_)example(_dot_)com
  
[The above is broken into multiple lines to avoid mail reader linewrap
problems. Commands can be on one line, or multi-line with '\' escapes.]

If you disapprove, do nothing.


Thanks!

majordomo(_at_)lists(_dot_)com
  
##################################################################
The 2nd match on the line containing "requests" fails.  
Here's the log:

procmail: [1003] Fri Nov 14 14:33:34 2003
procmail: Assigning "LOGABSTRACT=ALL"
procmail: Assigning "DEFAULT=/dev/null"
procmail: Assigning "ORGMAIL=/dev/null"
procmail: Assigning "SENDMAIL=/home/deb/.procmail/sandbox/sendmail.sh"
procmail: Assigning "AUTOREPLY=/home/deb/.procmail/AutoResponses"
procmail: Assigning "MATCH="
procmail: Matched "APPROVE elists"
procmail: Match on "^Subject:[  ]*\/[^  ].*"
procmail: Assigning "SUBJECT=APPROVE elists"
procmail: Assigning "MATCH="
procmail: Matched "elists-approval(_at_)lists(_dot_)com"
procmail: Match on "^To:[       ]*\/[^  ].*"
procmail: Assigning "TO=elists-approval(_at_)lists(_dot_)com"
procmail: Assigning "MATCH="
procmail: Matched "majordomo(_at_)lists(_dot_)com"
procmail: Match on "^From:[     ]*\/[^  ].*"
procmail: Assigning "FROM=majordomo(_at_)lists(_dot_)com"
procmail: No match on "^X-Envelope-To: *<\/[^>]*"
procmail: Assigning "MATCH="
procmail: Matched "MajorDomo-Owner(_at_)lists(_dot_)com"
procmail: Match on "^From \/[^ ]*"
procmail: Assigning "ENVFROM=MajorDomo-Owner(_at_)lists(_dot_)com"
procmail: Assigning "SENDER="
procmail: Executing "formail,-b,-rtzxTo:"
procmail: Assigning "CLEANFROM="
procmail: Executing "formail,-IReply-To:,-rtzxTo:"
procmail: Assigning "MATCH="
procmail: Matched "majordomo"
procmail: Match on "^\/[^(_at_)]+"
procmail: Assigning "FROM_USER=majordomo"
procmail: Assigning "MATCH="
procmail: Matched "lists.com"
procmail: Match on "@\/.*"
procmail: Assigning "FROM_DOMAIN=lists.com"
procmail: Assigning "INCLUDERC=test_filter.rc"
procmail: Match on "^From:(_dot_)*majordomo(_at_)lists(_dot_)com"
procmail: Match on ! "^X-Loop: elists-approval(_at_)lists(_dot_)com"
procmail: Assigning "MATCH="
procmail: Matched "deb(_at_)lists(_dot_)com> requests that you approve the 
following:

        unsubscribe elists someone(_at_)example(_dot_)com"
procmail: Match on "^^--$$.*<\/[^>]+> requests that you approve the 
following:$$[       ]un
subscribe .*"
procmail: Forking "procmail"
procmail: [1008] Fri Nov 14 14:33:34 2003
procmail: Assigning "M=deb(_at_)lists(_dot_)com> requests that you approve the 
following:

        unsubscribe elists someone(_at_)example(_dot_)com"
procmail: Assigning "MATCH="
procmail: Matched "deb(_at_)lists(_dot_)com"
procmail: Match on "^^\/[^>]+"
procmail: Assigning "ReqAddr=deb(_at_)lists(_dot_)com"
procmail: No match on "^^[^>]+> requests that you approve the following:$[      
]+unsubscri
be \/.*"
procmail: Assigning "MATCH="
procmail: Matched "deb(_at_)lists(_dot_)com>"
procmail: Match on "^^\/[^ ]+"
procmail: Assigning "List=deb(_at_)lists(_dot_)com>"
procmail: Assigning "MATCH="
procmail: Matched "requests"
procmail: Match on "^^[^ ]+ \/[^ ]+"
procmail: Assigning "Subscriber=requests"
procmail: Assigning "LASTFOLDER=/dev/null"
procmail: Opening "/dev/null"
From MajorDomo-Owner(_at_)lists(_dot_)com  Fri Nov 14 10:51:40 2003
procmail: Executing " (formail -r -I"From: 
MajorDomo-Owner(_at_)lists(_dot_)com" \
      -I"To: $ReqAddr" \
      -A"X-Loop: elists-approval(_at_)lists(_dot_)com" ; \
      cat $AUTORESPONSE) | $SENDMAIL -t"
procmail: Assigning "LASTFOLDER= (formail -r -I"From: 
MajorDomo-Owner(_at_)lists(_dot_)com" \
      -I"To: $ReqAddr" \
      -A"X-Loop: elists-approval(_at_)lists(_dot_)com" ; \
      cat $AUTORESPONSE) | $SENDMAIL -t"
From MajorDomo-Owner(_at_)lists(_dot_)com  Fri Nov 14 10:51:40 2003
 Subject: APPROVE elists
  Folder:  (formail -r -I"From: MajorDomo-Owner(_at_)lists(_dot_)com" \       
-I"     1616
 Subject: APPROVE elists
  Folder: /dev/null                                                        1616


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