procmail
[Top] [All Lists]

Re: problem filtering the body of a message

2000-12-06 03:14:56
Dear David,

1.  I think you need a 'c' on your second recipe, otherwise your third
will only be reached when the second fails.  Not what you want I think. 
BUT see 3 below,

2. When you test this does the script set the WEB variable as you would
expect?

3.  You could shorten the script as follows...

:0
* ^Subject:.*Contest Entry
{
         :0 c:
         contest
 
         :0 B
         * ()\/^http.*
         {
                 WEB = $MATCH
                 | echo "$WEB" >> $HOME/contest.txt
         }
 }

"David G. Warner" wrote:

Hi,

I've been working with procmail for a few days on a problem, but I haven't
been able to get it to work, and i had hoped one of you might know the
answer.  I searched through a number of online resources, but couldn't
find the solution to my problem.

Okay, here's the situation.  As part of my job, I receive some emails from
students with the subject "Contest Entry."  The body of these messages has
two lines, a name on the first line and a URL on the second.  So the
message looks something like this:

Subject: Contest Entry
David Warner
http://cec.wustl.edu/~dgw1

What I want to do is save the entire message in a folder called procmail
(which I know how to do) and parse the message body and append the URL to
a file called contest.txt in my home directory (this is the part I don't
know how to do).  I've included my most recent recent recipe for this, but
it doesn't work.  Can anyone point me in the right direction?

Thanks,
dgw

:0
* ^Subject:.*Contest Entry
{

        :0 c:
        contest

        :0 B
        * ()\/^http.*
        {
                WEB = $MATCH
        }

        :0 bwi: $HOME/contest.txt.lock
        | echo "$WEB" >> $HOME/contest.txt

}

--
 ______________________________________
|                                      |
|  DAVID G. WARNER                     |
|  CS101 Head Teaching Assistant       |
|  Washington University in St. Louis  |
|  Email: dgw1(_at_)cec(_dot_)wustl(_dot_)edu           |
|  Phone: (314) 935-0053               |
|  WWW: http://cec.wustl.edu/~dgw1/    |
|                                      |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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