Re: [exim] cut subjects that are too long + delete emojii fr…

Top Page
Delete this message
Reply to this message
Author: Sebastian Nielsen
Date:  
To: sgf.dma
CC: exim users
Subject: Re: [exim] cut subjects that are too long + delete emojii from subject lines...
Thank you for the Point into the right direction.
Stumbled upon a new problem now:

I use:

    remove_header = subject
    add_header = Subject: ${rfc2047:${length_64:$h_subject:}}


in acl_data along with a accept rule.

Now to the problem.
It seems that it does cut the ENCODED subject into 64 characters.
According to documentation, $h_subject: should return the decoded
subject.
So the resulting subject becomes like this:
=?UTF-8?B?dGVzdGFyIMOlw6TDtiDDhcOEw5YgcsOka3Ntw7ZyZ8OlcyBSw4RLU0

Where obviously the encoded string was cut into 64 characters.

Also tried with:
    add_header = Subject: ${rfc2047:${length_64:${rfc2047d:$h_subject:}}}


but didn't work either.

Somehow it seems that the ${rfc2047:} part is executed Before
${length_64:} part. And I tried swapping them but didn't work either.
(subject got even weirder).
Den ons 28 nov. 2018 kl 11:46 skrev Dmitriy Matrosov via Exim-users
<exim-users@???>:
>
> Hi.
>
> On November 28, 2018 9:59:22 AM GMT+03:00, Sebastian Nielsen via Exim-users <exim-users@???> wrote:
> >How can I reliably cut subjects that are too long, without breaking
> >for example quoted-printable encodings and such?
>
> Decoded subject is in $h_Subject: , to reencode it you may use ${rfc2047}. We use the following for altering spam subject:
>
> headers_remove  = ${if bool{${extract {spam-tag} {$address_data}}} {Subject}}
> headers_add     = ${if bool{${extract {spam-tag} {$address_data}}} {Subject: ${rfc2047:*****SPAM***** $h_Subject:}}}

>
> It certainly breaks dkim, but some people still wants this..
>
> Also, resulting encoding won't be the same as original, but it still will be correct.
>
> >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.
> >
> >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.
> >
> >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), and emoji in email subjects are so useless so im
> >speakless...
> >
> >Any ideas?
>
> --
> ## 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/