7 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Getting lookup() to work
FromSent OnAttachments
Ron JohnsonApr 1, 2006 8:39 pm 
moussApr 2, 2006 4:31 am 
Ron JohnsonApr 2, 2006 6:37 pm 
moussApr 3, 2006 9:33 am 
Ron JohnsonApr 3, 2006 10:00 am 
moussApr 3, 2006 11:58 am 
Ron JohnsonApr 3, 2006 2:21 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] Getting lookup() to workActions...
From:mouss (mou@netoyen.net)
Date:Apr 3, 2006 11:58:45 am
List:net.sourceforge.lists.courier-maildrop

Ron Johnson wrote:

On Mon, 2006-04-03 at 18:34 +0200, mouss wrote:

Ron Johnson wrote:

On Sun, 2006-04-02 at 12:33 +0200, mouss wrote:

Ron Johnson wrote:

if ( /To:.*/ ) && ( lookup($sender, $killfile) )

check the 'if' syntax (parens missing above).

if (/To:.*/ && lookup($sender, $killfile))

Thanks. This doesn't throw syntax errors anymore: import USER killfile = "$HOME/killfile"; sender = getaddr($FROM) log "Sender is |$sender|" log "killfile is $killfile" if ( ( /From:.*/ ) && ( lookup($sender, $killfile) ) )

last time it was a To:.* instead of a From:.*. In both cases this is

Yeah. the "To: " field will never have names from my killfile in it...

whatever header you use, the expression is useless. if ((/FOO:.*/ && lookup(whatever, file)) is the same as: if the header FOO exists and if whatever is found file... so FOO test is useless.

you may be looking for /FOO: (.*)/ FOO8VALUE=$MATCH1 if (lookup($FOO_VALUE, $file)) ....

useless, because almost all mail have a From and a To header.

are you after a if ($FROM, $somefile)

Did you forget a function name?

of course. lookup is missing there. To summarise, you may want something like:

killfile = "$HOME/killfile"; sender = getaddr($FROM) log "Sender is |$sender|" log "killfile is $killfile" if (lookup($sender, $killfile)) { .... }

by default, FROM is the envelope sender. if this is not available, maildrop will
try some other things. If you really want the From header, do:

HFROM = getaddr /^From:/ if (lookup($HFROM, $killfile)) ...