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