zbateson / mail-mime-parser

An email parser written in PHP
https://mail-mime-parser.org/
BSD 2-Clause "Simplified" License
442 stars 56 forks source link

empty utf8 quoted not parsed correctly #160

Closed markusramsak closed 1 year ago

markusramsak commented 3 years ago

This is the simplified original version of the email. At the line beginning with "To:" there is an expression "=?utf-8?Q??=" which should simply be parsed to an empty string. Instead it keeps as it is.

Please parse =?utf-8?Q??= to an empty string.

Delivered-To: notimportant@gmail.com
Date: Thu, 10 Sep 2020 09:29:57 -0400
To: =?utf-8?Q??= <receiver@gmail.com>
From: From <from@gmail.com>
Subject: Newsletter
Message-ID: <SEMA-CR-1-1EMM4XDXI@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: Quoted-Printable
zbateson commented 3 years ago

Top of my head, this should just be a matter of changing the regex pattern for the mime-encoded part matcher to use a '*' instead of '+' for matching. If someone gets to it before me, feel free to submit a pull request.