Hi Moritz!
I didn't notice that there is a problem with some mail servers and a
limited line length. But according to
https://datatracker.ietf.org/doc/html/rfc5322#section-2.1.1 you are
right and the body of a mail should be limited to less than 998
characters per line.
I'm not sure, whether breaking after 80 chars is a good idea, since we
use "show configuration | display set" on our JunOS systems, which
usually results in lines longer than 80 chars but less then 998.
Wouldn't it be better to use fold -w 800 or the like, which breaks
very long lines and avoids issues with Exim while not breaking earlier
than necessary, which may make some output harder than necessary to
read?
Greetings
Roland