12 messages in net.sourceforge.lists.courier-maildrop[maildropl] Re: Postfix - Maildrop - ...
FromSent OnAttachments
Luis PenaMay 1, 2002 8:00 pm 
Charlie WattsMay 2, 2002 6:36 am 
Luis PenaMay 3, 2002 10:48 am 
Charles J. BoeningMay 3, 2002 1:27 pm 
Luis PenaMay 3, 2002 4:00 pm 
Charles J. BoeningMay 3, 2002 4:18 pm 
Luis PenaMay 3, 2002 4:23 pm 
Marcus FringsJun 14, 2003 2:03 am 
Matthias AndreeJun 15, 2003 6:23 am 
Marcus FringsJun 20, 2003 4:26 am 
Matthias AndreeJun 21, 2003 3:07 am 
Marcus FringsJun 21, 2003 5:15 am 
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:[maildropl] Re: Postfix - Maildrop - SpamAssassinActions...
From:Marcus Frings (iam-@fuckmicrosoft.com)
Date:Jun 20, 2003 4:26:58 am
List:net.sourceforge.lists.courier-maildrop

* Matthias Andree <ma@dt.e-technik.uni-dortmund.de> wrote:

Marcus Frings <iam-@fuckmicrosoft.com> writes:

/*** begin mailfilter file ***/ import EXT import HOST import HOME MAX = 15

These import EXT, HOST and HOME from the environment (I wonder why he imports HOME though -- perhaps because maildrop resets it to the default).

Yes, the variables were already clear to me.

if ((/^X-Spam-Status: Yes, hits=![0-9]+\.[0-9]+!.*/:h && $MATCH2 > $MAX)) { exit }

I guess I will never completely understand the full syntax of regular expressions and maildrop's filter language so I hope you could help me to understand the recipe above. As far as I understand it tests the "X-Spam-Status"-line if the required hits are greater than 15 and then just exits. But why would anyone do so? And why is "((...))" used and not only "(...)"?

I don't think (( )) makes a difference. The exclamation points you see split up the regular expression -- see man maildropfilter, section "PATTERN MATCH RESULTS". Effectively, this checks if a header matching ^X-Spam-Status: Yes, hits=[0-9]+\.[0-9]+ exists, and if it does, it extracts the number after hits into $MATCH2, and then the expression checks if the number so extracted is greater than $MAX (15) -- if it does, the mail is dropped (exit).

Thanks for the detailed explanation of the regular expression, Matthias. After reading the manpage I think I have understood now what the exit directive does (at first I did not really understood why he uses `exit' because I wondered how the mail is going to be processed further).

,----[ man maildropfilter ] | The exit statement causes maildrop to terminate without delivering the | message anywhere. `----

So `exit' is just an equivalent for moving a mail to /dev/null, right?

Regards, Marcus