Exim, Apache SpamAssassin and X-Spam-Status Header

andren

Active Member
Oct 4, 2005
34
0
156
Is there any way to get the 'normal' X-Spam-Status header added to emails (new SA system).?

Cpanel does this:
Code:
X-Spam-Status:   	 No, score=4.6
However, normally it also includes info on which tests gave those score points (this is from a H-Sphere server):
Code:
X-Spam-Status:   	 No, score=1.3 required=5.0 tests=BAYES_40,HTML_MESSAGE, URIBL_JP_SURBL autolearn=ham version=3.2.4
How can this be enabled in cpanel?

The Exim config includes "X-Spam-Status: Yes, score=$spam_score" and "X-Spam-Status: No, score=$spam_score", but no info on how to include the tests that accounted for the score.

Exim & cpanel docs didn't help either.
 

akrzystek

Member
Jul 8, 2005
15
0
151
I haven't found a way to change X-Spam-Status, because all headers are written by exim, not spamassassin (cPanel newstyle spam system).

But you can use X-Spam-Report to bring more information into your headers.

1) change exim configuration (/etc/exim.conf), X-Spam-Report should be written in every, not just spam messages
- open "WHM >> Service Configuration >> Exim Configuration Editor >> Advanced Editor"
-> search for the following line and copy it to "condition add_header" block right below (next to X-Spam-Bar, as in the block above)

Code:
add_header = X-Spam-Report: $spam_report
2) edit /etc/mail/spamassassin/local.cf with your favorite editor and add the following lines:

Code:
# custom X-Spam-Report header (less blah blah, more data)
#
report_safe 0
clear_report_template
report_contact [email protected] 
report host: _HOSTNAME_ | contact: _CONTACTADDRESS_ | scores: _TESTSSCORES(,)_ | autolearn=_AUTOLEARN_, score=_AUTOLEARNSCORE_

# Set headers which may provide inappropriate cues to the Bayesian classifier
#
bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status
bayes_ignore_header X-Spam-Report
For a list of possible values have a look at Mail::SpamAssassin::Conf - SpamAssassin configuration file >> TEMPLATE TAGS

Cheers,
Thomas
 

nerrd

Registered
May 20, 2010
3
0
51
Grrr

I find it totally unacceptable that this isn't simply accessible within the end-user cPanel.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
I find it totally unacceptable that this isn't simply accessible within the end-user cPanel.
The end-user (web site owner) area in cPanel already includes a dedicated page to enable, disable, and setup relevant options for SpamAssassin in addition to toggling the Spam Box; this area can be accessed using cPanel via the following menu path:

The customization being requested in the opening post of this thread is something only the server administrator may configure because of the higher level changes required, that of customizing the Exim MTA configuration. It would be an inherent security risk to grant end-users the ability to modify system-wide mail handling simply to add custom message headers; if custom message headers are desired it is the responsibility of the server administrator to implement, which they can do so using Web Host Manager (WHM) via the following menu path:
 

nerrd

Registered
May 20, 2010
3
0
51
Re: Exim, Spamassassin and X-Spam-Status Header

CpanelDon, you miss the point by a mile: What is unacceptable, is that the end user can not enable the report headers. It is a failure of engineering that the end user is not able to access these options without the intervention of the administrator. It is your implementation, and not some inherent reality of software engineering, that requires that this be performed by the administrator.