procmail
[Top] [All Lists]

Re: Need help from the procmail rule gods. (simplified)

2002-11-22 10:58:40
For those following along here's what I ended up with.

god it's nasty.

I still don't understand why it was matching that inner rule when the filter completed successfully. ie. exit status 0 but stdout had output. So currently I have to rely on X-Challenge-Reason I was hoping I wouldn't have to do that.

:0 Wf:$HOME/filtmail.lock
| $HOME/.filtmail/filtmail

# mail that filtmail decided was not spam because of non zero exit status

:0e
{
:0hf
* ^^rom( )
| sed '1s/^rom/From/'

:0
* ^TOann(_at_)elastica(_dot_)com
* !^X-Challenge-Reason
$ANNDEFAULT

:0
* ^TOrobert(_at_)elastica(_dot_)com
* !^X-Challenge-Reason
$DEFAULT
}

:0fw
* < 25600
* !^Subject:.*4321
| $SPAMASSASSIN

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped. This will re-add it.
:0 H
* ! ^From[ ]
* ^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "

:0 fhw
| sed '1s/^^rom/From/'
}

#if it's spam file it as such.

:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
{
:0
* ^TOann(_at_)elastica(_dot_)com
$ANNSMAILDIR/copy

:0
$MAILDIR/copy
}

:0
* ^X-Spam-Status: Yes
{
:0
* ^TOann(_at_)elastica(_dot_)com
$ANNSMAILDIR/copy

:0
$MAILDIR/copy
}

# this catches mail that spam assassin decided wasn't spam but
# filtmail did.

:0
* ^X-Challenge-Reason
{
:0
* ^TOann(_at_)elastica(_dot_)com
$ANNSMAILDIR/copy

# catch all other users
:0
$MAILDIR/copy
}

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped. This will re-add it.
:0 H
* ! ^From[ ]
* ^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "

:0 fhw
| sed '1s/^^rom/From/'
}