Fixing SpamAssassin Spam/Ham Reports on cPanel servers


A few months ago, cPanel released an "upgrape" that caused SpamAssassin Spam/Ham reports to include blank lines.  This is a problem because folding continuation lines cannot contain only white space, so the header is invalid.  The result is that the report or other headers may appear in the body of the email if you use an email client such as Outlook, or AVG's email scanner.  Also, the subject may not appear.

Since the two cPanel techs we dealt with, as well as a tech from our datacentre, did not know how to solve the problem, we post the workaround that we wrote here.



If you have root access to your server, the following will correct the problem for all accounts.

Add the following code to your /scripts/postupcp file, or create it with execute permissions if it doesn't exist.  If you don't have root access on your server, ask your systems administrator to do this for you.  After running upcp, the reports should be corrected.
# Fix spam/ham reports
if ! grep -q "clear_report_template" /etc/mail/spamassassin/local.cf
then
echo "
clear_report_template
report Spam detection software, running on the system _HOSTNAME_, has
report identified this incoming email as possible spam.  The original message
report has been attached to this so you can view it (if it isn't spam) or label
report similar future email.  If you have any questions, see
report _CONTACTADDRESS_ for details.
report Content preview:  _PREVIEW_
report Content analysis details:   (_SCORE_ points, _REQD_ required)
report   pts rule name              description
report  ---- ---------------------- -----------------------------------------
report _SUMMARY_
" >> /etc/mail/spamassassin/local.cf
/sbin/service exim restart
fi
If you do not have root access to your server, add the following to /home/USERNAME/.spamassassin/custom_report to correct the problem for your account only:
# Fix spam/ham reports
clear_report_template
report Spam detection software, running on the system _HOSTNAME_, has
report identified this incoming email as possible spam.  The original message
report has been attached to this so you can view it (if it isn't spam) or label
report similar future email.  If you have any questions, see
report _CONTACTADDRESS_ for details.
report Content preview:  _PREVIEW_
report Content analysis details:   (_SCORE_ points, _REQD_ required)
report   pts rule name              description
report  ---- ---------------------- -----------------------------------------
report _SUMMARY_
Then, add the following to /home/USERNAME/.spamassassin/user_prefs:
include custom_report

 
  1. DoG
    October 4th, 2016 at 17:03 | #1

    I'm in heaven. Finally i am getting email to SMS in one message!
     

If you would like a reply to your comment, you must leave your email address! We receive dozens of questions every month from people who don't leave us with any way to contact them, so we have no choice but to ignore the question. We try to reply to as many questions as we can, if we know the email address of the person who asked the question. Thanks in advance for writing in :)

Allowed HTML: <b>, <i>, <em>, <strong>. All other < and > will be replaced with &lt; and &gt;.