Re: [exim] Selectively add spamassassin headers to messages

Góra strony
Delete this message
Reply to this message
Autor: Jeremy Harris
Data:  
Dla: exim-users
Temat: Re: [exim] Selectively add spamassassin headers to messages
On 21/09/17 11:15, Kate Dawson wrote:
> warn
> spam = Debian-exim:true
>     add_header = X-CORP-Spam-Score: $spam_score ($spam_bar)
>     add_header = X-CORP-Spam-Report: $spam_report
>     log_message = spam score =  $spam_score

>
>
> BUT,
>
> I am seeing failures when delivering to a host using postfix and amavisd
> - who send me the helpful error message
>
>>  INVALID HEADER                                                                                                                                              

>>
>>   Improper folded header field made up entirely of whitespace (char 20
>>   hex):                                                                                
>>     X-CORP-Spam-Report: ...that system for details.\n \n
>>     Content                                                                                    
>>     previ[...]                                                                                                                                              

>>


Yup, invalid per rfc5322 section 3.2.2:

"However, where CFWS occurs in this specification, it MUST NOT
be inserted in such a way that any line of a folded header field is
made up entirely of WSP characters and nothing else."

If the SA report is liable to include empty lines, you should not use
it unedited in constructing a header to be added. Note that the Exim
docs already warn about non-ASCII content; also problematic in
headers.

>
> I would like to add a condition so that the header is NOT added when
> sending email is destined for the recipients on that host.
>
> Can I add a
>
>    hosts =  ! +no_spam_headers 


That would not do what you're wanting; "hosts" refers to the calling
host during reception of a message.
--
Cheers,
Jeremy