Adding X_SPAM headers to passed messages

James B. Byrne via amavis-users amavis-users at amavis.org
Tue May 13 23:17:20 CEST 2014


On Tue, May 13, 2014 16:54, Simon B wrote:
> On 13 May 2014 22:43, "James B. Byrne via amavis-users" <
> amavis-users at amavis.org> wrote:
>>
>> CentOS-6.5
>> Postfix-2.6.6
>> Amavisd-new-2.8.0
>> Spamassassin-3.3.1
>> OpenDKIM-2.9.0
>> pypolicyd-spf-1.2
>>
>> I wish to have all spam assassin test hits detailed in the headers of all
>> messages that pass through the filters.  At the moment messages flagged as
>> spam have them and messages that pass do not.  I am informed that
>> Spamassassin does not write the headers when used with amavisd-new but
>> that amavisd does. How do I accomplish what I wish with amavisd?
>>
>> Note that insofar as I can determine spamassassin is being called by
> amavisd
>> and is working for I am seeing entries showing Hits in the amavisd.log
> file:
>>
>> May 13 16:31:27 inet08.hamilton.harte-lyne.ca /usr/sbin/amavisd[32762]:
>> (32762-15) Blocked SPAM {DiscardedInbound}, [24.237.229.37]:34005
>> [24.237.229.37] <dcleve at actuate.com> -> <carter at halisp.net>, Message-ID:
>> <4672.45163a.c413 at 37-229-237-24.static.gci.net>, mail_id: 63VIyh92Bktb,
> Hits:
>> 27.553, size: 3581, 1413 ms
>>
>> I have the following settings in /etc/amavisd/amavisd.conf:
>>
>> $sa_tag_level_deflt  = -9999; # add spam info headers if at, or above
> that level
>> $sa_tag2_level_deflt = 2.5;   # add 'spam detected' headers at that level
>> $sa_kill_level_deflt = 3.5;   # triggers spam evasive actions (e.g. blocks
>> mail)
>> $sa_dsn_cutoff_level = 5.0;   # spam level beyond which a DSN is not sent
>> $sa_crediblefrom_dsn_cutoff_level = 18; # likewise, but for a likely valid
>> From
>> $sa_quarantine_cutoff_level = 20; # spam level beyond which quarantine is
> off
>> $penpals_bonus_score = 8;    # (no effect without a @storage_sql_dsn
> database)
>> $penpals_threshold_high = $sa_kill_level_deflt;  # don't waste time on hi
> spam
>> $bounce_killer_score = 100;  # spam score points to add for joe-jobbed
> bounces
>>
>> I have the following settings in /etc/mail/spamassassin/local.cf
>>
>> # Headers to show
>> add_header all DCC _DCCB_: _DCCR_
>> add_header all Level _STARS(*)_
>> add_header all Pyzor _PYZOR_
>> add_header all Report _REPORT_
>>
>> # Detail causes for spam classification - Used with BAYES_99 etc.
>> # _HAMMYTOKENS(N)_  the N most significant hammy tokens (default, 5)
>> # _SPAMMYTOKENS(N)_ the N most significant spammy tokens (default, 5)
>> report Report        _SPAMMYTOKENS(25)_
>> report Report        _HAMMYTOKENS(25)_
>>
>>
>> I desire to see all Spamassassin hits in each message, whether it passes
>> or not and regardless of the Score.  How is this done?
>
> This link
> http://blog.dmitryleskov.com/small-hacks/forcing-spamassassin-to-add-the-x-spam-status-header-to-ham-for-debugging/has
> 3 solutions - one of which I'm sure will work for you.
>
> Incidentally it was the first result from this search query...
> https://www.google.com/m?hl=en-US&ie=UTF-8&pws=0#hl=en&pws=0&q=amavisd-new+spamassassin+headers
>
> Simon
>

If you review the configuration settings I gave above you will discover that I
already have applied the suggested configuration changes and am not obtaining
the results indicated:

For example, taken verbatim from the link you helpfully provided:

> Eureka! Uncommenting and changing the first line to
>   $sa_tag_level_deflt = -9999; # always add spam info headers
> and restarting amavis
>   sudo service amavis restart
> has resulted in all messages getting the X-Spam- headers:

Well, my setting in amavisd.conf is: $sa_tag_level_deflt  = -9999;  and
amavisd has been restarted many times since that change was made.

Believe me, I have googled for this issue extensively and tried many of the
suggestions.  None of them have worked for me.  I have already gone to the SA
list in the hopes of finding an answer and found none.

We also do SPF policy checking and dkim verification before things hit amavisd
so these things should not affect what amavis does wrt headers.  I include
this information in the interest of completeness.


-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3



More information about the amavis-users mailing list