Mailing List Archive

message has lines too long for transport
Reference is made to exim-4.95.

A particular e-mail is generating that error and I am thinking perhaps it's
from a certain long header - "References:" in the thread.
See https://pastebin.ubuntu.com/p/fK5wDzzxCW/

Not sure how to mitigate this one. Maybe I should truncate/remove the
header - and possibly break the thread?


--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' :-)
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
Hi.

On Thu, Nov 18, 2021 at 11:19:59AM +0300, Odhiambo Washington via Exim-users wrote:
> A particular e-mail is generating that error and I am thinking perhaps it's
> from a certain long header - "References:" in the thread.
> See https://pastebin.ubuntu.com/p/fK5wDzzxCW/

Yes, "References:" has 1018 octets while RFC limit is 998.
This is known bug for several Outlook versions.

> Not sure how to mitigate this one. Maybe I should truncate/remove the
> header - and possibly break the thread?

Better solution is to fold this header (split over multiple lines).
--
Eugene Berdnikov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On Thu, Nov 18, 2021 at 12:32 PM Evgeniy Berdnikov via Exim-users <
exim-users@exim.org> wrote:

> Hi.
>
> On Thu, Nov 18, 2021 at 11:19:59AM +0300, Odhiambo Washington via
> Exim-users wrote:
> > A particular e-mail is generating that error and I am thinking perhaps
> it's
> > from a certain long header - "References:" in the thread.
> > See https://pastebin.ubuntu.com/p/fK5wDzzxCW/
>
> Yes, "References:" has 1018 octets while RFC limit is 998.
> This is known bug for several Outlook versions.
>
> > Not sure how to mitigate this one. Maybe I should truncate/remove the
> > header - and possibly break the thread?
>
> Better solution is to fold this header (split over multiple lines).
>


How do I achieve that with exim-4.95? Config option??



--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' :-)
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On 18/11/2021 20:36, Odhiambo Washington via Exim-users wrote:
>> Better solution is to fold this header (split over multiple lines).
>>
>
>
> How do I achieve that with exim-4.95? Config option??

There's no builtin support in Exim. In fact, not all possible lines
*can* be folded - you're only allowed to insert a line-break before
(certain specified instances of) whitespace.

You could play with ${sg} and split on *any* whitespace, once a
long-enough line had built up - but you might break something
by not recognising these special "foldable white space" cases only.


Or you could refuse such messages in the first place, and make
it the sender's problem.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On Fri, Nov 19, 2021 at 1:41 AM Jeremy Harris via Exim-users <
exim-users@exim.org> wrote:

> On 18/11/2021 20:36, Odhiambo Washington via Exim-users wrote:
> >> Better solution is to fold this header (split over multiple lines).
> >>
> >
> >
> > How do I achieve that with exim-4.95? Config option??
>
> There's no builtin support in Exim. In fact, not all possible lines
> *can* be folded - you're only allowed to insert a line-break before
> (certain specified instances of) whitespace.
>
> You could play with ${sg} and split on *any* whitespace, once a
> long-enough line had built up - but you might break something
> by not recognising these special "foldable white space" cases only.
>
>
> Or you could refuse such messages in the first place, and make
> it the sender's problem.
>
>
I have seen a discussion similar to what I am seeing with 4.95:

[exim-dev] [Bug 2622] New: bounce_return_linesize_limit not honoured for
headers (mail-archive.com)
<https://www.mail-archive.com/exim-dev@exim.org/msg12295.html>

However, I do not see a solution to it.

It would be great if such messages were rejected by default.

--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' :-)
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On Thu, Nov 18, 2021 at 11:36:53PM +0300, Odhiambo Washington via Exim-users wrote:
> On Thu, Nov 18, 2021 at 12:32 PM Evgeniy Berdnikov via Exim-users <
> exim-users@exim.org> wrote:
> > Yes, "References:" has 1018 octets while RFC limit is 998.
> > This is known bug for several Outlook versions.
> >
> > > Not sure how to mitigate this one. Maybe I should truncate/remove the
> > > header - and possibly break the thread?
> >
> > Better solution is to fold this header (split over multiple lines).
>
> How do I achieve that with exim-4.95? Config option??

There are several variants to try:

