procmail
[Top] [All Lists]

Re: regular expression question followup 3

2002-10-05 08:16:46
Thank you for your help.
Well I have good news and bad news.

Your exercise works. Your example does find the string.
I have not seen this way of testing things, I will
add it to my bag of tricks.

By the way my gateway is version:
procmail v3.21 2001/06/29
I'm not at work to see what my sandbox is. Its older 
I think. Right now Im just using the gateway.

Hoping that the problem was solved. (although I had
 tried your synax before, but hopeing agaist hope 
that I just did something wrong)
I found a piece of spam and sent it to myself. It 
didnt find the string even though it is in it. 

On the linux box I use Pine. I think, Well lets export 
the file and see if the string is there. Maybe I made 
a mistake. When I export the mail to a text file the
 href.... string is not there. Now this may just have
 something to do with Pine exporting files. But my
 question is, Does Procmail search the text of the file eg. html code or does 
it just search what the
 user see's. I can only think that this my problem. 
When I check the original message the html code is
there. 
Frankly Im confused.
 
--

On Sat, 5 Oct 2002 14:07:17   
 Martin McCarthy wrote:
        :0 B:
        * HREF\=\"HTTP:\/\/www\.
        IN-WEB

This is completely wrong.  As I said before, there is nothing magic
about '=', '"' or '/'.
However, there *is* something magic about '\/'.  Adding those extra '\'s
breaks an OK regular expression.

THE MAIL SIMPLY CONTAINS THE FOLLOWING
Subject celeb party

body
href="http://www.

That wouldn't match at all, since there is no ':' after 'Subject'.

Try this:
create a file called test.prc that contains:

   VERBOSE=1

   :0
   * ^Subject:.*(WANNA SEE\?\?|EXTRAMARITAL|FANTASIES|PASSWORDS|FREE|WEBCAM\
          \<GIRL\>|\<CELEB\>.*PARTY|PASSWORD|\<COCK\>)
   {
          :0 B:
          * HREF="HTTP://www\.
          /dev/null
   }

   :0
   /dev/null

At a shell prompt, tell procmail to use that file to process standard
input:

   $ procmail test.prc

and type in the test mail:
Subject: celeb party

body
href="http://www.

then hit CTRL-D.

What happens?
I get the expected output:

   procmail: [28396] Sat Oct  5 13:58:06 2002
   procmail: Match on "^Subject:.*(WANNA 
SEE\?\?|EXTRAMARITAL|FANTASIES|PASSWORDS|FREE|WEBCAM\<GIRL\>|\<CELEB\>.*PARTY|PASSWORD|\<COCK\>)"
   procmail: Match on "HREF="HTTP://www\."
   ...

What do you get?  What version of procmail are you using?  What
platform?

Regards,
Martin
-- 
Martin McCarthy                 /</    http://procmail.non-prophet.org
   `Procmail Companion'        \>\
    Addison Wesley             /</                  PGP key available
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail



____________________________________________________________
Watch a championship game with Elway or McGwire.
Enter Now at http://champions.lycos.com 
_______________________________________________
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>