@@ -8,12 +8,48 @@ class Metadata
8
8
/** @var \Mailosaur\Models\MessageHeader[] Email headers. */
9
9
public $ headers = array ();
10
10
11
+ /**
12
+ * @var string The fully-qualified domain name or IP address that was provided with the
13
+ * Extended HELLO (EHLO) or HELLO (HELO) command. This value is generally
14
+ * used to identify the SMTP client.
15
+ * https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.1
16
+ */
17
+ public $ mailFrom ;
18
+
19
+ /**
20
+ * @var \Mailosaur\Models\MessageAddress[] The source mailbox/email address, referred to as the 'reverse-path',
21
+ * provided via the MAIL command during the SMTP transaction.
22
+ * https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.2
23
+ */
24
+ public $ rcptTo = array ();
25
+
26
+ /**
27
+ * @var string The recipient email addresses, each referred to as a 'forward-path',
28
+ * provided via the RCPT command during the SMTP transaction.
29
+ * https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.3
30
+ */
31
+ public $ ehlo ;
32
+
11
33
public function __construct (\stdClass $ data )
12
34
{
13
35
if (property_exists ($ data , 'headers ' ) && is_array ($ data ->headers )) {
14
36
foreach ($ data ->headers as $ header ) {
15
37
$ this ->headers [] = new MessageHeader ($ header );
16
38
}
17
39
}
40
+
41
+ if (property_exists ($ data , 'mailFrom ' )) {
42
+ $ this ->mailFrom = $ data ->mailFrom ;
43
+ }
44
+
45
+ if (property_exists ($ data , 'rcptTo ' ) && is_array ($ data ->rcptTo )) {
46
+ foreach ($ data ->rcptTo as $ rcptTo ) {
47
+ $ this ->rcptTo [] = new MessageAddress ($ rcptTo );
48
+ }
49
+ }
50
+
51
+ if (property_exists ($ data , 'ehlo ' )) {
52
+ $ this ->ehlo = $ data ->ehlo ;
53
+ }
18
54
}
19
55
}
0 commit comments