[maildropl] Adding to the KEYWORDS variable one at a time
Brought to you by:
mrsam
|
From: email b. <ema...@ya...> - 2011-05-07 05:06:24
|
If I have multiple rules in a maildrop filter file that add various keywords to
the KEYWORDS variable, how do I make sure that each rule doesn't overwrite the
keywords added by previous rules? And how do I make sure that if KEYWORDS is
empty (not used previous to a given rule) I add to it without causing any
error? Is it always guaranteed to be available as an empty string?
What I'm using right now is this:
if (/^Subject: .*important/:h)
{
KEYWORDS=$KEYWORDS',$label1'
}
if (/^Subject: .*work/:h)
{
KEYWORDS=$KEYWORDS',$label2'
}
But technically, this should mean KEYWORDS has a comma on the beginning that's
not needed:
,$label1,$label2
Is that OK? Should I do something like this?
if (/^Subject: .*important/:h)
{
if ("$KEYWORDS" ne "")
{
KEYWORDS=$KEYWORDS','
}
KEYWORDS=$KEYWORDS'$label1'
}
if (/^Subject: .*work/:h)
{
if ("$KEYWORDS" ne "")
{
KEYWORDS=$KEYWORDS','
}
KEYWORDS=$KEYWORDS'$label2'
}
|