edeca.net logo
  • rss
  • Home
  • Graphics
  • Electronics
    • PCB0002 – LED matrix
  • Computing
    • ROT Util
    • MOTD maker
    • GNU screen config
    • VB6 reverse DNS
    • VB6 RichTextBox control
  • About

dspam integration with dovecot

David | March 19, 2010

In a previous message I spoke about training dspam automatically. The script I posted there works, but it’s not brilliant so I started looking for other ways of achieving spam training from the client.

Whilst looking for alternatives I found the dovecot antispam plugin which seems almost perfect. Configure a spam folder (I called mine “Junk” to integrate with Thunderbird) and it will detect when the user moves mail in or out of the folder. This automatically trains as ham or spam, depending on the direction mail is moved.

I grabbed a source tarball from the website and started there. Installing is simple:

  1. After extracting, copy defconfig to .config
  2. Edit .config to set the user and enable the backends you require
  3. Run make and then make install (as root, obviously)
  4. Edit the dovecot configuration to set plugin configuration

I chose the dspam-exec backend, but read the documentation before using it as it will spawn the dspam binary for each mail moved in.

You should ensure that the user that the dspam-antispam plugin runs as is trusted by dspam (edit /etc/dspam/dspam.conf and ensure there is a Trust <user> line) and does not violate dovecot security settings (set at compile time). On Debian, this seemed to mean running the plugin as root.

Editing the dovecot configuration includes enabling the plugin in the protocol imap section:

mail_plugins = antispam

And, for the dspam-exec plugin, configuring it like so:

# Which folder the antispam plugin monitors
antispam_spam = Junk
# Antispam trash folder
antispam_trash = trash;Trash;Deleted Items;Deleted Messages

antispam_signature = X-DSPAM-Signature
antispam_signature_missing = move

#===================
# dspam-exec plugin

# dspam binary
antispam_dspam_binary = /usr/bin/dspam

# semicolon-separated list of extra arguments to dspam
# (default unset i.e. none)
antispam_dspam_args = --deliver;--user;%u
# antispam_dspam_args = --deliver=;--user;%u  # % expansion done by dovecot
# antispam_dspam_args = --mode=teft

This seems to be the minimum to get the dspam-exec backend working. Note that configuration for other options will be different, if somebody fancies sharing a configuration that sends mail to <user>-spam@<domain> I’d be very grateful :)

Thanks to Johannes for writing this plugin.

Categories
Computing
Comments rss
Comments rss
Trackback
Trackback

« Training dspam from Thunderbird junk messages Eagle components library added »

Leave a Reply

Click here to cancel reply.

 

Categories

  • Computing
  • Electronics
  • General
  • Perl
  • Photography
  • Uncategorized

Archives

  • February 2012
  • December 2011
  • November 2011
  • July 2011
  • June 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • November 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009

Links

  • My photo gallery
  • Pookey's site

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox