[Dovecot] Trouble implementing Antispam plug-in for Dovecot

Tom Hendrikx tom at whyscream.net
Thu Sep 20 01:19:07 EEST 2012


On 19/09/12 23:41, Ben Johnson wrote:
> 
> 
> On 9/11/2012 10:40 AM, Ben Johnson wrote:
>> You nailed it, Ben. Thanks!
>>
>> I downloaded/installed the dovecot-dev package from the same maintainer
>> and was able to build Antispam without issue.
>>
>> The hang-up now seems to be with my configuration.
>>
>> I'm seeing the following error in my email client whenever I attempt to
>> move an email message from, say, Inbox to Junk folder:
>>
>> [SERVERBUG] BUG Unknown internal error.
>>
>> Nothing at all appears in syslog when this happens.
>>
>> I followed the instructions at http://wiki2.dovecot.org/Plugins/Antispam
>> , to the letter, I believe.
>>
>> The relevant portions of my configuration are as follows:
>>
>> ---------------------
>> protocol imap {
>>   mail_plugins = quota imap_quota antispam
>> }
>>
>> plugin {
>>   quota = dict:user::file:/var/vmail/%d/%n/.quotausage
>>   sieve = /var/vmail/%d/%n/.sieve
>>
>>   antispam_backend = MAILTRAIN
>>   antispam_mail_sendmail = /usr/bin/sa-learn-pipe.sh
>>   antispam_mail_spam = --spam
>>   antispam_mail_notspam = --ham
>>   antispam_spam_pattern_ignorecase = spam;junk
>> }
>> ---------------------
>>
>> The permissions and execute bit are set in accordance with other
>> executables in the same directory:
>>
>> # ls -lah /usr/bin/ | grep -i "sa-learn-pipe.sh"
>> -rwxr-xr-x  1 root root     297 Sep  5 11:17 sa-learn-pipe.sh
>>
>> I would provide more log content, but the debug options seem to be gone
>> in the forked, >= 2.0 version of this plug-in.
>>
>> Any ideas are very much appreciated.
>>
>> Thanks,
>>
>> -Ben
> 
> Given that nobody shared any insight here, I decided to stand-up a
> completely new VM with Ubuntu 12.04 LTS and see if the same error occurs.
> 
> While the error is different this time around, I am still unable to get
> any variant of the dovecot-antispam plug-in working.
> 
> When I attempt to use the current packages from Ubuntu 12.04.1 LTS, and
> I use the above configuration, my syslog fills-up with the following:
> 
> dovecot: imap-login: Login: user=<user at example.com>, method=PLAIN,
> rip=10.0.1.57, lip=10.0.1.8, mpid=2879, TLS
> dovecot: master: Error: service(imap): child 2879 returned error 3
> 
> Surprisingly, I can find only two other mentions of "error 3" anywhere
> on the Internet. Those mentions were from another user to this mailing list:
> 
> http://www.dovecot.org/list/dovecot/2012-August/067787.html
> http://www.dovecot.org/list/dovecot/2012-August/067814.html
> 
> The lack of "error 3" ubiquity leads me to believe that I must be doing
> something stupid.
> 
> There's no question that this behavior is related to the
> antispam-plugin, because when I commented-out the relevant lines in
> Dovecot's configuration file, the error does not occur.
> 
> I have followed the instructions at
> http://wiki2.dovecot.org/Plugins/Antispam to the letter, and this is the
> result.
> 
> The only instance in which I diverged from the Wiki article is that I
> used the Ubuntu-provided dovecot-antispam package (instead of compiling
> the plug-in from source).
> 
> I am trying to use the "mailtrain" back-end, per the above-cited Wiki
> article, to call SpamAssassin's "sa-learn" utility for real-time learning.
> 
> I am not using the SpamAssassin daemon (spamd).
> 
> I'm about to throw in the towel on this plug-in, so any help would be
> greatly appreciated.
> 
> Thank you,
> 
> -Ben

There are 2 versions of the dovecot-antispam package. The original
version was created by Johannes Berg, then died almost a silent death,
and was forked by Eugene Paskevitch. Later Johannes revived his original
version somewhat.

The ubuntu package is based on the 'revived Johannes fork' [1], while
the documentation on the dovecot wiki describes the 'Eugene fork'. [2]

[1] https://launchpad.net/ubuntu/precise/+source/dovecot-antispam/+copyright
[2] http://wiki2.dovecot.org/Plugins/Antispam

Thus you'll need to choose which plugin you want, then follow the
complete procedure for that plugin only. They both can do what you want,
but building and configuration are slightly different.

It would be nice if Johannes and Eugene would either agree on a single
version of the plugin, or rename one of the forks so they don't get
mixed up that easily. I'm not sure if that has been discussed (on- or
off-list) in the past.

FWIW: I used the 'original Johannes fork' with dovecot 1.x, and the
'Eugene fork' with 2.0.x, both with delight. Didn't get myself to
upgrade to 2.1 yet, so no experience there.

--
Tom



More information about the dovecot mailing list