• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

IMAP spam folder - emails missing x-spam headers

rjshelq

New Pleskian
With Plesk 10.4.4 using Spamassassin set for server-wide spam rejection, all imap emails in the subscriber's "normal" inbox properly include the x-spam headers and report which were specified in /etc/mail/spamassassin/local.cf, but any emails arriving in the imap spam mailbox have no x-spam headers, and no spamassassin report.

If I switch to pop, rather than imap, the desired x-spam headers and report are present in all emails. The x-spam headers and reports only seem to be missing when the mail has been routed to the imap spam mailbox.

The x-spam headers and reports are very useful for tweaking spamassassin.

How can the x-spam headers and report be restored for the emails which have been put in the imap spam mailbox?
 
Missing X-Spam headers in IMAP spam folder

Here are some more details about this problem. My system has Plesk 10.4.4 with mu#20, Centos 5.8, Spamassassin 3.3.1, perl 5.8.8. The system is set for server-wide Spamassassin usage.

The Spamassassin config file at /etc/mail/spamassassin/local.cf asks for header rewrite, and asks for x-spam headers to be added:


rewrite_header subject *****SPAM******_SCORE_
required_score 5.00
trusted_networks xx.xxx.xxx.xx
dcc_home /etc/dcc
razor_config /etc/mail/spamassassin/.razor/razor-agent.conf
pyzor_options --homedir /etc/mail/spamassassin/.pyzor
skip_rbl_checks 0
use_razor2 1
use_dcc 1
use_pyzor 1
use_bayes 0
bayes_auto_learn 1
ok_languages en
ok_locales en
score RCVD_IN_RP_CERTIFIED -0.1
score UNWANTED_LANGUAGE_BODY 5
add_header all DCC _DCCB_: _DCCR_
add_header all Pyzor _PYZOR_
add_header all RBL _RBL_
add_header all Report _REPORT_




All non-spam emails do indeed have the expected Spamassassin headers, which look like this:

X-Spam-Status: No, score=4.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HTML_IMAGE_ONLY_24,HTML_MESSAGE,MISSING_HEADERS,
RCVD_IN_DNSWL_NONE,REPLYTO_WITHOUT_TO_CC,SPF_PASS autolearn=disabled
version=3.3.1
X-Spam-Virus: No
X-Spam-DCC: x.dcc-servers: mydomain.net 104; Body=1 Fuz1=1 Fuz2=1
X-Spam-Pyzor: Reported 0 times.
X-Spam-RBL: <dns:69.89.86.209.list.dnswl.org> [127.0.5.0]
X-Spam-Report:
* -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no
* trust
* [209.86.89.69 listed in list.dnswl.org]
* -0.0 SPF_PASS SPF: sender matches SPF record
* 1.2 MISSING_HEADERS Missing To: header
* 1.3 HTML_IMAGE_ONLY_24 BODY: HTML: images with 2000-2400 bytes of words
* 0.0 HTML_MESSAGE BODY: HTML included in message
* -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
* domain
* -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
* 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
* valid
* 1.9 REPLYTO_WITHOUT_TO_CC REPLYTO_WITHOUT_TO_CC


However, all emails arriving in the imap spam folder have no x-spam headers whatsoever.

Here is a sample from the mail log /usr/local/psa/var/log/maillog for a spam message:

Mar 29 06:23:09 mydomain qmail-local-handlers[12030]: Handlers Filter before-local for qmail started ...
Mar 29 06:23:09 mydomain qmail-local-handlers[12030]: [email protected]
Mar 29 06:23:09 mydomain qmail-local-handlers[12030]: [email protected]
Mar 29 06:23:09 mydomain qmail-local-handlers[12030]: mailbox: /var/qmail/mailnames/mydomain.net/eser
Mar 29 06:23:09 mydomain spamd[3203]: spamd: got connection over /tmp/spamd_full.sock
Mar 29 06:23:09 mydomain spamd[3203]: spamd: processing message <[email protected]> for [email protected]:1990
Mar 29 06:23:20 mydomain spamd[3203]: spamd: identified spam (11.4/5.0) for [email protected]:1990 in 10.8 seconds, 1473 bytes.
Mar 29 06:23:20 mydomain spamd[3203]: spamd: result: Y 11 - DCC_CHECK,HTML_MESSAGE,KB_DATE_CONTAINS_TAB,KB_FAKED_THE_BAT,LOTS_OF_MONEY,MIME_HTML_ONLY,RDNS_NONE,SPF_NEUTRAL,TAB_IN_FROM scantime=10.8,size=1473,[email protected],uid=1990,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=/tmp/spamd_full.sock,mid=<[email protected]>,autolearn=disabled
Mar 29 06:23:20 mydomain qmail-local-handlers[12030]: handlers_stderr: STOP
Mar 29 06:23:20 mydomain qmail-local-handlers[12030]: STOP during call 'spam' handler
Mar 29 06:23:20 mydomain qmail: 1333027400.466438 delivery 6232: success:
Mar 29 06:23:20 mydomain qmail: 1333027400.466530 status: local 0/10 remote 0/40
Mar 29 06:23:20 mydomain qmail: 1333027400.466580 end msg 47056504

Clearly, there is a score given for each Spam message, but somehow it appears that once a message has been identified as spam ( spamd: identified spam, spamd: result: Y ), then Plesk simply puts the original message into the imap spam folder, instead of using the processed message which includes the Spamassassin headers.

This seems to be a Plesk handler bug. Is there a fix?
 
I would like to see this too so I can understand which rules triggered an email into the spam folder.
 
I don't think it's a bug but rather a feature. Check if you have enabled individual spam filter settings for your mail account. There you can enable "Move spam to Spam folder" which results in the behavior you've described.
 
Back
Top