You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Reindl Harald <h....@thelounge.net> on 2014/08/28 11:08:36 UTC

formatting of report headers

Hi

is it somehow possible to get line-breaks in the
report headers to have them better readable?

given that "Received" and "DKIM" are coming with
more than one line and the additional ones with
a intention it should be technically possible

report_safe 0
clear_headers
add_header spam Flag _YESNO_
add_header all Status _YESNO_, score=_SCORE_/_REQD_, tests=_TESTS_, report=_REPORT_

X-Spam-Status: No, score=-101.7/5.0,
 tests=BAYES_50,CUST_DNSWL_5,HEADER_FROM_DIFFERENT_DOMAINS,USER_IN_WHITELIST
 , report= * -2.5 CUST_DNSWL_5 RBL: list.dnswl.org (High Trust) *
 [168.100.1.4 listed in list.dnswl.org] * -100 USER_IN_WHITELIST From:
 address is in the user's white-list *  0.0 HEADER_FROM_DIFFERENT_DOMAINS
 From and EnvelopeFrom 2nd level mail *      domains are different *  0.8
 BAYES_50 BODY: Bayes spam probability is 40 to 60% *      [score: 0.5000]
_______________________________________________________________________________

on the shell it looks like this

X-Spam-Status: No, score=4.3/5.0,
tests=ADVANCE_FEE_4_NEW,ADVANCE_FEE_4_NEW_MONEY,ADVANCE_FEE_5_NEW,ADVANCE_FEE_5_NEW_MONEY,ALL_TRUSTED,BAYES_99,BAYES_999,DEAR_SOMETHING,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,LOTS_OF_MONEY,T_MONEY_PERCENT,URG_BIZ,
report=
        * -2.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
        *  3.5 BAYES_99 BODY: Bayes spam probability is 99 to 100%
        *      [score: 1.0000]
        *  0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
        *      (reindl.harald[at]gmail.com)
        *  0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is
        *      CUSTOM_MED
        *  0.6 URG_BIZ BODY: Contains urgent matter
        *  2.0 DEAR_SOMETHING BODY: Contains 'Dear (something)'
        *  0.2 BAYES_999 BODY: Bayes spam probability is 99.9 to 100%
        *      [score: 1.0000]
        *  0.0 LOTS_OF_MONEY Huge... sums of money
        *  0.0 T_MONEY_PERCENT X% of a lot of money for you
        *  0.0 ADVANCE_FEE_5_NEW Appears to be advance fee fraud (Nigerian 419)
        *  0.0 ADVANCE_FEE_4_NEW Appears to be advance fee fraud (Nigerian 419)
        *  0.0 ADVANCE_FEE_4_NEW_MONEY Advance Fee fraud and lots of money
        *  0.0 ADVANCE_FEE_5_NEW_MONEY Advance Fee fraud and lots of money



Re: formatting of report headers (spamassassin)

Posted by Reindl Harald <h....@thelounge.net>.
Am 28.08.2014 um 16:55 schrieb Matus UHLAR - fantomas:
> On 28.08.14 11:08, Reindl Harald wrote:
>> is it somehow possible to get line-breaks in the
>> report headers to have them better readable?
> 
>> X-Spam-Status: No, score=-101.7/5.0,
>> tests=BAYES_50,CUST_DNSWL_5,HEADER_FROM_DIFFERENT_DOMAINS,USER_IN_WHITELIST
>> , report= * -2.5 CUST_DNSWL_5 RBL: list.dnswl.org (High Trust) *
>> [168.100.1.4 listed in list.dnswl.org] * -100 USER_IN_WHITELIST From:
>> address is in the user's white-list *  0.0 HEADER_FROM_DIFFERENT_DOMAINS
>> From and EnvelopeFrom 2nd level mail *      domains are different *  0.8
>> BAYES_50 BODY: Bayes spam probability is 40 to 60% *      [score: 0.5000]
> 
> it's apparently your MUA that re-formats those headers.
> fix the MUA, complain to authors or get other one

no it is not - see attached stored to local disk with no MUA involved

the MUA is Thunderbird, so if the headers are intented to be formatted
like below and there is no way that any config changes this i forward
that to DBMail and the gmime-reconstruction

hence the DBMail list CC'ed
_________________________________________

