[Dovecot] Dovecot and Bogofilter

Matthias-Christian Ott ott at mirix.org
Sun Nov 9 23:39:02 EET 2008

on my small Xen-virtualised server with 48 MiB RAM I use Postfix and
Dovecot, because the Debian administrators dislike qmail [1], which is in
my opinion despite some maintainability and code quality issues a quite
well designed software, because it mostly follows the UNIX principles.

Postfix is not able to sort my E-Mail into different Maildir folders and
after I looked at procmail's source code, I decided to use Dovecot's LDA,
because it supports sieve via a plugin.

All in all it worked after some tweaking and Dovecot is now responsible
for authentication and delivery.

Furthermore I want to setup a spam filter and due to the memory
constraints I decided in favour of bogofilter (I made no real world tests,
but the authors claim that it's fast and has a small memory footprint).

My first idea was train bogofilter via a cronjob that runs bogofilter
for each E-Mail in my spam folder and deletes them afterwards.  Then I
stumbled upon the dovecot antispam [2] plugin and quickly wrote a backend
for bogofilter. During the development I realised that bogofilter has
to update the X-Bogosity header of the reclassified E-Mails. Johannes
Berg told me that he wasn't sure whether dovecot would be able to do
this and recommended to ask this on the mailing list.

An other problem is that each mail needs to be initially classified and
due to the fact that sieve is not able to execute external programmes,
deliver has to do this task. I'm currently thinking of possibilities to
implement this, so far I came up with the following:

  1. Write a generic pipe plugin which can execute an arbitrary number of
     programmes. The problem with this is that I'm not sure how to
     integrate this is in Dovecot's configuration file. I thought of
     something like this: pipe = prg1 | prg2
  2. Write a bogofilter-specific plugin for this.

Anyhow I would like to take this opportunity to criticise Dovecot
for being a bloated (unnecessary abstractions, verbose, pseudo
object-oriented, ...), non-suckless [3] and non-unixish (plugin
architecture, monolithic design, ...) software which in return works
quite well and stable so far.

I appreciate any suggestions, ideas or criticism. I would really like
to finish configuring my mail server as soon as possible.


[1] http://smarden.org/pape/Debian/1215531259.4854_332.werc
[2] http://johannes.sipsolutions.net/Projects/dovecot-antispam
[3] http://www.suckless.org/common/

More information about the dovecot mailing list