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:Devin Rubia (dev@thezone.net)
Date:Apr 20, 2006 7:08:02 am
List:net.sourceforge.lists.courier-maildrop

On Thu, Apr 20, 2006 at 09:47:01PM +1000, Christian Lerrahn wrote:

Hi Thorsten, I'm sorry for the delay but I didn't have time to spend on this problem till recently. Now I tried using $FROM and when it didn't work logged the contents of $FROM. This is what is in my .mailfilter.

log "$FROM" if ( $FROM == "ab@abc.org" ) { to "$VHOME/.maildir/.abc-folder" }

The problem is twofold now. What is logged, is not the sender of the email but is the user qmail/vpopmail is delivering as. Nevertheless the condition in the if statement seems to be always true and all incoming mail is delivered to .abc-folder. :-(

This is because "==" is a numerical comparitor and strings without obvious numerical values can be assumed to be equal to 0. Therefore, 0 == 0 == True. Try this instead:

if ( $FROM eq "ab@abc.org" )

Oddly enough the shell "test" command, also known as "[", uses the opposite notation ("=" for strings and "eq" for numbers)

When talking about maildrop, however, you can usually assume that perl conventions apply (especially now that maildrop uses PCRE).