On 28 Nov 2018, at 1:59, Sebastian Nielsen via Exim-users wrote:
How can I reliably cut subjects that are too long, without breaking for example quoted-printable encodings and such? Ergo, if the subject line exceeds X characters (where X characters are a limit I as system administrator decides) it should just truncate the decoded subject line, reencode it, and then send the mail along.
You should be able to use Exim's embedded Perl interpreter to do this, after writing a suitable Perl script to call. Using the MIME::Tools modules should make it pretty painless. See https://www.exim.org/exim-html-current/doc/html/spec_html/ch-systemwide_message_filtering.html#SECTaddremheasys for where to hook it in.
But, as others have said: you shouldn't.
The reason I want to do it, is because some IMAP clients do crash when it tries to export/backup email with too long subject lines as it tries to write the subject as a filename, and the operating system returns a error code the IMAP client don't understand = crash.
That's a very broken piece of software. No email client should blindly use a Subject header as a file name without sanitizing it and no software that saves files should crash just because its attempt to create a file fails. I have a hard time believing that there are actually multiple such "IMAP clients" because these basic issues are far simpler to get right than implementing IMAP.
Also I want in the same way, filter away all and any emojii (for example the truck in Ebay's "Order is now being delivered" emails) from subject lines because emojii also causes these IMAP clients im talking about to crash (because obviously emojii can't be used as filenames),
Not obvious at all. Not even true on all common systems. Emoji are just standard Unicode characters and any filesystem that can handle UTF-8 or UTF-16 in names can use emoji. What filesystem are you using that can't use emoji in filenames?
and emoji in email subjects are so useless so im speakless... Any ideas?
Get better client software? -- ## 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/