1. Use header add/remove directives in ACLs and/or routers to "reinstall"
problematic "References:" header if its length is too high, in hope
Exim would fold it correctly.
2. Use transport filters (ch.24) on delivery stage.
3. Route all incoming mails through external filter (such as Amavis),
it should reformat broken mails and re-inject them back.

I use variations of N3 with custom scripts, those configuraions are
complex and they can't be reduced to a single config option.

I have no experience with N1 and N2... Just try, it's interesting
are they working variants or not.

As ultimate solution, you can check for length of "References:" header
and remove it if length is too long. This variant should always work.
--
Eugene Berdnikov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On Fri, Nov 19, 2021 at 10:59 AM Evgeniy Berdnikov via Exim-users <
exim-users@exim.org> wrote:

> On Thu, Nov 18, 2021 at 11:36:53PM +0300, Odhiambo Washington via
> Exim-users wrote:
> > On Thu, Nov 18, 2021 at 12:32 PM Evgeniy Berdnikov via Exim-users <
> > exim-users@exim.org> wrote:
> > > Yes, "References:" has 1018 octets while RFC limit is 998.
> > > This is known bug for several Outlook versions.
> > >
> > > > Not sure how to mitigate this one. Maybe I should truncate/remove the
> > > > header - and possibly break the thread?
> > >
> > > Better solution is to fold this header (split over multiple lines).
> >
> > How do I achieve that with exim-4.95? Config option??
>
> There are several variants to try:
>
> 1. Use header add/remove directives in ACLs and/or routers to "reinstall"
> problematic "References:" header if its length is too high, in hope
> Exim would fold it correctly.
> 2. Use transport filters (ch.24) on delivery stage.
> 3. Route all incoming mails through external filter (such as Amavis),
> it should reformat broken mails and re-inject them back.
>
> I use variations of N3 with custom scripts, those configuraions are
> complex and they can't be reduced to a single config option.
>
> I have no experience with N1 and N2... Just try, it's interesting
> are they working variants or not.
>
> As ultimate solution, you can check for length of "References:" header
> and remove it if length is too long. This variant should always work.
>

Does the length check look at bytes or the number of characters?
if ${length_1000:$h_References:} .... ??

--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' :-)
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On 19/11/2021 05:58, Odhiambo Washington via Exim-users wrote:
> It would be great if such messages were rejected by default.

The template config file includes ACL to do that, since 4.88
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On 19/11/2021 13:13, Odhiambo Washington via Exim-users wrote:
> Does the length check look at bytes or the number of characters?
> if ${length_1000:$h_References:} .... ??

The documentation does say. And why not use ${strlen } ?
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
Evgeniy Berdnikov via Exim-users wrote on 19.11.2021 09:16:
>>> Yes, "References:" has 1018 octets while RFC limit is 998.
>>> This is known bug for several Outlook versions.
>>>
>>>> Not sure how to mitigate this one. Maybe I should truncate/remove the
>>>> header - and possibly break the thread?
>>>
>>> Better solution is to fold this header (split over multiple lines).
>>
>> How do I achieve that with exim-4.95? Config option??
>
> There are several variants to try:
>
> 1. Use header add/remove directives in ACLs and/or routers to "reinstall"
> problematic "References:" header if its length is too high, in hope
> Exim would fold it correctly.

Exim doesn't fold such headers correctly.


> 2. Use transport filters (ch.24) on delivery stage.

Even if the transport filters correctly fold the headers, the
max_received_linelength variable will not be recalculated and may still
be greater than message_linelength_limit.

And the error "message has lines too long for transport" will still occur.

This error will occur even if a very long header is removed.


> 3. Route all incoming mails through external filter (such as Amavis),
> it should reformat broken mails and re-inject them back.
>
> I use variations of N3 with custom scripts, those configuraions are
> complex and they can't be reduced to a single config option.
>
> I have no experience with N1 and N2... Just try, it's interesting
> are they working variants or not.
>
> As ultimate solution, you can check for length of "References:" header
> and remove it if length is too long. This variant should always work.
>


--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
JID: victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On Fri, Feb 11, 2022 at 08:48:33PM +0200, Victor Ustugov via Exim-users wrote:
> Evgeniy Berdnikov via Exim-users wrote on 19.11.2021 09:16:
...
> > There are several variants to try:
> >
> > 1. Use header add/remove directives in ACLs and/or routers to "reinstall"
> > problematic "References:" header if its length is too high, in hope
> > Exim would fold it correctly.
>
> Exim doesn't fold such headers correctly.

