2

I've got an issue with the antispam plugin using dovecot 2.1.7 and dspam 3.10.1.

I think, the antispam plugin does not recognize the Junk-Folder because the log reports

Mar 25 13:11:22 mail imap: antispam: mailbox_is_spam(Junk): 0

and after finding very few results with Google I'm quite sure, the output should be

mailbox_is_spam(Junk): 1

The dovecot antispam configuration is as follows:

protocol imap {
  mail_plugins = $mail_plugins antispam
}


plugin {
  antispam_debug_target = stdout
  antispam_verbose_debug = 1

  antispam_backend = dspam
  antispam_signature = X-DSPAM-Signature
  antispam_signature_missing = error

  antispam_trash = Trash
  antispam_spam = Junk

  antispam_dspam_binary = /usr/bin/dspam
  antispam_dspam_args = --client;--user=%u;--source=error
}

When manually moving a message to the Junk-Folder with Thunderbird this happens:

Mar 25 13:24:22 mail imap: antispam: mailbox_is_unsure(Junk): 0
Mar 25 13:24:22 mail imap: antispam: mailbox_is_trash(INBOX): 0
Mar 25 13:24:22 mail imap: antispam: mailbox_is_trash(Junk): 0
Mar 25 13:24:22 mail imap: antispam: mail copy: from trash: 0, to trash: 0
Mar 25 13:24:22 mail imap: antispam: mailbox_is_spam(INBOX): 0
Mar 25 13:24:22 mail imap: antispam: mailbox_is_spam(Junk): 0
Mar 25 13:24:22 mail imap: antispam: mailbox_is_unsure(INBOX): 0
Mar 25 13:24:22 mail imap: antispam: mail copy: src spam: 0, dst spam: 0, src unsure: 0

Mar 25 13:24:31 mail imap: antispam: plugin initialising (2.0-notgit)
Mar 25 13:24:31 mail imap: antispam: verbose debug enabled
Mar 25 13:24:31 mail imap: antispam: "Junk" is exact match spam folder
Mar 25 13:24:31 mail imap: antispam: no unsure folders
Mar 25 13:24:31 mail imap: antispam: "Trash" is exact match trash folder
Mar 25 13:24:31 mail imap: antispam: dspam binary set to /usr/bin/dspam
Mar 25 13:24:31 mail imap: antispam: dspam extra arg --client
Mar 25 13:24:31 mail imap: antispam: dspam extra arg --user=vmail
Mar 25 13:24:31 mail imap: antispam: dspam extra arg --source=error
Mar 25 13:24:31 mail imap: antispam: signature header line is "X-DSPAM-Signature"

But checking with dspam_stats does not suggest that any training is done.

Thanks for your help, Ralph

ralph
  • 123
  • 5

1 Answers1

3

Ok, my setup had two misconfigurations in it.

The first

My virtual users inboxes are located at

/var/mail/vhosts/<domain>/<username>

and not

/var/mail/vhosts/<domain>/<username>/.INBOX

The Junk-folder location is

/var/mail/vhosts/<domain>/<username>/.Junk

but (or therefor) the IMAP namespace INBOX points to

/var/mail/vhosts/<domain>/<username>/.INBOX

and my configuration has to be

antispam_spam = INBOX/Junk

The second misconfiguration is not actually related to the question, but I will post the answer anyway:

The dspam command argument is --user <username> and not --user=<username> (the equal sign is erroneous) and therefor the configuration must be:

antispam_dspam_args = --client;--source=error;--user;%u

instead of

antispam_dspam_args = --client;--user=%u;--source=error
sebix
  • 4,175
  • 2
  • 25
  • 45
ralph
  • 123
  • 5