The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Exim, Apache SpamAssassin and X-Spam-Status Header

Discussion in 'E-mail Discussions' started by andren, Jan 16, 2009.

  1. andren

    andren Active Member

    Joined:
    Oct 4, 2005
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  2. akrzystek

    akrzystek Member

    Joined:
    Jul 8, 2005
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    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 spamcontact@domain.tld 
    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
     
  3. nerrd

    nerrd Registered

    Joined:
    May 20, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Grrr

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

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    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:
     
  5. nerrd

    nerrd Registered

    Joined:
    May 20, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
Loading...

Share This Page