Alan Schmitt
2014-Feb-12 13:03 UTC
[Dovecot] Filtering spam in an offlineimap + dovecot setup
Hello, To easily access my mail both offline on my computer and on my phone, I am synchronizing a local copy on my computer using offlineimap. As the spam filtering options provided on the server are not sufficient, I am now looking into client-side spam filtering. My current setup is as follows. Mail is synchronized using offlineimap, and delivered to a local dovecot server: --8<---------------cut here---------------start------------->8--- [Repository LocalIMAP] type = IMAP preauthtunnel = /usr/local/Cellar/dovecot/2.2.10/libexec/dovecot/imap -c ~/.dovecotzimbra.rc --8<---------------cut here---------------end--------------->8--- The configuration of the local server is simply: --8<---------------cut here---------------start------------->8--- protocols = imap mail_location = maildir:~/.Maildir/zimbra:INBOX=~/.Maildir/zimbra/.INBOX --8<---------------cut here---------------end--------------->8--- I then read my mail using gnus, and index it using notmuch. A suggestion I've been considering is use the pigeonhole sieve extprograms plugin (http://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/Extprograms) to call the spam filter (I've been looking at dspam at the moment). However, I could not find how to configure the use of sieves in the context of offlineimap. Hence my questions: Is it possible to use dovecot sieves in such a setting? Is there a howto that explains how to do it? Should I try to do things in a different way? (I'm ready to change my setup, as long as I can keep an offline copy of my email in sync with a server copy.) Thanks a lot for any suggestion, Alan PS: I used to use SpamSieve (http://c-command.com/spamsieve/) on a Mac Mini that was running continuously as a spam filter drone. This machine has been retired and I'm basically looking for leaner ways to do a similar thing.
Tom Hendrikx
2014-Feb-12 22:13 UTC
[Dovecot] Filtering spam in an offlineimap + dovecot setup
On 12-02-14 14:03, Alan Schmitt wrote:> Hello, > > To easily access my mail both offline on my computer and on my > phone, I am synchronizing a local copy on my computer using > offlineimap. As the spam filtering options provided on the server > are not sufficient, I am now looking into client-side spam > filtering. > > My current setup is as follows. Mail is synchronized using > offlineimap, and delivered to a local dovecot server: > > --8<---------------cut here---------------start------------->8--- > [Repository LocalIMAP] type = IMAP preauthtunnel = > /usr/local/Cellar/dovecot/2.2.10/libexec/dovecot/imap -c > ~/.dovecotzimbra.rc --8<---------------cut > here---------------end--------------->8--- > > The configuration of the local server is simply: > > --8<---------------cut here---------------start------------->8--- > protocols = imap mail_location = > maildir:~/.Maildir/zimbra:INBOX=~/.Maildir/zimbra/.INBOX > --8<---------------cut here---------------end--------------->8--- > > I then read my mail using gnus, and index it using notmuch. > > A suggestion I've been considering is use the pigeonhole sieve > extprograms plugin > (http://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/Extprograms) to > call the spam filter (I've been looking at dspam at the moment). > However, I could not find how to configure the use of sieves in the > context of offlineimap. Hence my questions: > > Is it possible to use dovecot sieves in such a setting? Is there a > howto that explains how to do it?You could simply enable sieve in the dovecot environment. The offlineimap + dovecot setup you have running already can be left mostly intact: it has nothing to do with offlineimap. You could just setup sieve per the dovecot wiki guidelines, and then create a sieve script that uses the ext_programs plugin to call dspam (or any other filter that adds headers and is able to print the message including those added headers to stdout). I'm not sure if it's necessary to do the delivery to dovecot using Dovecot's deliver LDA, or that you can keep using the '...libexec/dovecot/imap' binary for that in order to have sieve support. Maybe someone else can fill that in. Regards, Tom