[Dovecot] [OT] my anti-spam integration (was: Re: How to integrate dspam and dovecot)

Johannes Berg johannes at sipsolutions.net
Tue Apr 3 11:39:35 EEST 2007


On Tue, 2007-04-03 at 13:38 +0530, Manilal K M wrote:

> Basically my primary objective is to prevent spam and today i got an
> interesting link to it:
> http://searchenterpriselinux.techtarget.com/tip/0%2C289483%2Csid39_gci1235770%2C00.html
> 
> and
> http://www.oreillynet.com/pub/a/sysadmin/2005/09/15/qpsmtpd.html

Nothing stops you from using that together with dspam to filter
everything it let through.

Here's my setup:

In my exim, during SMTP, I check what dspam thinks about the email (if
it's directed to a single user and that user has opted in to this
service.) Then, if the spamminess of the email is higher than that
user's threshold, I fake-reject the email with a message like:

  Your email was determined to be spam. Send email to <secret>@<domain>
  if that wasn't true.

Since it's fake-reject the email body is stilled used, I store it in a
database for later.

Then, the mail gets delivered to maildrop for each user, which is
globally configured to run dspam if it hasn't been run in the smtp
session already. Then, depending on the dspam verdict Spam/Innocent, the
mail is sorted into either the SPAM folder or handed to the users
filters.

Now the dovecot plugin comes into play. When a user determines that a
mail was sorted wrongly, it simply retrains dspam by moving the message
into or out of the SPAM folder. This is the great thing about the dspam
plugin here.

Mail that has been fake-rejected above is cleaned from the database
every 2 weeks or so by a cronjob. If mail is sent to <secret>@<domain>,
then that email is rejected with a message saying:

  Your previous email has been released and delivered to the original
  recipient.

Where exactly that happens, and dspam is also trained with that message.

Of course, dovecot is only involved in a tiny step here... dovecot/dspam
integration requires my plugin for dovecot, exim/dspam integration is
done via that fake spamassassin server for dspam that's also available
on my homepage.

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070403/12aa1f2f/attachment.pgp 


More information about the dovecot mailing list