X-Spam-Status: No, score=4.3/5.0,
tests=ADVANCE_FEE_4_NEW,ADVANCE_FEE_4_NEW_MONEY,ADVANCE_FEE_5_NEW,ADVANCE_FEE_5_NEW_MONEY,ALL_TRUSTED,BAYES_99,BAYES_999,DEAR_SOMETHING,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,LOTS_OF_MONEY,T_MONEY_PERCENT,URG_BIZ,
report=
        * -2.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
        *  3.5 BAYES_99 BODY: Bayes spam probability is 99 to 100%
        *      [score: 1.0000]
        *  0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
        *      (reindl.harald[at]gmail.com)
        *  0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is
        *      CUSTOM_MED
        *  0.6 URG_BIZ BODY: Contains urgent matter
        *  2.0 DEAR_SOMETHING BODY: Contains 'Dear (something)'
        *  0.2 BAYES_999 BODY: Bayes spam probability is 99.9 to 100%
        *      [score: 1.0000]
        *  0.0 LOTS_OF_MONEY Huge... sums of money
        *  0.0 T_MONEY_PERCENT X% of a lot of money for you
        *  0.0 ADVANCE_FEE_5_NEW Appears to be advance fee fraud (Nigerian 419)
        *  0.0 ADVANCE_FEE_4_NEW Appears to be advance fee fraud (Nigerian 419)
        *  0.0 ADVANCE_FEE_4_NEW_MONEY Advance Fee fraud and lots of money
        *  0.0 ADVANCE_FEE_5_NEW_MONEY Advance Fee fraud and lots of money

Re: formatting of report headers

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 28.08.14 11:08, Reindl Harald wrote:
>is it somehow possible to get line-breaks in the
>report headers to have them better readable?

>X-Spam-Status: No, score=-101.7/5.0,
> tests=BAYES_50,CUST_DNSWL_5,HEADER_FROM_DIFFERENT_DOMAINS,USER_IN_WHITELIST
> , report= * -2.5 CUST_DNSWL_5 RBL: list.dnswl.org (High Trust) *
> [168.100.1.4 listed in list.dnswl.org] * -100 USER_IN_WHITELIST From:
> address is in the user's white-list *  0.0 HEADER_FROM_DIFFERENT_DOMAINS
> From and EnvelopeFrom 2nd level mail *      domains are different *  0.8
> BAYES_50 BODY: Bayes spam probability is 40 to 60% *      [score: 0.5000]

it's apparently your MUA that re-formats thhose headers.
fix the MUA, complain to authors or get other one.
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Saving Private Ryan...
Private Ryan exists. Overwrite? (Y/N)

Re: formatting of report headers

Posted by Reindl Harald <h....@thelounge.net>.
Am 28.08.2014 um 22:18 schrieb Karsten Bräckelmann:
> On Thu, 2014-08-28 at 21:43 +0200, Reindl Harald wrote:
>> Am 28.08.2014 um 19:11 schrieb Karsten Bräckelmann:
> 
>>> FWIW, SA even generates the Report header by default with your setting
>>> of report_safe 0. Not in your case, because you chose to clear_headers
>>> and manually define almost identical versions to the default headers.
>>
>> no, it don't
> 
> Yes, it does.
> 
> Read my comment again, carefully. And see the docs, option report_safe
> in the section Basic Message Tagging Options.
> 
> http://spamassassin.apache.org/doc/Mail_SpamAssassin_Conf.html

please read my comment careful again instead refer to "in your config"

in my last reply where i said "no, it don't" i removed "clear_headers"
and there was no report and default headers as below
___________________________________________

with only that header related settings the result is like below
no report included by default - period

as said: if SA includes breaks then it maybe caused by gmime on the
final destination mailserver to lose them

report_safe 0
rewrite_header Subject [SPAM]
___________________________________________

Auto-Submitted: auto-generated
MIME-Version: 1.0
X-Virus-Scanned: Yes
X-Virus-Status: Clean
X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_50,CUST_DNSBL_2,
	CUST_DNSBL_5,CUST_DNSWL_7,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,SPF_SOFTFAIL
	autolearn=disabled version=3.4.0
Return-Path: reindl.harald@gmail.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


Re: formatting of report headers

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Thu, 2014-08-28 at 21:43 +0200, Reindl Harald wrote:
> Am 28.08.2014 um 19:11 schrieb Karsten Bräckelmann:

> > FWIW, SA even generates the Report header by default with your setting
> > of report_safe 0. Not in your case, because you chose to clear_headers
> > and manually define almost identical versions to the default headers.
> 
> no, it don't

Yes, it does.

Read my comment again, carefully. And see the docs, option report_safe
in the section Basic Message Tagging Options.

  http://spamassassin.apache.org/doc/Mail_SpamAssassin_Conf.html


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: formatting of report headers

