procmail
[Top] [All Lists]

Body $MATCH - picking variable numbers out of fixed sentence

2005-09-29 19:36:34

I'm trying to do a body match, where I'm mostly just done headers  
only in the past.

I need to match the From: header as a condition and then grab some  
fixed text from the body for $MATCH

The message comes from a known email address, with no Subject: line  
and one line of a body in this format:

555-123-4567 received a message from 123-456-7788. Call 800-888-9999  
to hear it.

All of the text is fixed except the 2nd phone number


Is this the correct recipe?

:0c
* ^From: foo(_at_)bar\(_dot_)com
{

         :0
         * B ?? 555-123-4567 received a message from \/[^ ]+
         | foo.sh "$MATCH"

         :0
         /dev/null
}

(yes I want to send $MATCH to 'foo.sh' and then ignore whatever  
happens.  I realize this is not robust.  The 'c' means that I can do  
other things after this recipe.)

TjL







____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Body $MATCH - picking variable numbers out of fixed sentence, Timothy Luoma <=