diff --git a/tests/Mail/LoadEmailTest.php b/tests/Mail/LoadEmailTest.php index 4783d21584..82d4cc367b 100644 --- a/tests/Mail/LoadEmailTest.php +++ b/tests/Mail/LoadEmailTest.php @@ -59,4 +59,16 @@ public function testLoadOddMboxHeader(): void $mail = MailMessage::createFromString($raw); $this->assertTrue($mail->getHeaders()->has('X-Broken-Header-Mbox')); } + + /** + * From: "Famous bearings |;" + */ + public function testLoadInvalidName(): void + { + $raw = $this->readDataFile('110616.txt'); + $mail = MailMessage::createFromString($raw); + $headers = $mail->getHeaders(); + $this->assertEquals('"Famous bearings |;" ', $headers->get('From')->getFieldValue()); + $this->assertEquals('Famous bearings | ', $headers->get('Reply-To')->getFieldValue()); + } } diff --git a/tests/data/110616.txt b/tests/data/110616.txt new file mode 100644 index 0000000000..f1ba7db129 --- /dev/null +++ b/tests/data/110616.txt @@ -0,0 +1,32 @@ +Return-Path: +Delivered-To: eventum-imap@example.org +Received: from win2003 ([127.0.0.1]) by localhost via TCP with ESMTPA; + Tue, 02 Jul 2019 03:31:13 +0800 +MIME-Version: 1.0 +From: "Famous bearings |;" +To: support@lists.example.org +Date: 2 Jul 2019 03:31:13 +0800 +Subject: =?utf-8?B?cyBiZWFyaW5ncyAgICBFbmI=?= +Content-Type: multipart/alternative; + boundary=--boundary_118276_94ad25ae-43fa-4eb6-968c-fc87bcdcbd75 +Message-Id: <20190701193130.27DB1103194A@minni.example.org> +Reply-To: "Famous bearings |" +Sender: support-bounces@lists.example.org +Errors-To: support-bounces@lists.example.org + + +----boundary_118276_94ad25ae-43fa-4eb6-968c-fc87bcdcbd75 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: base64 + +UmljayBhbmQgbW9ydHkgcnVsZXMK + +----boundary_118276_94ad25ae-43fa-4eb6-968c-fc87bcdcbd75 +Content-Type: text/html; charset=utf-8 +Content-Transfer-Encoding: base64 + +UmljayBhbmQgbW9ydHkgcnVsZXMK + +----boundary_118276_94ad25ae-43fa-4eb6-968c-fc87bcdcbd75-- + +