Re: [exim] Message rejected due to long Reference: header

Top Page
Delete this message
Reply to this message
Author: Evgeniy Berdnikov
Date:  
To: exim-users
Subject: Re: [exim] Message rejected due to long Reference: header
Hi, Konstantin.

On Tue, Apr 16, 2019 at 03:27:57AM +0000, Konstantin Boyandin (lists) via Exim-users wrote:
> One of users complained at having their message rejected by our mail
> server (Exim 4.91), providing the below server response:
>
> "Mail delivery error. This email issue occurs because your email header
> was rejected by recipient server.
> The cause of rejection is because email reference header is more than
> 998 character. The 998 character limit is due to limitations in many
> implementations that send, receive, or store IMF messages which simply
> cannot handle more than 998 characters on a line. Receiving
> implementations would do well to handle an arbitrarily large number of
> characters in a line for robustness sake."


Probably config of your Exim contains in acl_check_data something like:

deny
condition = ${if > {$max_received_linelength}{998}}
message = Mail delivery error. This email issue occurs because...
...

If you turn it off, your Exim could receive improperly formatted mail.

> The user's emails contain:
>
> X-Mailer: Microsoft Outlook 15.0
>
> Is there any Exim setting capable of re-formatting long headers
> (i.e., split them into several lines, each below 998 character
> limit) etc such headers, but allowing the incoming mail nonetheless?


Exim has no such built-in capability (AFAIK).

As for MS Outlook, it has bugs with mail formatting from version 10.
At most cases the "References:" header is broken and contain garbage.
There is no sense to reformat it, because this garbage reflects only
memory corruption and has no valid message-ids. You have better to remove
References: header completely. Put in your config something like this:

 acl_check_data:
 ...
 warn
    set acl_m_ref_len = ${strlen:$h_references:}
    condition = ${if > {$acl_m_ref_len}{998}}
    logwrite = References header has length=$acl_m_ref_len, removed
    remove_header = references


> We have quite long "threads" in local mail archives, with really
> many References: entries, but still not exceeding 998 characters per
> line.


Mail client is responsible for keeping References: withing reasonable
number of entries and below line length limit.
--
Eugene Berdnikov