Added on May 6th, 2013 and marked as mail server spam

When an email message is marked as spam it can be useful to know which criteria were triggered.

The following example shows exactly why the message got a spam score of 6.457:

X-Spam-Flag: YES
X-Spam-Score: 6.457
X-Spam-Level: ******
X-Spam-Status: Yes, score=6.457 tag=2 tag2=6.31 kill=6.31
  tests=[BAYES_00=-1.9, HTML_IMAGE_ONLY_24=1.618, HTML_MESSAGE=0.001,
  RDNS_DYNAMIC=0.982, T_REMOTE_IMAGE=0.01] autolearn=no
 *  1.3 RCVD_IN_RP_RNBL RBL: Relay in RNBL,
 *      [ listed in]
 *  3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL
 *      [ listed in]
 *  0.0 NO_DNS_FOR_FROM DNS: Envelope sender has no MX or A DNS records
 * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
 *      [score: 0.0000]
 *  1.6 HTML_IMAGE_ONLY_24 BODY: HTML: images with 2000-2400 bytes of words
 *  0.0 HTML_MESSAGE BODY: HTML included in message
 *  0.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts
 *  0.4 HTML_MIME_NO_HTML_TAG HTML-only message, but there is no HTML tag
 *  1.0 RDNS_DYNAMIC Delivered to internal network by host with
 *      dynamic-looking rDNS
 *  0.0 T_REMOTE_IMAGE Message contains an external image

To add this information to the headers of a message you need to edit one of the config files of amavis:

nano /etc/amavis/conf.d/50-user

and add the following lines:

# insert X-Spam-Report header field? default false
$sa_spam_report_header = 1;

Now restart amavis:

service amavis restart