1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

IMAP spam folder - emails missing x-spam headers

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by rjshelq, Mar 25, 2012.

  1. rjshelq

    rjshelq New Pleskian

    22
    73%
    Joined:
    Sep 17, 2007
    Messages:
    19
    Likes Received:
    0
    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?
     
  2. rjshelq

    rjshelq New Pleskian

    22
    73%
    Joined:
    Sep 17, 2007
    Messages:
    19
    Likes Received:
    0
    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]: from=order_acknowledgment@orders.apple.com
    Mar 29 06:23:09 mydomain qmail-local-handlers[12030]: to=user@mydomain.net
    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 <4838381842.9AMNSB8S518125@lvncsfrfddwx.ogvzhddfo.com> for user@mydomain.net:1990
    Mar 29 06:23:20 mydomain spamd[3203]: spamd: identified spam (11.4/5.0) for user@mydomain.net: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,user=user@mydomain.net,uid=1990,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=/tmp/spamd_full.sock,mid=<4838381842.9AMNSB8S518125@lvncsfrfddwx.ogvzhddfo.com>,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?
     
  3. nelem

    nelem New Pleskian

    12
    80%
    Joined:
    May 25, 2011
    Messages:
    7
    Likes Received:
    0
    I would like to see this too so I can understand which rules triggered an email into the spam folder.
     
  4. deepsleep

    deepsleep New Pleskian

    22
    23%
    Joined:
    Jan 19, 2009
    Messages:
    5
    Likes Received:
    0
    Same problem here. Any news regarding this fault?
     
  5. Flachzange

    Flachzange Basic Pleskian

    26
     
    Joined:
    Jul 1, 2009
    Messages:
    71
    Likes Received:
    0
    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.
     
Loading...