@@ -57,9 +57,17 @@ pub(crate) struct MimeMessage {
57
57
/// Message headers.
58
58
headers : HashMap < String , String > ,
59
59
60
- /// Addresses are normalized and lowercase
60
+ /// List of addresses from the `To` and `Cc` headers.
61
+ ///
62
+ /// Addresses are normalized and lowercase.
61
63
pub recipients : Vec < SingleInfo > ,
62
64
65
+ /// List of addresses from the `To` header.
66
+ pub to : Vec < SingleInfo > ,
67
+
68
+ /// List of addresses from the `Chat-Group-Past-Members` header.
69
+ pub past_members : Vec < SingleInfo > ,
70
+
63
71
/// `From:` address.
64
72
pub from : SingleInfo ,
65
73
@@ -232,6 +240,8 @@ impl MimeMessage {
232
240
233
241
let mut headers = Default :: default ( ) ;
234
242
let mut recipients = Default :: default ( ) ;
243
+ let mut to = Default :: default ( ) ;
244
+ let mut past_members = Default :: default ( ) ;
235
245
let mut from = Default :: default ( ) ;
236
246
let mut list_post = Default :: default ( ) ;
237
247
let mut chat_disposition_notification_to = None ;
@@ -241,6 +251,8 @@ impl MimeMessage {
241
251
context,
242
252
& mut headers,
243
253
& mut recipients,
254
+ & mut to,
255
+ & mut past_members,
244
256
& mut from,
245
257
& mut list_post,
246
258
& mut chat_disposition_notification_to,
@@ -261,6 +273,8 @@ impl MimeMessage {
261
273
context,
262
274
& mut headers,
263
275
& mut recipients,
276
+ & mut to,
277
+ & mut past_members,
264
278
& mut from,
265
279
& mut list_post,
266
280
& mut chat_disposition_notification_to,
@@ -456,6 +470,8 @@ impl MimeMessage {
456
470
context,
457
471
& mut headers,
458
472
& mut recipients,
473
+ & mut to,
474
+ & mut past_members,
459
475
& mut inner_from,
460
476
& mut list_post,
461
477
& mut chat_disposition_notification_to,
@@ -513,6 +529,8 @@ impl MimeMessage {
513
529
parts : Vec :: new ( ) ,
514
530
headers,
515
531
recipients,
532
+ to,
533
+ past_members,
516
534
list_post,
517
535
from,
518
536
from_is_signed,
@@ -1536,6 +1554,8 @@ impl MimeMessage {
1536
1554
context : & Context ,
1537
1555
headers : & mut HashMap < String , String > ,
1538
1556
recipients : & mut Vec < SingleInfo > ,
1557
+ to : & mut Vec < SingleInfo > ,
1558
+ past_members : & mut Vec < SingleInfo > ,
1539
1559
from : & mut Option < SingleInfo > ,
1540
1560
list_post : & mut Option < String > ,
1541
1561
chat_disposition_notification_to : & mut Option < SingleInfo > ,
@@ -1564,6 +1584,15 @@ impl MimeMessage {
1564
1584
if !recipients_new. is_empty ( ) {
1565
1585
* recipients = recipients_new;
1566
1586
}
1587
+ let to_addresses = get_all_addresses_from_header ( fields, "to" ) ;
1588
+ if !to_addresses. is_empty ( ) {
1589
+ * to = to_addresses;
1590
+ }
1591
+ let past_members_addresses =
1592
+ get_all_addresses_from_header ( fields, "chat-group-past-members" ) ;
1593
+ if !past_members_addresses. is_empty ( ) {
1594
+ * past_members = past_members_addresses;
1595
+ }
1567
1596
let from_new = get_from ( fields) ;
1568
1597
if from_new. is_some ( ) {
1569
1598
* from = from_new;
0 commit comments