Skip to content

Commit

Permalink
add test for AddressList parsing with semicolon in name
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jul 6, 2019
1 parent 59561e5 commit 7de6f94
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Mail/LoadEmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,16 @@ public function testLoadOddMboxHeader(): void
$mail = MailMessage::createFromString($raw);
$this->assertTrue($mail->getHeaders()->has('X-Broken-Header-Mbox'));
}

/**
* From: "Famous bearings |;" <skf@example.com>
*/
public function testLoadInvalidName(): void
{
$raw = $this->readDataFile('110616.txt');
$mail = MailMessage::createFromString($raw);
$headers = $mail->getHeaders();
$this->assertEquals('"Famous bearings |;" <skf@example.com>', $headers->get('From')->getFieldValue());
$this->assertEquals('Famous bearings | <skf@example.com>', $headers->get('Reply-To')->getFieldValue());
}
}
32 changes: 32 additions & 0 deletions tests/data/110616.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Return-Path: <support-bounces@lists.example.org>
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 |;" <skf@example.com>
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 |" <skf@example.com>
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--


0 comments on commit 7de6f94

Please sign in to comment.