[SERVERBUG] failed to send mail with SA and antispam plugin

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Thu Jan 15 07:30:01 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 15 Jan 2015, ML mail wrote:

It would be better to have the original question & discussion at the top, 
so one could cut and read nicely,

> On Wednesday, January 14, 2015 9:06 PM, Pascal Volk <user+dovecot at localhost.localdomain.org> wrote:
> On 01/14/2015 03:05 PM, ML mail wrote:
>
>> Hello,
>>
>> I am using the antispam plugin of Dovecot with SpamAssassin and in some cases when users move back mails from the Spam folder to their INBOX (false positive) they get the following error message:
>>
>> [SERVERBUG] failed to send mail

> # 2.1.7: /etc/dovecot/dovecot.conf
> # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.8 ext4

[cut]

> plugin {
> antispam_backend = pipe
> antispam_pipe_program = /usr/bin/spamc
> antispam_pipe_program_args = -d;my-mx-server.domain.com;-u;amavis
> antispam_pipe_program_notspam_args = -L;ham
> antispam_pipe_program_spam_args = -L;spam
> antispam_pipe_tmpdir = /tmp
> antispam_signature = X-Spam-Flag
> antispam_signature_missing = error
> antispam_spam = INBOX.Spam;INBOX.Junk
> antispam_trash = INBOX.trash;trash;INBOX.Trash;Trash;INBOX.Deleted Items;Deleted Items;INBOX.Deleted Messages;Deleted Messages
> antispam_verbose_debug = 1

What does the Plugin log?

[cut]
> service quota-warning {
> executable = script /usr/local/bin/quota-warning.sh
> unix_listener quota-warning {
> user = vmail
> }
> user = vmail
> }

You seem to use a virtual user configuration, so the antispam plugin 
executes spamc as user vmail, correct?

What happens if you run the program manually?
sudo -u vmail /usr/bin/spamc -d my-mx-server.domain.com -u amavis -L ham \ 
< message

You can also trace the program with a wrapper script. Replace 
antispam_pipe_program with /usr/local/bin/spamc-wrapper

==== BEGIN /usr/local/bin/spamc-wrapper
#/bin/bash

( # when and who
  date;id;
  let i=0
  # what
  echo /usr/bin/spamc "$@"
  # see embedded spaces in arguments
  for arg; do
   let i=i+1
   echo "Arg#$i: '$arg'"
  done
  # call original program
  /usr/bin/spamc "$@"
  # log return code / exit code
  rc=$?
  echo rc=$rc
  # Make sure the rc is returned back to caller
  exit $rc

  # log everything into a file
) >>/tmp/spamc-wrapper.log 2>&1
==== END

If you have lots of simultaneous calls, create one log file per call -> 
add .$$ to filename.

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEVAwUBVLdsenz1H7kL/d9rAQI5wQf/R/8IIWAgcLX8061FBI5gFxEH8jP8UVMb
MoSkkRT88teQJYuDxjr8zA92MX/2HDruRstzwxgJ1WxPefOvETpzGs1wrFqtWABM
2qB/ENfmkyOgmvpfsX5j6armYgOGEK0j5lf/ulV2i110wAJqjWY+9hBekFs7g4Th
j29D42kv5Tl0XVwJbbYfzH/gUB+kyLxV7ja3dWWmmRRNV9am4Du36zua5AB2BzYq
kuSqXfxClbnRYA/Ajy8H1KYhmx8wRtjkNijxt8B7R5f04E8hLrFVd5lKZIieuO6e
oNu45xHeW3mYas0I3jWBf0u5pt1XlP7RLOtdB3D15CsW42PPsDcKxw==
=Beji
-----END PGP SIGNATURE-----


More information about the dovecot mailing list