Posted by Reindl Harald <h....@thelounge.net>.
Am 28.08.2014 um 22:29 schrieb Karsten Bräckelmann:
> On Thu, 2014-08-28 at 21:43 +0200, Reindl Harald wrote:
>> Am 28.08.2014 um 19:11 schrieb Karsten Bräckelmann:
> 
>>> FWIW, SA even generates the Report header by default with your setting
>>> of report_safe 0. Not in your case, because you chose to clear_headers
>>> and manually define almost identical versions to the default headers.
> 
> More detail, in addition to my other reply.
> 
>> # header configuration
>> fold_headers 1
>> report_safe 0
> 
>  "If this option is set to 0, [...]. In addition, a header named
>   X-Spam-Report will be added to spam."  -- M::SA::Conf docs
> 
>> X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_50,CUST_DNSBL_2,
>> 	CUST_DNSBL_5,CUST_DNSWL_7,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,SPF_SOFTFAIL
>> 	autolearn=disabled version=3.4.0
> 
> Not spam, no X-Spam-Report header

now we come together and you know why i use own settings
i want that report unconditionally or switch it off unconditionally

the question was only about the missing linebreaks


Re: formatting of report headers

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Thu, 2014-08-28 at 21:43 +0200, Reindl Harald wrote:
> Am 28.08.2014 um 19:11 schrieb Karsten Bräckelmann:

> > FWIW, SA even generates the Report header by default with your setting
> > of report_safe 0. Not in your case, because you chose to clear_headers
> > and manually define almost identical versions to the default headers.

More detail, in addition to my other reply.

> # header configuration
> fold_headers 1
> report_safe 0

 "If this option is set to 0, [...]. In addition, a header named
  X-Spam-Report will be added to spam."  -- M::SA::Conf docs

> X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_50,CUST_DNSBL_2,
> 	CUST_DNSBL_5,CUST_DNSWL_7,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,SPF_SOFTFAIL
> 	autolearn=disabled version=3.4.0

Not spam, no X-Spam-Report header.


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: formatting of report headers

Posted by Reindl Harald <h....@thelounge.net>.
Am 28.08.2014 um 19:11 schrieb Karsten Bräckelmann:
> That long _TESTS_ string without line-breaks is due to the very long
> _REPORT_ in that header. If you add a dedicated Report header, the
> Status header and its list of tests will be wrapped appropriately, too.
> 
> FWIW, SA even generates the Report header by default with your setting
> of report_safe 0. Not in your case, because you chose to clear_headers
> and manually define almost identical versions to the default headers.

no, it don't - see below, anyways, i think it's a gimime problem
due reconstruct the message from DBMail

the intention of the override defaults is control that
by a webinterface (on/off) and other operators later
not need a shell login on the machine and touch configs

# header configuration
fold_headers 1
report_safe 0
rewrite_header Subject [SPAM]

Auto-Submitted: auto-generated
MIME-Version: 1.0
X-Virus-Scanned: Yes
X-Virus-Status: Clean
X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_50,CUST_DNSBL_2,
	CUST_DNSBL_5,CUST_DNSWL_7,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,SPF_SOFTFAIL
	autolearn=disabled version=3.4.0
Return-Path: reindl.harald@gmail.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


Re: formatting of report headers

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Thu, 2014-08-28 at 11:08 +0200, Reindl Harald wrote:
> is it somehow possible to get line-breaks in the
> report headers to have them better readable?

SA inserts line-breaks by default, to keep headers below 80 chars wide.


> report_safe 0
> clear_headers
> add_header spam Flag _YESNO_
> add_header all Status _YESNO_, score=_SCORE_/_REQD_, tests=_TESTS_, report=_REPORT_

> on the shell it looks like this

What you get in the shell is precisely what SA returns -- to the shell
or any other calling process. Any reformatting or re-flow of multiline
headers has been done by other tools.


> X-Spam-Status: No, score=4.3/5.0,
> tests=ADVANCE_FEE_4_NEW,ADVANCE_FEE_4_NEW_MONEY,ADVANCE_FEE_5_NEW,ADVANCE_FEE_5_NEW_MONEY,ALL_TRUSTED,BAYES_99,BAYES_999,DEAR_SOMETHING,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,LOTS_OF_MONEY,T_MONEY_PERCENT,URG_BIZ,
> report=
>         * -2.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
>         *  3.5 BAYES_99 BODY: Bayes spam probability is 99 to 100%
>         *      [score: 1.0000]

That long _TESTS_ string without line-breaks is due to the very long
_REPORT_ in that header. If you add a dedicated Report header, the
Status header and its list of tests will be wrapped appropriately, too.

FWIW, SA even generates the Report header by default with your setting
of report_safe 0. Not in your case, because you chose to clear_headers
and manually define almost identical versions to the default headers.


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}