12 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Problems with regular...
FromSent OnAttachments
Christian LerrahnMar 29, 2006 10:35 pm 
Thorsten HaudeMar 30, 2006 4:22 am 
moussMar 30, 2006 12:12 pm 
Christian LerrahnMar 30, 2006 1:54 pm 
Thorsten HaudeMar 30, 2006 4:35 pm 
Christian LerrahnApr 2, 2006 11:33 pm 
Thorsten HaudeApr 3, 2006 12:07 am 
Christian LerrahnApr 3, 2006 6:37 am 
Thorsten HaudeApr 3, 2006 12:09 pm 
Christian LerrahnApr 20, 2006 4:47 am 
Devin RubiaApr 20, 2006 7:08 am 
Sam VarshavchikApr 20, 2006 3:57 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] Problems with regular expressionsActions...
From:Christian Lerrahn (lis@penpal4u.net)
Date:Mar 30, 2006 1:54:45 pm
List:net.sourceforge.lists.courier-maildrop

On Thu, 30 Mar 2006 14:16:51 +0200 Thorsten Haude <list+mail@thorstenhau.de> wrote:

Moin,

* Christian Lerrahn wrote (2006-03-30 17:34):

Let's say I want to filter out all emails coming from ab@def.com. I tried the following.

/From:\s+.*abc@def\.com/ /From: *ab@def.com/

However, the only thing I ever got to work was something like

/From: ab@def.com/

Now the line might also be "ABC" <ab@def.com> and this doesn't match any more. From what the documentation said, everything looked to me pretty much like perl regexps but obviously this is not exactly true. How would the correct rule be written?

How about using $FROM? Maildrop already gets the "Message envelope sender" for you, so just check on that.

Hm, I don't really want to match on the envelope sender. It might be different (although it shouldn't).

Matching mail adresses is not trivial. Friedl has a regex for this in his book which is one solid page long. Others say it can't be done at all.

Why is that such a problem? It can be easily done in procmail. Why are the examples in the maildrop documentation not working? At least one of the examples I gave was from the docs.

Anyway, for the case you mention above, try /^From:.*?ab@def.com$/.

Ok, I'll try that. But why does the .* have to be greedy? In Perl you would only have to use greedy matching if there are several occurrences of what is behind that pattern. This is not the case here. And shouldn't it be /^From:.*?ab@def.com.*?$/ then? Otherwise, the ">" at the end of the address would still be a problem wouldn't it?

Cheers, Christian