[CentOS] Spamassassin: last step

Mon Jun 8 13:05:06 UTC 2015
Chris Adams <linux at cmadams.net>

Once upon a time, Timothy Murphy <gayleard at eircom.net> said:
> I'd like to divert it to ~/Maildir/.Spam/ 
> (where I can examine it with sa-learn).
> What is the simplest way to do this?

I do that with sieve.  Install dovecot-pigeonhole, add sieve to the
Dovecot lda/lmtp protocol list (this assumes you are using Dovecot for
local delivery), then add a sieve_before entry in the plugin section to
point to a global sieve script.  I use this one (to filter based on a
header):

    if header :contains "X-Spam-Flag" "YES" {
        fileinto "Spam";
    }

Don't forget to compile your sieve script.  Also, if you filter on a
header, you may need to double the filter (put the same thing twice) due
to a old Dovecot bug that Red Hat has not yet fixed:

https://bugzilla.redhat.com/show_bug.cgi?id=1224496

-- 
Chris Adams <linux at cmadams.net>