mat-sz / letterparser

✉️ Isomorphic e-mail parser (with MIME support) written in TypeScript.
BSD 3-Clause Clear License
36 stars 4 forks source link

Quoted-Printable not being handled in Header by LetterparserMail #14

Closed thoffmann-fms closed 9 months ago

thoffmann-fms commented 9 months ago

Given this:

          const result: LetterparserMail = extract(block.Data);
          const raw: LetterparserNode = parse(block.Data);

result.from shows

address: "jmetertester06@xxx.local"
name: "=?utf-8?Q?jmetertester06@xxx=2Elocal?="
raw: "\"=?utf-8?Q?jmetertester06@xxx=2Elocal?=\" <jmetertester06@xxx.local>"

The name is not being converted from Quoted-Printable per the Content-Transfer-Encoding image

mat-sz commented 9 months ago

@thoffmann-fms Could you post the minimal input needed to reproduce the error?

thoffmann-fms commented 9 months ago

Does this work?

Subject: =?utf-8?Q?Cancelled_Reservation_-_Automation_-_C's_Location;_Sensors;_Sensor2_-_CEDITtest?=
Sender: "=?utf-8?Q?sgmh@xxx=2Elocal?=" <sgmh@xxx.local>
From: "=?utf-8?Q?sgmh@xxx=2Elocal?=" <sgmh@xxx.local>
Date: Wed, 3 Jan 2024 14:32:57 -0500
CC: "=?utf-8?Q?test@test=2Ecom?=" <test@test.com>
To: "=?utf-8?Q?qaautomation@xxxystemsdev=2Eonmicrosoft=2Ecom?=" <qaautomation@xxxystemsdev.onmicrosoft.com>
X-Priority: 3
MIME-Version: 1.0
X-Mailer: JMail 4.5 by Dimac
Content-Type: multipart/mixed;
    boundary="--NEXT_BM_ADD76E77DDAC42499ED36625FEC5B6F6"

This is a multipart message in MIME format.
----NEXT_BM_ADD76E77DDAC42499ED36625FEC5B6F6
Content-Type: text/html;
    charset="utf-8"
Content-Transfer-Encoding: Quoted-Printable
mat-sz commented 9 months ago

@thoffmann-fms Thank you, fixed in 0.1.4.

thoffmann-fms commented 9 months ago

Thanks, I'll check it out. It may be a few days before I can fully confirm. There's some specific e-mails that generate that syntax and they only happen periodically in our test environment.