Correct regexp to block mails that advertise certain websites?

Denis Beauchemin Denis.Beauchemin at USherbrooke.ca
Fri Jan 11 18:34:39 GMT 2008


Remco Barendse a écrit :
> Hi list!
>
> I would like to block e-mails that always contain a certain url that 
> allows to "unsubscribe".
>
> The unsubcribe url from the e-mail is this in plain text :
> <a 
> href="http://www.ur...ethanes-technology-international.com/unsubscribe.aspx?id=31797&email=whoever@whatever.com">click 
> here to unsubscribe</a> .
>
> I tried to block this using the following regexp :
> body     URETH1 
> /^http:\/\/.*\.ur...ethanes-technology-international\.com\//
> describe URETH1          urethane rubbish
> score    URETH1          100
>
> (deliberately broke the url with some dots as my message doesn't seem 
> to make it to the list)
>
> But nothing happens, where do i go wrong?
>
> Where do i go wrong?  I would already be happy if i can block any 
> e-mail that contains urethanes-technology-international.com i am sure 
> that no legitimate e-mail will contain a link to it
>
> Thanks!!
Remco,

The main error you made was to use ^ which means to lock the pattern to 
the beginning of a new line.  I would also use "uri" instead of "body" 
to search for this kind of string.

Denis

-- 
Denis Beauchemin, analyste
Université de Sherbrooke, S.T.I.
T: 819.821.8000x62252 F: 819.821.8045




More information about the MailScanner mailing list