jbostoen / itop-jb-mail-to-ticket-automation-v2

Originally a fork of Combodo's Mail to Ticket Automation, enriched with some new features. Also contains some bug fixes.
https://jeffreybostoen.be
6 stars 3 forks source link

MIME Encoded subjects: sometimes an unwanted space or tab? (multiline) #6

Closed jbostoen closed 2 years ago

jbostoen commented 3 years ago

Examples of email headers:

Adding unwanted spaces.

FW: ⚠ This is a test with an emoji in the subject and a long subject message which will cause multi line subjects and encoding

Subject:
 =?utf-8?B?Rlc6IOKaoCBUaGlzIGlzIGEgdGVzdCB3aXRoIGFuIGVtb2ppIGluIHRoZSBz?=
 =?utf-8?B?dWJqZWN0IGFuZCBhIGxvbmcgc3ViamVjdCBtZXNzYWdlIHdoaWNoIHdpbGwg?=
 =?utf-8?Q?cause_multi_line_subjects_and_encoding?=

FW: ⚠ Aanpassing: 'verwijderde items' in Outlook zal na 90 dagen automatisch gewist worden

Subject:
 =?utf-8?B?Rlc6IOKaoCBBYW5wYXNzaW5nOiAndmVyd2lqZGVyZGUgaXRlbXMnIGluIE91?=
 =?utf-8?Q?tlook_zal_na_90_dagen_automatisch_gewist_worden?=

Current debugging:

input:  =?utf-8?B?Rlc6IOKaoCBUaGlzIGlzIGEgdGVzdCB3aXRoIGFuIGVtb2ppIGluIHRoZSBz?= =?utf-8?B?dWJqZWN0IGFuZCBhIGxvbmcgc3ViamVjdCBtZXNzYWdlIHdoaWNoIHdpbGwg?= =?utf-8?Q?cause_multi_line_subjects_and_encoding?=
output:     FW: ⚠ This is a test with an emoji in the subject and a long subject message which will cause multi line subjects and encoding
input: =?utf-8?B?4pqgIFRoaXMgaXMgYSB0ZXN0IHdpdGggYW4gZW1vamkgaW4gdGhlIHN1Ympl?==?utf-8?B?Y3QgYW5kIGEgbG9uZyBzdWJqZWN0IG1lc3NhZ2Ugd2hpY2ggd2lsbCBjYXVz?==?utf-8?Q?e_multi_line_subjects_and_encoding?=
output: ⚠ This is a test with an emoji in the subject and a long subject message which will cause multi line subjects and encoding
jbostoen commented 2 years ago

https://github.com/jbostoen/itop-jb-mail-to-ticket-automation-v2/commit/40114dc518557cc3b408b7de6eb4e3c18b46975c