File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
26
26
- Check if the next uid is available (after copying or moving a message) before fetching it #381
27
27
- Default pagination ` $total ` attribute value set to 0 #385 (thanks @hhniao )
28
28
- Use attachment ID as fallback filename for saving an attachment
29
+ - Address decoding error detection added #388
29
30
30
31
### Added
31
32
- Extended UTF-7 support added (RFC2060) #383
Original file line number Diff line number Diff line change @@ -583,6 +583,13 @@ private function parseAddresses($list): array {
583
583
}
584
584
}
585
585
586
+ if ($ address ->host == ".SYNTAX-ERROR. " ) {
587
+ $ address ->host = "" ;
588
+ }
589
+ if ($ address ->mailbox == "UNEXPECTED_DATA_AFTER_ADDRESS " ) {
590
+ $ address ->mailbox = "" ;
591
+ }
592
+
586
593
$ address ->mail = ($ address ->mailbox && $ address ->host ) ? $ address ->mailbox . '@ ' . $ address ->host : false ;
587
594
$ address ->full = ($ address ->personal ) ? $ address ->personal . ' < ' . $ address ->mail . '> ' : $ address ->mail ;
588
595
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /*
3
+ * File: UndisclosedRecipientsTest.php
4
+ * Category: -
5
+ * Author: M.Goldenbaum
6
+ * Created: 09.03.23 02:24
7
+ * Updated: -
8
+ *
9
+ * Description:
10
+ * -
11
+ */
12
+
13
+ namespace Tests \fixtures ;
14
+
15
+ /**
16
+ * Class UndisclosedRecipientsTest
17
+ *
18
+ * @package Tests\fixtures
19
+ */
20
+ class UndisclosedRecipientsTest extends FixtureTestCase {
21
+
22
+ /**
23
+ * Test the fixture undisclosed_recipients.eml
24
+ *
25
+ * @return void
26
+ */
27
+ public function testFixture () : void {
28
+ $ message = $ this ->getFixture ("undisclosed_recipients.eml " );
29
+
30
+ self ::assertEquals ("test " , $ message ->subject );
31
+ self ::assertEquals ("Hi! " , $ message ->getTextBody ());
32
+ self ::assertFalse ($ message ->hasHTMLBody ());
33
+ self ::assertEquals ("2017-09-27 10:48:51 " , $ message ->date ->first ()->setTimezone ('UTC ' )->format ("Y-m-d H:i:s " ));
34
+ self ::
assertEquals (
"[email protected] " ,
$ message->
from );
35
+ self ::assertEquals ([
36
+ "Undisclosed Recipients " ,
37
+ ""
38
+ ], $ message ->to ->map (function ($ item ) {
39
+ return $ item ->mailbox ;
40
+ }));
41
+ }
42
+ }
Original file line number Diff line number Diff line change
1
+ Subject : test
2
+ MIME-Version : 1.0
3
+ Content-Type : text/plain
4
+ Date : Wed, 27 Sep 2017 12:48:51 +0200
5
+
6
+ To : "Undisclosed Recipients" <>
7
+
8
+ Hi!
You can’t perform that action at this time.
0 commit comments