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).