Yes, my experiments confirm it: add_header option in ACLs produces
a single-line header, and attempt to split it artificially by "\n" results
in stripping the tail of line (after "\n") into X-ACL-Warn: header.

IMHO, processing of add_header have better to be improved, to produce
lines up to 78 characters, as recommended by RFC.
--
Eugene Berdnikov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On 2022-02-13 at 12:48:52 UTC-0500 (Sun, 13 Feb 2022 20:48:52 +0300)
Evgeniy Berdnikov via Exim-users <bd4@protva.ru>
is rumored to have said:

> On Fri, Feb 11, 2022 at 08:48:33PM +0200, Victor Ustugov via
> Exim-users wrote:
>> Evgeniy Berdnikov via Exim-users wrote on 19.11.2021 09:16:
> ...
>>> There are several variants to try:
>>>
>>> 1. Use header add/remove directives in ACLs and/or routers to
>>> "reinstall"
>>> problematic "References:" header if its length is too high, in
>>> hope
>>> Exim would fold it correctly.
>>
>> Exim doesn't fold such headers correctly.
>
> Yes, my experiments confirm it: add_header option in ACLs produces
> a single-line header, and attempt to split it artificially by "\n"
> results
> in stripping the tail of line (after "\n") into X-ACL-Warn: header.

Proper splitting would add "\r\n " (any whitespace after the linebreak
works, and it is essential.)


--
Bill Cole
bill@scconsult.com or billcole@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On 13/02/2022 17:48, Evgeniy Berdnikov via Exim-users wrote:
> Yes, my experiments confirm it: add_header option in ACLs produces
> a single-line header, and attempt to split it artificially by "\n" results
> in stripping the tail of line (after "\n") into X-ACL-Warn: header.

That was asking to add two headers, the second with a default header name.
Not one multiline header.


The docs say:

Leading and trailing newlines are removed from the data for the add_header modifier;
if it then contains one or more newlines that are not followed by a space or a tab,
it is assumed to contain multiple header lines. Each one is checked for valid syntax;
X-ACL-Warn: is added to the front of any line that is not a valid header line.


Try it with a newline, whitespace (i.e. tab or space) sequence, to get a multiline
header.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
On Sun, Feb 13, 2022 at 06:31:23PM +0000, Jeremy Harris via Exim-users wrote:
> Try it with a newline, whitespace (i.e. tab or space) sequence, to get a multiline
> header.

This way works, yes. And may be programmed with ${sg..}, I think.

Nevertheless, I'd like to have it as default behaviour of Exim,
maybe with some global option as header_line_limit=998 (default)
and 0 as "do not touch".
--
Eugene Berdnikov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
Evgeniy Berdnikov via Exim-users wrote on 13.02.2022 21:02:
> On Sun, Feb 13, 2022 at 06:31:23PM +0000, Jeremy Harris via Exim-users wrote:
>> Try it with a newline, whitespace (i.e. tab or space) sequence, to get a multiline
>> header.
>
> This way works, yes. And may be programmed with ${sg..}, I think.

It does not matter. This will not solve the "message has lines too long
for transport" issue because the value of max_received_linelength
remains the same after removing the long header and adding the folder
header.

In other words, the value of max_received_linelength will still be
greater than the value of ob->message_linelength_limit.

To my mind, it is necessary to recalculate the value of
max_received_linelength in the smtp_transport_entry function, taking
into account acl_removed_headers and acl_added_headers.


> Nevertheless, I'd like to have it as default behaviour of Exim,
> maybe with some global option as header_line_limit=998 (default)
> and 0 as "do not touch".
>


--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
JID: victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: message has lines too long for transport [ In reply to ]
Re: message has lines too long for transport [ In reply to ]
On Tue, May 31, 2022 at 11:32 AM Gedalya <gedalya@gedalya.net> wrote:

> On 5/31/22 16:21, Odhiambo Washington via Exim-users wrote:
> > I checked https://github.com/Exim/exim/blob/master/doc/doc-txt/ChangeLog
> > and did not find it.
>
> https://github.com/Exim/exim/blob/master/doc/doc-txt/NewStuff#L48
>
>
> https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_smtp_transport.html#SECID146
>
>
Thank you.

This issue has been biting me once in a while with one Outlook user.


--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(?)_/¯ :-)
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/