Bug 6092 - Empty 'X-Spam-Level:' header
Summary: Empty 'X-Spam-Level:' header
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 3.2.5
Hardware: Other All
: P5 minor
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-02 03:07 UTC by root
Modified: 2011-11-05 21:59 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description root 2009-04-02 03:07:18 UTC
The 'X-Spam-Level:' header (as returned by spamc) is empty when the score is too low (otherwise is gets a x number of asterixes). While in the scictest sense not 'verboten', an empty header certainly is ugly. Perhaps a simple solution would be not to return the header at all when empty?
Comment 1 Karsten Bräckelmann 2009-04-02 03:32:44 UTC
It's just a default. From 10_default_prefs.cf

  add_header all Level _STARS(*)_

You are free to tweak this to your likings. See the Mail::SpamAssassin::Conf [1] documentation, section Basic Message Tagging Options. In particular, adding this custom option to your local.cf site config will do what you want:

  remove_header ham Level


Closing, unless someone feels strongly about breaking established behavior and not showing empty headers by default. This is not a bug, but a documented configura- tion option.


[1] http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Conf.html
Comment 2 root 2009-04-02 05:13:54 UTC
I know about that config option. :)

Point is/was, that I don't want the X-Spam-Level header removed altogether, but ONLY when it has nothing to show for (no asterixes). Besides, it's not the first time I've see mail (header) parsers trip over empty headers, as they're trying to split matters into neat key,value pairs.
Comment 3 Mark Martinec 2009-04-02 05:42:05 UTC
> Point is/was, that I don't want the X-Spam-Level header removed altogether,
> but ONLY when it has nothing to show for (no asterixes).

There is a difference between a header field not present (i.e. no spam checking
done) and an empty header field body (score below 1).

> Besides, it's not the first time I've see mail (header) parsers trip over
> empty headers, as they're trying to split matters into neat key,value pairs.

If they trip over such triviality, I'd rather not imagine what they
do with parsing a From header field with display names and comments,
nested comments, folding, all-whitespace lines in a header section, ...
Avoid.
Comment 4 Karsten Bräckelmann 2009-04-02 07:15:14 UTC
(In reply to comment #2)
> Point is/was, that I don't want the X-Spam-Level header removed altogether, but
> ONLY when it has nothing to show for (no asterixes).

Oops, you're right, the option in comment 1 removes that header for all ham below required_score, not below one.

Sorry, haven't had my second coffee yet.
Comment 5 Karsten Bräckelmann 2011-11-05 21:00:16 UTC
*** Bug 6692 has been marked as a duplicate of this bug. ***
Comment 6 anfi 2011-11-05 21:36:38 UTC
Reasoning behind 6692 was different and 6692 does not ask for change of behavior of already existing add_header

Sometimes I would like to get details about so me test/procedure but I would not 
like to "waste" space for empty headers e.g. 
no X-SPAM-Language when no language has been detected (e.g. image spam)
no X-Spam-AWL when no whitelisting has occured
Comment 7 Karsten Bräckelmann 2011-11-05 21:59:05 UTC
(In reply to comment #6)
> Reasoning behind 6692 was different

The reasoning in comment 3 directly applies to bug 6692 as well. There is a difference between an empty and a missing header.

> no X-SPAM-Language when no language has been detected (e.g. image spam)
> no X-Spam-AWL when no whitelisting has occured

Absence of these headers render "not identified, no action taken" and "failure" indistinguishable.

An empty Language header means, no language has been identified. A conditionally removed empty header might mean exactly that -- though also may be due to mis-configuration or a failure of the relevant plugin.

If you feel strongly about bug 6692, and believe it should be addressed regardless of the previous reasoning, feel free to re-open it. IMHO it is a dupe and basically the same as this bug, but that's my opinion and not necessarily the ultimate last word.