Spamassassin: How to delete all spam messages on the server

postfixspamassassin

Can't find out, how to configure spamassassin to delete all spam messages.

Currenly it's only mark messages as spam, but pass them throught IMAP to client.

How to block them from passing through to IMAP clients?

http://spamassassin.apache.org/full/3.3.x/doc/Mail_SpamAssassin_Conf.html

And it's blocking some of our notification messages…

-1.4 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 0.0 HTML_MESSAGE           BODY: HTML included in message
 2.4 HTML_IMAGE_ONLY_08     BODY: HTML: images with 400-800 bytes of words
 2.9 TVD_SPACE_RATIO        BODY: TVD_SPACE_RATIO
 1.7 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts
 1.1 HTML_MIME_NO_HTML_TAG  HTML-only message, but there is no HTML tag
 1.1 HTML_SHORT_LINK_IMG_1  HTML is very short with a linked image
-1.4 AWL                    AWL: From: address is in the auto white-list

This is what clients getting on their mails in place of our notification messages.

Any idea how to pass those messages through and how to delete incoming spam?

Thanks 😉

I have this setup:

postfix
spamassassin
clamav-daemon
amavis

Best Answer

From the SpamAssassin FAQ on this issue:

SpamAssassin itself will not delete any emails. It's only a filter which reads email in, and passes that same email out, modified in some way. If you want to delete emails, or redirect emails, you need to do it in whatever program calls SpamAssassin.

In general it's a bad idea to delete mail marked as spam because your clients won't be able to deal with false positives. Since the deletion would happen after your server has accepted the message, the sender would also not know about it being deleted, resulting in silent mail loss.

Instead you should configure your mail system to put marked mail in a "quarantine" folder, to allow your users to go through it if necessary.

EDIT:

BTW, you really need to rearrange your notification mail. The reason SpamAssassin marks it is because it really does look like spam:

  • TVD_SPACE_RATIO - lots of whitespace, indicative of spam or non-human message generator

  • MIME_HTML_ONLY - indicator of bulk-email software

  • HTML_MIME_NO_HTML_TAG - indicator of bulk-email software

  • HTML_IMAGE_ONLY_08 - images with little text. Major indicator of spam.

Configuring your own SpamAssassin installation to let them though would not do much good, since your users' mail filters are bound to block this as well.

EDIT 2:

This link seems to contain enough information to setup a quarantine folder for spam email using Amavis.