diff --git a/README.md b/README.md index 9a6bede..6a2fd3c 100644 --- a/README.md +++ b/README.md @@ -79,16 +79,16 @@ R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 // Parses addresses (including comments), lists and groups assert_eq!( - message.from(), - &HeaderValue::Address(Addr::new( + message.from().unwrap().first().unwrap(), + &Addr::new( "Art Vandelay (Vandelay Industries)".into(), "art@vandelay.com" - )) + ) ); assert_eq!( - message.to(), - &HeaderValue::GroupList(vec![ + message.to().unwrap().as_group().unwrap(), + &[ Group::new( "Colleagues", vec![Addr::new("James Smythe".into(), "james@vandelay.com")] @@ -100,7 +100,7 @@ R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 Addr::new("John Smîth".into(), "john@example.com"), ] ) - ]) + ] ); assert_eq!( diff --git a/examples/message_parse.rs b/examples/message_parse.rs index 4f015af..bddd54a 100644 --- a/examples/message_parse.rs +++ b/examples/message_parse.rs @@ -57,16 +57,16 @@ R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 // Parses addresses (including comments), lists and groups assert_eq!( - message.from(), - &HeaderValue::Address(Addr::new( + message.from().unwrap().first().unwrap(), + &Addr::new( "Art Vandelay (Vandelay Industries)".into(), "art@vandelay.com" - )) + ) ); assert_eq!( - message.to(), - &HeaderValue::GroupList(vec![ + message.to().unwrap().as_group().unwrap(), + &[ Group::new( "Colleagues", vec![Addr::new("James Smythe".into(), "james@vandelay.com")] @@ -78,7 +78,7 @@ R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 Addr::new("John Smîth".into(), "john@example.com"), ] ) - ]) + ] ); assert_eq!( diff --git a/resources/address.json b/resources/address.json index 1c5749c..8ee5d6c 100644 --- a/resources/address.json +++ b/resources/address.json @@ -2,34 +2,40 @@ { "header": "John Doe \n", "expected": { - "Address": { - "name": "John Doe", - "address": "jdoe@machine.example" - } + "List": [ + { + "name": "John Doe", + "address": "jdoe@machine.example" + } + ] } }, { "header": " Mary Smith \n", "expected": { - "Address": { - "name": "Mary Smith", - "address": "mary@example.net" - } + "List": [ + { + "name": "Mary Smith", + "address": "mary@example.net" + } + ] } }, { "header": "\"Joe Q. Public\" \n", "expected": { - "Address": { - "name": "Joe Q. Public", - "address": "john.q.public@example.com" - } + "List": [ + { + "name": "Joe Q. Public", + "address": "john.q.public@example.com" + } + ] } }, { "header": "Mary Smith , jdoe@example.org, Who? \n", "expected": { - "AddressList": [ + "List": [ { "name": "Mary Smith", "address": "mary@x.test" @@ -48,7 +54,7 @@ { "header": ", \"Giant; \\\"Big\\\" Box\" \n", "expected": { - "AddressList": [ + "List": [ { "name": null, "address": "boss@nil.test" @@ -63,65 +69,75 @@ { "header": "A Group:Ed Jones ,joe@where.test,John ;\n", "expected": { - "Group": { - "name": "A Group", - "addresses": [ - { - "name": "Ed Jones", - "address": "c@a.test" - }, - { - "name": null, - "address": "joe@where.test" - }, - { - "name": "John", - "address": "jdoe@one.test" - } - ] - } + "Group": [ + { + "name": "A Group", + "addresses": [ + { + "name": "Ed Jones", + "address": "c@a.test" + }, + { + "name": null, + "address": "joe@where.test" + }, + { + "name": "John", + "address": "jdoe@one.test" + } + ] + } + ] } }, { "header": "Undisclosed recipients:;\n", "expected": { - "Group": { - "name": "Undisclosed recipients", - "addresses": [] - } + "Group": [ + { + "name": "Undisclosed recipients", + "addresses": [] + } + ] } }, { "header": "\"Mary Smith: Personal Account\" \n", "expected": { - "Address": { - "name": "Mary Smith: Personal Account", - "address": "smith@home.example" - } + "List": [ + { + "name": "Mary Smith: Personal Account", + "address": "smith@home.example" + } + ] } }, { "header": "Pete(A nice \\) chap) \n", "expected": { - "Address": { - "name": "Pete (A nice ) chap his account his host)", - "address": "pete@silly.test" - } + "List": [ + { + "name": "Pete (A nice ) chap his account his host)", + "address": "pete@silly.test" + } + ] } }, { "header": "Pete(A nice \n \\\n ) chap) \n", "expected": { - "Address": { - "name": "Pete (A nice ) chap his account his host)", - "address": "pete@silly.test" - } + "List": [ + { + "name": "Pete (A nice ) chap his account his host)", + "address": "pete@silly.test" + } + ] } }, { "header": "A Group(Some people)\n :Chris Jones ,\n joe@example.org,\n John (my dear friend); (the end of the group)\n", "expected": { - "GroupList": [ + "Group": [ { "name": "A Group (Some people)", "addresses": [ @@ -154,30 +170,34 @@ { "header": "(Empty list)(start)Hidden recipients :(nobody(that I know)) ;\n", "expected": { - "Group": { - "name": "Hidden recipients (Empty list start)", - "addresses": [ - { - "name": "nobody(that I know)", - "address": null - } - ] - } + "Group": [ + { + "name": "Hidden recipients (Empty list start)", + "addresses": [ + { + "name": "nobody(that I know)", + "address": null + } + ] + } + ] } }, { "header": "Joe Q. Public \n", "expected": { - "Address": { - "name": "Joe Q. Public", - "address": "john.q.public@example.com" - } + "List": [ + { + "name": "Joe Q. Public", + "address": "john.q.public@example.com" + } + ] } }, { "header": "Mary Smith <@node.test:mary@example.net>, , jdoe@test . example\n", "expected": { - "AddressList": [ + "List": [ { "name": "Mary Smith", "address": "@node.test:mary@example.net" @@ -192,70 +212,84 @@ { "header": "John Doe \n", "expected": { - "Address": { - "name": "John Doe (comment)", - "address": "jdoe@machine. example" - } + "List": [ + { + "name": "John Doe (comment)", + "address": "jdoe@machine. example" + } + ] } }, { "header": "Mary Smith\n \n\t\n", "expected": { - "Address": { - "name": "Mary Smith", - "address": "mary@example.net" - } + "List": [ + { + "name": "Mary Smith", + "address": "mary@example.net" + } + ] } }, { "header": "=?US-ASCII*EN?Q?Keith_Moore?= \n", "expected": { - "Address": { - "name": "Keith Moore", - "address": "moore@cs.utk.edu" - } + "List": [ + { + "name": "Keith Moore", + "address": "moore@cs.utk.edu" + } + ] } }, { "header": "John =?US-ASCII*EN?Q?Doe?= \n", "expected": { - "Address": { - "name": "John Doe", - "address": "moore@cs.utk.edu" - } + "List": [ + { + "name": "John Doe", + "address": "moore@cs.utk.edu" + } + ] } }, { "header": "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= \n", "expected": { - "Address": { - "name": "Keld Jørn Simonsen", - "address": "keld@dkuug.dk" - } + "List": [ + { + "name": "Keld Jørn Simonsen", + "address": "keld@dkuug.dk" + } + ] } }, { "header": "=?ISO-8859-1?Q?Andr=E9?= Pirard \n", "expected": { - "Address": { - "name": "André Pirard", - "address": "PIRARD@vm1.ulg.ac.be" - } + "List": [ + { + "name": "André Pirard", + "address": "PIRARD@vm1.ulg.ac.be" + } + ] } }, { "header": "=?ISO-8859-1?Q?Olle_J=E4rnefors?= \n", "expected": { - "Address": { - "name": "Olle Järnefors", - "address": "ojarnef@admin.kth.se" - } + "List": [ + { + "name": "Olle Järnefors", + "address": "ojarnef@admin.kth.se" + } + ] } }, { "header": "ietf-822@dimacs.rutgers.edu, ojarnef@admin.kth.se\n", "expected": { - "AddressList": [ + "List": [ { "name": null, "address": "ietf-822@dimacs.rutgers.edu" @@ -270,16 +304,18 @@ { "header": "Nathaniel Borenstein \n (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)\n", "expected": { - "Address": { - "name": "Nathaniel Borenstein (םולש ןב ילטפנ)", - "address": "nsb@thumper.bellcore.com" - } + "List": [ + { + "name": "Nathaniel Borenstein (םולש ןב ילטפנ)", + "address": "nsb@thumper.bellcore.com" + } + ] } }, { "header": "Greg Vaudreuil , Ned Freed\n , Keith Moore \n", "expected": { - "AddressList": [ + "List": [ { "name": "Greg Vaudreuil", "address": "gvaudre@NRI.Reston.VA.US" @@ -298,88 +334,106 @@ { "header": "=?ISO-8859-1?Q?a?= \n", "expected": { - "Address": { - "name": "a", - "address": "test@test.com" - } + "List": [ + { + "name": "a", + "address": "test@test.com" + } + ] } }, { "header": "\"=?ISO-8859-1?Q?a?= b\" \n", "expected": { - "Address": { - "name": "a b", - "address": "test@test.com" - } + "List": [ + { + "name": "a b", + "address": "test@test.com" + } + ] } }, { "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?= \n", "expected": { - "Address": { - "name": "ab", - "address": "test@test.com" - } + "List": [ + { + "name": "ab", + "address": "test@test.com" + } + ] } }, { "header": "=?ISO-8859-1?Q?a?=\n =?ISO-8859-1?Q?b?= \n", "expected": { - "Address": { - "name": "ab", - "address": "test@test.com" - } + "List": [ + { + "name": "ab", + "address": "test@test.com" + } + ] } }, { "header": "=?ISO-8859-1?Q?a?= \"=?ISO-8859-2?Q?_b?=\" \n", "expected": { - "Address": { - "name": "a b", - "address": "test@test.com" - } + "List": [ + { + "name": "a b", + "address": "test@test.com" + } + ] } }, { "header": " \n", "expected": { - "Address": { - "name": null, - "address": "test@test.com" - } + "List": [ + { + "name": null, + "address": "test@test.com" + } + ] } }, { "header": "test@test.com\ninvalid@address.com\n", "expected": { - "Address": { - "name": null, - "address": "test@test.com" - } + "List": [ + { + "name": null, + "address": "test@test.com" + } + ] } }, { "header": "\"=?ISO-8859-1?Q =?ISO-8859-1?Q?a?= \\\" =?ISO-8859-1?Q?b?=\" \n\nbody@content.com", "expected": { - "Address": { - "name": "=?ISO-8859-1?Q a \" b", - "address": "last@address.com" - } + "List": [ + { + "name": "=?ISO-8859-1?Q a \" b", + "address": "last@address.com" + } + ] } }, { "header": "=? \n", "expected": { - "Address": { - "name": "=?", - "address": "name@domain.com" - } + "List": [ + { + "name": "=?", + "address": "name@domain.com" + } + ] } }, { "header": "\" James Smythe\" , Friends:\n jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?=\n ;\n", "expected": { - "GroupList": [ + "Group": [ { "name": null, "addresses": [ @@ -408,7 +462,7 @@ { "header": "List 1: addr1@test.com, addr2@test.com; List 2: addr3@test.com, addr4@test.com; addr5@test.com, addr6@test.com\n", "expected": { - "GroupList": [ + "Group": [ { "name": "List 1", "addresses": [ @@ -454,7 +508,7 @@ { "header": "\"List 1\": addr1@test.com, addr2@test.com; \"List 2\": addr3@test.com, addr4@test.com; addr5@test.com, addr6@test.com\n", "expected": { - "GroupList": [ + "Group": [ { "name": "List 1", "addresses": [ @@ -500,7 +554,7 @@ { "header": "\"=?utf-8?b?VGjDrXMgw61zIHbDoWzDrWQgw5pURjg=?=\": addr1@test.com, addr2@test.com; =?utf-8?b?VGjDrXMgw61zIHbDoWzDrWQgw5pURjg=?=: addr3@test.com, addr4@test.com; addr5@test.com, addr6@test.com\n", "expected": { - "GroupList": [ + "Group": [ { "name": "Thís ís válíd ÚTF8", "addresses": [ @@ -546,43 +600,51 @@ { "header": " (Web Archive)\n", "expected": { - "Address": { - "name": "Web Archive", - "address": "http://www.host.com/list/archive/" - } + "List": [ + { + "name": "Web Archive", + "address": "http://www.host.com/list/archive/" + } + ] } }, { "header": "\n", "expected": { - "Address": { - "name": null, - "address": "mailto:archive@host.com?subject=index%20list" - } + "List": [ + { + "name": null, + "address": "mailto:archive@host.com?subject=index%20list" + } + ] } }, { "header": " (Postings are Moderated)\n", "expected": { - "Address": { - "name": "Postings are Moderated", - "address": "mailto:moderator@host.com" - } + "List": [ + { + "name": "Postings are Moderated", + "address": "mailto:moderator@host.com" + } + ] } }, { "header": "(Use this command to join the list)\n \n", "expected": { - "Address": { - "name": "Use this command to join the list", - "address": "mailto:list-manager@host.com?body=subscribe%20list" - } + "List": [ + { + "name": "Use this command to join the list", + "address": "mailto:list-manager@host.com?body=subscribe%20list" + } + ] } }, { "header": ",\n \n", "expected": { - "AddressList": [ + "List": [ { "name": null, "address": "http://www.host.com/list.cgi?cmd=sub&lst=list" @@ -597,16 +659,18 @@ { "header": "NO (posting not allowed on this list)\n", "expected": { - "Address": { - "name": "posting not allowed on this list", - "address": "NO" - } + "List": [ + { + "name": "posting not allowed on this list", + "address": "NO" + } + ] } }, { "header": " (FTP),\n \n", "expected": { - "AddressList": [ + "List": [ { "name": "FTP", "address": "ftp://ftp.host.com/list.txt" @@ -621,7 +685,7 @@ { "header": ", \n", "expected": { - "AddressList": [ + "List": [ { "name": null, "address": "http://www.host.com/list/" @@ -636,16 +700,18 @@ { "header": "(Use this command to get off the list)\n \n", "expected": { - "Address": { - "name": "Use this command to get off the list", - "address": "mailto:list-manager@host.com?body=unsubscribe%20list" - } + "List": [ + { + "name": "Use this command to get off the list", + "address": "mailto:list-manager@host.com?body=unsubscribe%20list" + } + ] } }, { "header": ",\n \n", "expected": { - "AddressList": [ + "List": [ { "name": null, "address": "http://www.host.com/list.cgi?cmd=unsub&lst=list" @@ -660,19 +726,23 @@ { "header": " (Contact Person for Help)\n", "expected": { - "Address": { - "name": "Contact Person for Help", - "address": "mailto:listmom@host.com" - } + "List": [ + { + "name": "Contact Person for Help", + "address": "mailto:listmom@host.com" + } + ] } }, { "header": "\"\\\\\\\\\\\\\\\\S. NIG\\\\\\\\\\\\\\\\\" ", "expected": { - "Address": { - "name": "\\\\\\\\S. NIG\\\\\\\\", - "address": "first.last@host.com" - } + "List": [ + { + "name": "\\\\\\\\S. NIG\\\\\\\\", + "address": "first.last@host.com" + } + ] } } ] \ No newline at end of file diff --git a/resources/content_type.json b/resources/content_type.json new file mode 100644 index 0000000..362717f --- /dev/null +++ b/resources/content_type.json @@ -0,0 +1,1208 @@ +[ + { + "header": "audio/basic\n", + "expected": { + "c_type": "audio", + "c_subtype": "basic", + "attributes": null + } + }, + { + "header": "application/postscript \n", + "expected": { + "c_type": "application", + "c_subtype": "postscript", + "attributes": null + } + }, + { + "header": "image/ jpeg\n", + "expected": { + "c_type": "image", + "c_subtype": "jpeg", + "attributes": null + } + }, + { + "header": " message / rfc822\n", + "expected": { + "c_type": "message", + "c_subtype": "rfc822", + "attributes": null + } + }, + { + "header": "inline\n", + "expected": { + "c_type": "inline", + "c_subtype": null, + "attributes": null + } + }, + { + "header": " text/plain; charset =us-ascii (Plain text)\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "text/plain; charset= \"us-ascii\"\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "text/plain; charset =ISO-8859-1\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "charset", + "ISO-8859-1" + ] + ] + } + }, + { + "header": "text/foo; charset= bar\n", + "expected": { + "c_type": "text", + "c_subtype": "foo", + "attributes": [ + [ + "charset", + "bar" + ] + ] + } + }, + { + "header": " text /plain; charset=\"iso-8859-1\"; format=flowed\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "charset", + "iso-8859-1" + ], + [ + "format", + "flowed" + ] + ] + } + }, + { + "header": "application/pgp-signature; x-mac-type=70674453;\n name=PGP.sig\n", + "expected": { + "c_type": "application", + "c_subtype": "pgp-signature", + "attributes": [ + [ + "x-mac-type", + "70674453" + ], + [ + "name", + "PGP.sig" + ] + ] + } + }, + { + "header": "multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p\n", + "expected": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + [ + "boundary", + "gc0p4Jq0M2Yt08j34c0p" + ] + ] + } + }, + { + "header": "multipart/mixed; boundary=gc0pJq0M:08jU534c0p\n", + "expected": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + [ + "boundary", + "gc0pJq0M:08jU534c0p" + ] + ] + } + }, + { + "header": "multipart/mixed; boundary=\"gc0pJq0M:08jU534c0p\"\n", + "expected": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + [ + "boundary", + "gc0pJq0M:08jU534c0p" + ] + ] + } + }, + { + "header": "multipart/mixed; boundary=\"simple boundary\"\n", + "expected": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + [ + "boundary", + "simple boundary" + ] + ] + } + }, + { + "header": "multipart/mixed; boundary=\"foo\n bar\"\n", + "expected": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + [ + "boundary", + "foo bar" + ] + ] + } + }, + { + "header": "multipart/alternative; boundary=boundary42\n", + "expected": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + [ + "boundary", + "boundary42" + ] + ] + } + }, + { + "header": " multipart/mixed;\n boundary=\"---- main boundary ----\"\n", + "expected": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": [ + [ + "boundary", + "---- main boundary ----" + ] + ] + } + }, + { + "header": "multipart/alternative; boundary=42\n", + "expected": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": [ + [ + "boundary", + "42" + ] + ] + } + }, + { + "header": "message/partial; id=\"ABC@host.com\";\n", + "expected": { + "c_type": "message", + "c_subtype": "partial", + "attributes": [ + [ + "id", + "ABC@host.com" + ] + ] + } + }, + { + "header": "multipart/parallel;boundary=unique-boundary-2\n", + "expected": { + "c_type": "multipart", + "c_subtype": "parallel", + "attributes": [ + [ + "boundary", + "unique-boundary-2" + ] + ] + } + }, + { + "header": "message/external-body; name=\"BodyFormats.ps\";\n site=\"thumper.bellcore.com\"; mode=\"image\";\n access-type=ANON-FTP; directory=\"pub\";\n expiration=\"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)\"\n", + "expected": { + "c_type": "message", + "c_subtype": "external-body", + "attributes": [ + [ + "name", + "BodyFormats.ps" + ], + [ + "site", + "thumper.bellcore.com" + ], + [ + "mode", + "image" + ], + [ + "access-type", + "ANON-FTP" + ], + [ + "directory", + "pub" + ], + [ + "expiration", + "Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" + ] + ] + } + }, + { + "header": "message/external-body; access-type=local-file;\n name=\"/u/nsb/writing/rfcs/RFC-MIME.ps\";\n site=\"thumper.bellcore.com\";\n expiration=\"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)\"\n", + "expected": { + "c_type": "message", + "c_subtype": "external-body", + "attributes": [ + [ + "access-type", + "local-file" + ], + [ + "name", + "/u/nsb/writing/rfcs/RFC-MIME.ps" + ], + [ + "site", + "thumper.bellcore.com" + ], + [ + "expiration", + "Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" + ] + ] + } + }, + { + "header": "message/external-body;\n access-type=mail-server\n server=\"listserv@bogus.bitnet\";\n expiration=\"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)\"\n", + "expected": { + "c_type": "message", + "c_subtype": "external-body", + "attributes": [ + [ + "access-type", + "mail-server" + ], + [ + "server", + "listserv@bogus.bitnet" + ], + [ + "expiration", + "Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" + ] + ] + } + }, + { + "header": "Message/Partial; number=2; total=3;\n id=\"oc=jpbe0M2Yt4s@thumper.bellcore.com\"\n", + "expected": { + "c_type": "message", + "c_subtype": "partial", + "attributes": [ + [ + "number", + "2" + ], + [ + "total", + "3" + ], + [ + "id", + "oc=jpbe0M2Yt4s@thumper.bellcore.com" + ] + ] + } + }, + { + "header": "multipart/signed; micalg=pgp-sha1; protocol=\"application/pgp-signature\";\n boundary=\"=-J1qXPoyGtE2XNN5N6Z6j\"\n", + "expected": { + "c_type": "multipart", + "c_subtype": "signed", + "attributes": [ + [ + "micalg", + "pgp-sha1" + ], + [ + "protocol", + "application/pgp-signature" + ], + [ + "boundary", + "=-J1qXPoyGtE2XNN5N6Z6j" + ] + ] + } + }, + { + "header": "message/external-body;\n access-type=local-file;\n name=\"/u/nsb/Me.jpeg\"\n", + "expected": { + "c_type": "message", + "c_subtype": "external-body", + "attributes": [ + [ + "access-type", + "local-file" + ], + [ + "name", + "/u/nsb/Me.jpeg" + ] + ] + } + }, + { + "header": "message/external-body; access-type=URL;\n URL*0=\"ftp://\";\n URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"\n", + "expected": { + "c_type": "message", + "c_subtype": "external-body", + "attributes": [ + [ + "access-type", + "URL" + ], + [ + "url", + "ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" + ] + ] + } + }, + { + "header": "message/external-body; access-type=URL;\n URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"\n", + "expected": { + "c_type": "message", + "c_subtype": "external-body", + "attributes": [ + [ + "access-type", + "URL" + ], + [ + "url", + "ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" + ] + ] + } + }, + { + "header": "application/x-stuff;\n title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A\n", + "expected": { + "c_type": "application", + "c_subtype": "x-stuff", + "attributes": [ + [ + "title-language", + "en-us" + ], + [ + "title", + "This is ***fun***" + ] + ] + } + }, + { + "header": "application/x-stuff\n title*0*=us-ascii'en'This%20is%20even%20more%20\n title*1*=%2A%2A%2Afun%2A%2A%2A%20\n title*2=\"isn't it!\"\n", + "expected": { + "c_type": "application", + "c_subtype": "x-stuff", + "attributes": [ + [ + "title-language", + "en" + ], + [ + "title", + "This is even more ***fun*** isn't it!" + ] + ] + } + }, + { + "header": "application/pdf\n filename*0*=iso-8859-1'es'%D1and%FA\n filename*1*=iso-8859-1'%20r%E1pido\n filename*2*=\"iso-8859-1' (versi%F3n \\'99 \\\"oficial\\\").pdf\"\n", + "expected": { + "c_type": "application", + "c_subtype": "pdf", + "attributes": [ + [ + "filename-language", + "es" + ], + [ + "filename", + "Ñandú rápido (versión '99 \"oficial\").pdf" + ] + ] + } + }, + { + "header": " image/png;\n name=\"=?utf-8?q?=E3=83=8F=E3=83=AD=E3=83=BC=E3=83=BB=E3=83=AF=E3=83=BC=E3=83=AB=E3=83=89?=.png\"\n", + "expected": { + "c_type": "image", + "c_subtype": "png", + "attributes": [ + [ + "name", + "ハロー・ワールド.png" + ] + ] + } + }, + { + "header": " image/gif;\n name==?iso-8859-6?b?5dHNyMcgyMfk2cfk5Q==?=.gif\n", + "expected": { + "c_type": "image", + "c_subtype": "gif", + "attributes": [ + [ + "name", + "مرحبا بالعالم.gif" + ] + ] + } + }, + { + "header": "image/jpeg;\n name=\"=?iso-8859-1?B?4Q==?= =?utf-8?B?w6k=?= =?iso-8859-1?q?=ED?=.jpeg\"\n", + "expected": { + "c_type": "image", + "c_subtype": "jpeg", + "attributes": [ + [ + "name", + "á é í.jpeg" + ] + ] + } + }, + { + "header": "image/jpeg;\n name==?iso-8859-1?B?4Q==?= =?utf-8?B?w6k=?= =?iso-8859-1?q?=ED?=.jpeg\n", + "expected": { + "c_type": "image", + "c_subtype": "jpeg", + "attributes": [ + [ + "name", + "áéí.jpeg" + ] + ] + } + }, + { + "header": "image/gif;\n name==?iso-8859-6?b?5dHNyMcgyMfk2cfk5S5naWY=?=\n", + "expected": { + "c_type": "image", + "c_subtype": "gif", + "attributes": [ + [ + "name", + "مرحبا بالعالم.gif" + ] + ] + } + }, + { + "header": " image/gif;\n name=\"=?iso-8859-6?b?5dHNyMcgyMfk2cfk5S5naWY=?=\"\n", + "expected": { + "c_type": "image", + "c_subtype": "gif", + "attributes": [ + [ + "name", + "مرحبا بالعالم.gif" + ] + ] + } + }, + { + "header": " inline; filename=\" best \\\"file\\\" ever with \\\\ escaped ' stuff. \"\n", + "expected": { + "c_type": "inline", + "c_subtype": null, + "attributes": [ + [ + "filename", + " best \"file\" ever with \\ escaped ' stuff. " + ] + ] + } + }, + { + "header": "test/\n", + "expected": { + "c_type": "test", + "c_subtype": null, + "attributes": null + } + }, + { + "header": "/invalid\n", + "expected": null + }, + { + "header": "/\n", + "expected": null + }, + { + "header": ";\n", + "expected": null + }, + { + "header": "/ ; name=value\n", + "expected": null + }, + { + "header": "text/plain;\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + }, + { + "header": "text/plain;;\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + }, + { + "header": "text/plain ;;;;; = ;; name=\"value\"\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "name", + "value" + ] + ] + } + }, + { + "header": "=\n", + "expected": { + "c_type": "=", + "c_subtype": null, + "attributes": null + } + }, + { + "header": "name=value\n", + "expected": { + "c_type": "name=value", + "c_subtype": null, + "attributes": null + } + }, + { + "header": "text/plain; name= \n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + }, + { + "header": "a/b; = \n", + "expected": { + "c_type": "a", + "c_subtype": "b", + "attributes": null + } + }, + { + "header": "a/b; = \n \n", + "expected": { + "c_type": "a", + "c_subtype": "b", + "attributes": null + } + }, + { + "header": "a/b; =value\n", + "expected": { + "c_type": "a", + "c_subtype": "b", + "attributes": null + } + }, + { + "header": "test/test; =\"value\"\n", + "expected": { + "c_type": "test", + "c_subtype": "test", + "attributes": null + } + }, + { + "header": "á/é; á=é\n", + "expected": { + "c_type": "á", + "c_subtype": "é", + "attributes": [ + [ + "á", + "é" + ] + ] + } + }, + { + "header": "inva/lid; name=\" \n", + "expected": { + "c_type": "inva", + "c_subtype": "lid", + "attributes": [ + [ + "name", + " " + ] + ] + } + }, + { + "header": "inva/lid; name=\" \n \n", + "expected": { + "c_type": "inva", + "c_subtype": "lid", + "attributes": [ + [ + "name", + " " + ] + ] + } + }, + { + "header": "inva/lid; name=\" \n \"; test=test\n", + "expected": { + "c_type": "inva", + "c_subtype": "lid", + "attributes": [ + [ + "name", + " " + ], + [ + "test", + "test" + ] + ] + } + }, + { + "header": "name=value\n", + "expected": { + "c_type": "name=value", + "c_subtype": null, + "attributes": null + } + }, + { + "header": "test/encoded; key4*=us-ascii''foo; key*9999=ba%; key2*0=a; key3*0*=us-ascii'en'xyz; key*0=\"f\u0000oo\"; key2*1*=b%25; key3*1=plop%; key*1=baz; *=test; =test2;\n", + "expected": { + "c_type": "test", + "c_subtype": "encoded", + "attributes": [ + [ + "key4", + "foo" + ], + [ + "key2", + "ab%" + ], + [ + "key3-language", + "en" + ], + [ + "key3", + "xyzplop%" + ], + [ + "key", + "f\u0000oobazba%" + ] + ] + } + }, + { + "header": "text/plain; name*=\"iso-8859-1''HasenundFr%F6sche.txt\"\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "name", + "HasenundFrösche.txt" + ] + ] + } + }, + { + "header": "malicious/attempt; 1*2*=a; 3**=b; 4***=c; *5**6*=d;*****7*8*=e; 9*10*11*12*13*14=f; 15*x***fff*===g;1 * 999999999999999999 *= h; 18 *=*=*=*=*==i;\n", + "expected": { + "c_type": "malicious", + "c_subtype": "attempt", + "attributes": [ + [ + "3", + "b" + ], + [ + "4", + "c" + ], + [ + "5", + "d" + ], + [ + "15", + "==g" + ], + [ + "1", + "ha" + ], + [ + "18", + "*=*=*=*==i" + ], + [ + "7", + "e" + ], + [ + "9", + "f" + ] + ] + } + }, + { + "header": ";charset=us-ascii\n", + "expected": null + }, + { + "header": " ;charset=us-ascii\n", + "expected": null + }, + { + "header": "/\n", + "expected": null + }, + { + "header": "/;charset=us-ascii\n", + "expected": null + }, + { + "header": "/ ;charset=us-ascii\n", + "expected": null + }, + { + "header": "text/\n", + "expected": { + "c_type": "text", + "c_subtype": null, + "attributes": null + } + }, + { + "header": "text/;charset=us-ascii\n", + "expected": { + "c_type": "text", + "c_subtype": null, + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "text/ ;charset=us-ascii\n", + "expected": { + "c_type": "text", + "c_subtype": null, + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "/plain\n", + "expected": null + }, + { + "header": "/plain;charset=us-ascii\n", + "expected": null + }, + { + "header": "/plain ;charset=us-ascii\n", + "expected": null + }, + { + "header": "text/plain\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + }, + { + "header": "text/plain;charset=us-ascii\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "text/plain ;charset=us-ascii\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "text/plain/format\n", + "expected": { + "c_type": "text", + "c_subtype": "plain/format", + "attributes": null + } + }, + { + "header": "text/plain/format;charset=us-ascii\n", + "expected": { + "c_type": "text", + "c_subtype": "plain/format", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "text/plain/format ;charset=us-ascii\n", + "expected": { + "c_type": "text", + "c_subtype": "plain/format", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/ld+json\n", + "expected": { + "c_type": "application", + "c_subtype": "ld+json", + "attributes": null + } + }, + { + "header": "application/ld+json;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "ld+json", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/ld+json ;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "ld+json", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/x-magic-cap-package-1.0\n", + "expected": { + "c_type": "application", + "c_subtype": "x-magic-cap-package-1.0", + "attributes": null + } + }, + { + "header": "application/x-magic-cap-package-1.0;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "x-magic-cap-package-1.0", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/x-magic-cap-package-1.0 ;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "x-magic-cap-package-1.0", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/pro_eng\n", + "expected": { + "c_type": "application", + "c_subtype": "pro_eng", + "attributes": null + } + }, + { + "header": "application/pro_eng;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "pro_eng", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/pro_eng ;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "pro_eng", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/wordperfect6.1\n", + "expected": { + "c_type": "application", + "c_subtype": "wordperfect6.1", + "attributes": null + } + }, + { + "header": "application/wordperfect6.1;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "wordperfect6.1", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/wordperfect6.1 ;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "wordperfect6.1", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/vnd.openxmlformats-officedocument.wordprocessingml.template\n", + "expected": { + "c_type": "application", + "c_subtype": "vnd.openxmlformats-officedocument.wordprocessingml.template", + "attributes": null + } + }, + { + "header": "application/vnd.openxmlformats-officedocument.wordprocessingml.template;charset=us-ascii\n", + "expected": { + "c_type": "application", + "c_subtype": "vnd.openxmlformats-officedocument.wordprocessingml.template", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "application/vnd.openxmlformats-officedocument.wordprocessingml.template ;charset=us-asii\n", + "expected": { + "c_type": "application", + "c_subtype": "vnd.openxmlformats-officedocument.wordprocessingml.template", + "attributes": [ + [ + "charset", + "us-asii" + ] + ] + } + }, + { + "header": "(hello) text (plain) / (world) plain (eod)\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": null + } + }, + { + "header": "(hello) text (plain) / (world) plain (eod);charset=us-ascii\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "(hello) text (plain) / (world) plain (eod); charset=us-ascii\n", + "expected": { + "c_type": "text", + "c_subtype": "plain", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": "message/rfc822\r\n\n", + "expected": { + "c_type": "message", + "c_subtype": "rfc822", + "attributes": null + } + }, + { + "header": " \t\r message/rfc822 \t\r\n\n", + "expected": { + "c_type": "message", + "c_subtype": "rfc822", + "attributes": null + } + }, + { + "header": " \t\r message/rfc822 \t ;charset=us-ascii\r\n\n", + "expected": { + "c_type": "message", + "c_subtype": "rfc822", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + }, + { + "header": " \t\r message/rfc822 \t ; charset=us-ascii\r\n", + "expected": { + "c_type": "message", + "c_subtype": "rfc822", + "attributes": [ + [ + "charset", + "us-ascii" + ] + ] + } + } +] \ No newline at end of file diff --git a/resources/date.json b/resources/date.json new file mode 100644 index 0000000..b492c3d --- /dev/null +++ b/resources/date.json @@ -0,0 +1,388 @@ +[ + { + "header": "Tue, 1 Jul 2003 10:52:37 +0200", + "expected": { + "year": 2003, + "month": 7, + "day": 1, + "hour": 10, + "minute": 52, + "second": 37, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "Tue, 1 Jul 2003 10:52:37 +0200", + "expected": { + "year": 2003, + "month": 7, + "day": 1, + "hour": 10, + "minute": 52, + "second": 37, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "Fri, 21 Nov 1997 09:55:06 -0600", + "expected": { + "year": 1997, + "month": 11, + "day": 21, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": true, + "tz_hour": 6, + "tz_minute": 0 + } + }, + { + "header": "Mon, 24 Nov 1997 14:22:01 -0800", + "expected": { + "year": 1997, + "month": 11, + "day": 24, + "hour": 14, + "minute": 22, + "second": 1, + "tz_before_gmt": true, + "tz_hour": 8, + "tz_minute": 0 + } + }, + { + "header": "Tue, 30 Dec 1969 23:32:54 -0330", + "expected": { + "year": 1969, + "month": 12, + "day": 30, + "hour": 23, + "minute": 32, + "second": 54, + "tz_before_gmt": true, + "tz_hour": 3, + "tz_minute": 30 + } + }, + { + "header": "Thu, 13 Feb 1969 23:32:54 -0330", + "expected": { + "year": 1969, + "month": 2, + "day": 13, + "hour": 23, + "minute": 32, + "second": 54, + "tz_before_gmt": true, + "tz_hour": 3, + "tz_minute": 30 + } + }, + { + "header": "Thu,\n 13\n Feb\n 1969\n 23:32\n -0330 (Newfoundland Time)\n", + "expected": { + "year": 1969, + "month": 2, + "day": 13, + "hour": 23, + "minute": 32, + "second": 0, + "tz_before_gmt": true, + "tz_hour": 3, + "tz_minute": 30 + } + }, + { + "header": " 1 Jul 2003 (comment about date) 10:52:37 +0200", + "expected": { + "year": 2003, + "month": 7, + "day": 1, + "hour": 10, + "minute": 52, + "second": 37, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "Tue, 1 Jul 2003 ((tricky)\n comment) 10:52:37 +0200", + "expected": { + "year": 2003, + "month": 7, + "day": 1, + "hour": 10, + "minute": 52, + "second": 37, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "21 Nov 97 09:55:06 GMT", + "expected": { + "year": 1997, + "month": 11, + "day": 21, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 0, + "tz_minute": 0 + } + }, + { + "header": "20 11 (some \n 44 comments(more comments\n )) 79 05:34:27 -0300", + "expected": { + "year": 1979, + "month": 11, + "day": 20, + "hour": 5, + "minute": 34, + "second": 27, + "tz_before_gmt": true, + "tz_hour": 3, + "tz_minute": 0 + } + }, + { + "header": " Wed, 27 Jun 99 04:11 +0900 ", + "expected": { + "year": 1999, + "month": 6, + "day": 27, + "hour": 4, + "minute": 11, + "second": 0, + "tz_before_gmt": false, + "tz_hour": 9, + "tz_minute": 0 + } + }, + { + "header": " 4 8 15 16 23 42, 4 8 15 16 23 42, 4 8 15 16 23 42, ", + "expected": { + "year": 1915, + "month": 8, + "day": 4, + "hour": 16, + "minute": 23, + "second": 42, + "tz_before_gmt": false, + "tz_hour": 0, + "tz_minute": 4 + } + }, + { + "header": " some numbers 0 1 2 but invalid ", + "expected": null + }, + { + "header": "Tue, 1 Jul 2003 ((invalid)\ncomment) 10:52:37 +0200", + "expected": null + }, + { + "header": "1 jan 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 1, + "day": 1, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "2 feb 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 2, + "day": 2, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "3 mar 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 3, + "day": 3, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "4 apr 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 4, + "day": 4, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "5 may 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 5, + "day": 5, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "6 jun 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 6, + "day": 6, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "7 jul 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 7, + "day": 7, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "8 aug 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 8, + "day": 8, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "9 sep 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 9, + "day": 9, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "10 oct 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 10, + "day": 10, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "11 nov 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 11, + "day": 11, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "12 dec 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 12, + "day": 12, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "13 zzz 2021 09:55:06 +0200", + "expected": { + "year": 2021, + "month": 0, + "day": 13, + "hour": 9, + "minute": 55, + "second": 6, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + } + }, + { + "header": "by 2002:aa7:cd10:0:b0:45c:2c83:1208 with SMTP id b16-20020aa7cd10000000b0045c2c831208mr4220805edw.81.1665423075119;\n\tMon, 10 Oct 2022 10:31:15 -0700 (PDT)", + "expected": { + "year": 2022, + "month": 10, + "day": 10, + "hour": 10, + "minute": 31, + "second": 15, + "tz_before_gmt": true, + "tz_hour": 7, + "tz_minute": 0 + } + } +] \ No newline at end of file diff --git a/resources/eml/legacy/000.crlf.json b/resources/eml/legacy/000.crlf.json index 5265a58..0ad820e 100644 --- a/resources/eml/legacy/000.crlf.json +++ b/resources/eml/legacy/000.crlf.json @@ -13,8 +13,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -27,8 +31,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/000.json b/resources/eml/legacy/000.json index 5265a58..0ad820e 100644 --- a/resources/eml/legacy/000.json +++ b/resources/eml/legacy/000.json @@ -13,8 +13,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -27,8 +31,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/001.crlf.json b/resources/eml/legacy/001.crlf.json index 00d778b..1f120ee 100644 --- a/resources/eml/legacy/001.crlf.json +++ b/resources/eml/legacy/001.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -28,16 +32,18 @@ "Rfc": "to" }, "value": { - "AddressList": [ - { - "name": "Joe Blow", - "address": "jblow@example.com" - }, - { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" - } - ] + "Address": { + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + }, + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] + } }, "offset_field": 40, "offset_start": 43, diff --git a/resources/eml/legacy/001.json b/resources/eml/legacy/001.json index 730c06c..7227c03 100644 --- a/resources/eml/legacy/001.json +++ b/resources/eml/legacy/001.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -28,16 +32,18 @@ "Rfc": "to" }, "value": { - "AddressList": [ - { - "name": "Joe Blow", - "address": "jblow@example.com" - }, - { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" - } - ] + "Address": { + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + }, + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] + } }, "offset_field": 39, "offset_start": 42, diff --git a/resources/eml/legacy/002.crlf.json b/resources/eml/legacy/002.crlf.json index 7c8691a..f7a5db1 100644 --- a/resources/eml/legacy/002.crlf.json +++ b/resources/eml/legacy/002.crlf.json @@ -80,8 +80,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 290, diff --git a/resources/eml/legacy/002.json b/resources/eml/legacy/002.json index 7c8691a..f7a5db1 100644 --- a/resources/eml/legacy/002.json +++ b/resources/eml/legacy/002.json @@ -80,8 +80,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 290, diff --git a/resources/eml/legacy/003.crlf.json b/resources/eml/legacy/003.crlf.json index d2a0ece..742ea2c 100644 --- a/resources/eml/legacy/003.crlf.json +++ b/resources/eml/legacy/003.crlf.json @@ -80,8 +80,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 290, diff --git a/resources/eml/legacy/003.json b/resources/eml/legacy/003.json index d2a0ece..742ea2c 100644 --- a/resources/eml/legacy/003.json +++ b/resources/eml/legacy/003.json @@ -80,8 +80,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 290, diff --git a/resources/eml/legacy/004.crlf.json b/resources/eml/legacy/004.crlf.json index deba668..3924a06 100644 --- a/resources/eml/legacy/004.crlf.json +++ b/resources/eml/legacy/004.crlf.json @@ -80,8 +80,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 233, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 266, diff --git a/resources/eml/legacy/004.json b/resources/eml/legacy/004.json index deba668..3924a06 100644 --- a/resources/eml/legacy/004.json +++ b/resources/eml/legacy/004.json @@ -80,8 +80,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 233, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 266, diff --git a/resources/eml/legacy/005.crlf.json b/resources/eml/legacy/005.crlf.json index 63a3efb..9a410af 100644 --- a/resources/eml/legacy/005.crlf.json +++ b/resources/eml/legacy/005.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/005.json b/resources/eml/legacy/005.json index 63a3efb..9a410af 100644 --- a/resources/eml/legacy/005.json +++ b/resources/eml/legacy/005.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/006.crlf.json b/resources/eml/legacy/006.crlf.json index c395eae..43640a8 100644 --- a/resources/eml/legacy/006.crlf.json +++ b/resources/eml/legacy/006.crlf.json @@ -14,8 +14,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -28,8 +32,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/006.json b/resources/eml/legacy/006.json index c395eae..43640a8 100644 --- a/resources/eml/legacy/006.json +++ b/resources/eml/legacy/006.json @@ -14,8 +14,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -28,8 +32,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/007.crlf.json b/resources/eml/legacy/007.crlf.json index 3603444..f42e1a6 100644 --- a/resources/eml/legacy/007.crlf.json +++ b/resources/eml/legacy/007.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/007.json b/resources/eml/legacy/007.json index 3603444..f42e1a6 100644 --- a/resources/eml/legacy/007.json +++ b/resources/eml/legacy/007.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/008.crlf.json b/resources/eml/legacy/008.crlf.json index 26c7f06..4467f9f 100644 --- a/resources/eml/legacy/008.crlf.json +++ b/resources/eml/legacy/008.crlf.json @@ -19,8 +19,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -33,8 +37,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/008.json b/resources/eml/legacy/008.json index 26c7f06..4467f9f 100644 --- a/resources/eml/legacy/008.json +++ b/resources/eml/legacy/008.json @@ -19,8 +19,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -33,8 +37,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/009.crlf.json b/resources/eml/legacy/009.crlf.json index 19fecdc..d76bceb 100644 --- a/resources/eml/legacy/009.crlf.json +++ b/resources/eml/legacy/009.crlf.json @@ -91,8 +91,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 287, @@ -105,8 +109,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 373, diff --git a/resources/eml/legacy/009.json b/resources/eml/legacy/009.json index 19fecdc..d76bceb 100644 --- a/resources/eml/legacy/009.json +++ b/resources/eml/legacy/009.json @@ -91,8 +91,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 287, @@ -105,8 +109,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 373, diff --git a/resources/eml/legacy/010.crlf.json b/resources/eml/legacy/010.crlf.json index c987607..9bee999 100644 --- a/resources/eml/legacy/010.crlf.json +++ b/resources/eml/legacy/010.crlf.json @@ -80,8 +80,12 @@ }, "value": { "Address": { - "name": "Heinz M�ller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz M�ller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 234, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 274, diff --git a/resources/eml/legacy/010.json b/resources/eml/legacy/010.json index c987607..9bee999 100644 --- a/resources/eml/legacy/010.json +++ b/resources/eml/legacy/010.json @@ -80,8 +80,12 @@ }, "value": { "Address": { - "name": "Heinz M�ller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz M�ller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 234, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 274, diff --git a/resources/eml/legacy/011.crlf.json b/resources/eml/legacy/011.crlf.json index 2caa235..e8b2188 100644 --- a/resources/eml/legacy/011.crlf.json +++ b/resources/eml/legacy/011.crlf.json @@ -69,8 +69,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 209, @@ -83,8 +87,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 299, diff --git a/resources/eml/legacy/011.json b/resources/eml/legacy/011.json index 2caa235..e8b2188 100644 --- a/resources/eml/legacy/011.json +++ b/resources/eml/legacy/011.json @@ -69,8 +69,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 209, @@ -83,8 +87,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 299, diff --git a/resources/eml/legacy/012.crlf.json b/resources/eml/legacy/012.crlf.json index 9ee52e6..fce07ac 100644 --- a/resources/eml/legacy/012.crlf.json +++ b/resources/eml/legacy/012.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/012.json b/resources/eml/legacy/012.json index 9ee52e6..fce07ac 100644 --- a/resources/eml/legacy/012.json +++ b/resources/eml/legacy/012.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/013.crlf.json b/resources/eml/legacy/013.crlf.json index 89be171..9bc45fc 100644 --- a/resources/eml/legacy/013.crlf.json +++ b/resources/eml/legacy/013.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/013.json b/resources/eml/legacy/013.json index 89be171..9bc45fc 100644 --- a/resources/eml/legacy/013.json +++ b/resources/eml/legacy/013.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/014.crlf.json b/resources/eml/legacy/014.crlf.json index 6df020f..cf33541 100644 --- a/resources/eml/legacy/014.crlf.json +++ b/resources/eml/legacy/014.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/014.json b/resources/eml/legacy/014.json index 6df020f..cf33541 100644 --- a/resources/eml/legacy/014.json +++ b/resources/eml/legacy/014.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/015.crlf.json b/resources/eml/legacy/015.crlf.json index 0e39c29..e6eb10f 100644 --- a/resources/eml/legacy/015.crlf.json +++ b/resources/eml/legacy/015.crlf.json @@ -85,8 +85,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -99,8 +103,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/015.json b/resources/eml/legacy/015.json index 0e39c29..e6eb10f 100644 --- a/resources/eml/legacy/015.json +++ b/resources/eml/legacy/015.json @@ -85,8 +85,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -99,8 +103,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/016.crlf.json b/resources/eml/legacy/016.crlf.json index ee30dac..70a9862 100644 --- a/resources/eml/legacy/016.crlf.json +++ b/resources/eml/legacy/016.crlf.json @@ -72,8 +72,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 209, @@ -86,8 +90,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 295, diff --git a/resources/eml/legacy/016.json b/resources/eml/legacy/016.json index ee30dac..70a9862 100644 --- a/resources/eml/legacy/016.json +++ b/resources/eml/legacy/016.json @@ -72,8 +72,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 209, @@ -86,8 +90,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 295, diff --git a/resources/eml/legacy/017.crlf.json b/resources/eml/legacy/017.crlf.json index 84cd36e..ae48f94 100644 --- a/resources/eml/legacy/017.crlf.json +++ b/resources/eml/legacy/017.crlf.json @@ -72,8 +72,12 @@ }, "value": { "Address": { - "name": "J�rgen Schm�rgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "J�rgen Schm�rgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 209, @@ -86,8 +90,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 257, diff --git a/resources/eml/legacy/017.json b/resources/eml/legacy/017.json index 84cd36e..ae48f94 100644 --- a/resources/eml/legacy/017.json +++ b/resources/eml/legacy/017.json @@ -72,8 +72,12 @@ }, "value": { "Address": { - "name": "J�rgen Schm�rgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "J�rgen Schm�rgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 209, @@ -86,8 +90,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 257, diff --git a/resources/eml/legacy/018.crlf.json b/resources/eml/legacy/018.crlf.json index 83c4e1a..4ebee96 100644 --- a/resources/eml/legacy/018.crlf.json +++ b/resources/eml/legacy/018.crlf.json @@ -83,8 +83,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -97,8 +101,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/018.json b/resources/eml/legacy/018.json index 83c4e1a..4ebee96 100644 --- a/resources/eml/legacy/018.json +++ b/resources/eml/legacy/018.json @@ -83,8 +83,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -97,8 +101,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/019.crlf.json b/resources/eml/legacy/019.crlf.json index e967a11..9ca8194 100644 --- a/resources/eml/legacy/019.crlf.json +++ b/resources/eml/legacy/019.crlf.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -32,8 +36,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/019.json b/resources/eml/legacy/019.json index e967a11..9ca8194 100644 --- a/resources/eml/legacy/019.json +++ b/resources/eml/legacy/019.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -32,8 +36,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/020.crlf.json b/resources/eml/legacy/020.crlf.json index f55fc75..85086b3 100644 --- a/resources/eml/legacy/020.crlf.json +++ b/resources/eml/legacy/020.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "J�rgen Schm�rgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "J�rgen Schm�rgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/020.json b/resources/eml/legacy/020.json index f55fc75..85086b3 100644 --- a/resources/eml/legacy/020.json +++ b/resources/eml/legacy/020.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "J�rgen Schm�rgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "J�rgen Schm�rgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/021.crlf.json b/resources/eml/legacy/021.crlf.json index 5799d1f..73086e7 100644 --- a/resources/eml/legacy/021.crlf.json +++ b/resources/eml/legacy/021.crlf.json @@ -19,8 +19,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -33,8 +37,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/021.json b/resources/eml/legacy/021.json index 5799d1f..73086e7 100644 --- a/resources/eml/legacy/021.json +++ b/resources/eml/legacy/021.json @@ -19,8 +19,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -33,8 +37,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/022.crlf.json b/resources/eml/legacy/022.crlf.json index 3751f8d..cd75707 100644 --- a/resources/eml/legacy/022.crlf.json +++ b/resources/eml/legacy/022.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "J�rgen Schm�rgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "J�rgen Schm�rgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/022.json b/resources/eml/legacy/022.json index 3751f8d..cd75707 100644 --- a/resources/eml/legacy/022.json +++ b/resources/eml/legacy/022.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "J�rgen Schm�rgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "J�rgen Schm�rgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/023.crlf.json b/resources/eml/legacy/023.crlf.json index 01dd2ca..7d9f09a 100644 --- a/resources/eml/legacy/023.crlf.json +++ b/resources/eml/legacy/023.crlf.json @@ -73,8 +73,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 209, @@ -87,8 +91,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 295, diff --git a/resources/eml/legacy/023.json b/resources/eml/legacy/023.json index 01dd2ca..7d9f09a 100644 --- a/resources/eml/legacy/023.json +++ b/resources/eml/legacy/023.json @@ -73,8 +73,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "jschmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "jschmuergen@example.com" + } + ] } }, "offset_field": 209, @@ -87,8 +91,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 295, diff --git a/resources/eml/legacy/024.crlf.json b/resources/eml/legacy/024.crlf.json index 39bebcb..ddd23f0 100644 --- a/resources/eml/legacy/024.crlf.json +++ b/resources/eml/legacy/024.crlf.json @@ -83,8 +83,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -97,8 +101,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/024.json b/resources/eml/legacy/024.json index 39bebcb..ddd23f0 100644 --- a/resources/eml/legacy/024.json +++ b/resources/eml/legacy/024.json @@ -83,8 +83,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -97,8 +101,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/025.crlf.json b/resources/eml/legacy/025.crlf.json index bc73d70..a235d24 100644 --- a/resources/eml/legacy/025.crlf.json +++ b/resources/eml/legacy/025.crlf.json @@ -85,8 +85,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -99,8 +103,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/025.json b/resources/eml/legacy/025.json index bc73d70..a235d24 100644 --- a/resources/eml/legacy/025.json +++ b/resources/eml/legacy/025.json @@ -85,8 +85,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -99,8 +103,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/026.crlf.json b/resources/eml/legacy/026.crlf.json index aed28f5..ccae146 100644 --- a/resources/eml/legacy/026.crlf.json +++ b/resources/eml/legacy/026.crlf.json @@ -72,8 +72,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 209, @@ -86,8 +90,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 266, diff --git a/resources/eml/legacy/026.json b/resources/eml/legacy/026.json index aed28f5..ccae146 100644 --- a/resources/eml/legacy/026.json +++ b/resources/eml/legacy/026.json @@ -72,8 +72,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 209, @@ -86,8 +90,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 266, diff --git a/resources/eml/legacy/027.crlf.json b/resources/eml/legacy/027.crlf.json index 1d4a9cf..206695f 100644 --- a/resources/eml/legacy/027.crlf.json +++ b/resources/eml/legacy/027.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "J�rgen Schm�rgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "J�rgen Schm�rgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/027.json b/resources/eml/legacy/027.json index 1d4a9cf..206695f 100644 --- a/resources/eml/legacy/027.json +++ b/resources/eml/legacy/027.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "J�rgen Schm�rgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "J�rgen Schm�rgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/028.crlf.json b/resources/eml/legacy/028.crlf.json index 5ef4b5d..4d441f8 100644 --- a/resources/eml/legacy/028.crlf.json +++ b/resources/eml/legacy/028.crlf.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -32,8 +36,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/028.json b/resources/eml/legacy/028.json index 5ef4b5d..4d441f8 100644 --- a/resources/eml/legacy/028.json +++ b/resources/eml/legacy/028.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -32,8 +36,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/029.crlf.json b/resources/eml/legacy/029.crlf.json index e534186..2d61687 100644 --- a/resources/eml/legacy/029.crlf.json +++ b/resources/eml/legacy/029.crlf.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/029.json b/resources/eml/legacy/029.json index e534186..2d61687 100644 --- a/resources/eml/legacy/029.json +++ b/resources/eml/legacy/029.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/030.crlf.json b/resources/eml/legacy/030.crlf.json index 3073847..ef4831e 100644 --- a/resources/eml/legacy/030.crlf.json +++ b/resources/eml/legacy/030.crlf.json @@ -55,8 +55,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -102,8 +106,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/030.json b/resources/eml/legacy/030.json index 3073847..ef4831e 100644 --- a/resources/eml/legacy/030.json +++ b/resources/eml/legacy/030.json @@ -55,8 +55,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -102,8 +106,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/031.crlf.json b/resources/eml/legacy/031.crlf.json index d5ad207..c84ade4 100644 --- a/resources/eml/legacy/031.crlf.json +++ b/resources/eml/legacy/031.crlf.json @@ -39,8 +39,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + ] } }, "offset_field": 45, @@ -53,8 +57,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 91, diff --git a/resources/eml/legacy/031.json b/resources/eml/legacy/031.json index d5ad207..c84ade4 100644 --- a/resources/eml/legacy/031.json +++ b/resources/eml/legacy/031.json @@ -39,8 +39,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + ] } }, "offset_field": 45, @@ -53,8 +57,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 91, diff --git a/resources/eml/legacy/032.crlf.json b/resources/eml/legacy/032.crlf.json index 18cffdb..010d081 100644 --- a/resources/eml/legacy/032.crlf.json +++ b/resources/eml/legacy/032.crlf.json @@ -54,8 +54,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -101,8 +105,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/032.json b/resources/eml/legacy/032.json index 18cffdb..010d081 100644 --- a/resources/eml/legacy/032.json +++ b/resources/eml/legacy/032.json @@ -54,8 +54,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -101,8 +105,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/033.crlf.json b/resources/eml/legacy/033.crlf.json index 6453ba9..53382d8 100644 --- a/resources/eml/legacy/033.crlf.json +++ b/resources/eml/legacy/033.crlf.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/033.json b/resources/eml/legacy/033.json index 6453ba9..53382d8 100644 --- a/resources/eml/legacy/033.json +++ b/resources/eml/legacy/033.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/034.crlf.json b/resources/eml/legacy/034.crlf.json index 274c379..f16a2b9 100644 --- a/resources/eml/legacy/034.crlf.json +++ b/resources/eml/legacy/034.crlf.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Heinz M+APw-ller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz M+APw-ller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/034.json b/resources/eml/legacy/034.json index 274c379..f16a2b9 100644 --- a/resources/eml/legacy/034.json +++ b/resources/eml/legacy/034.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Heinz M+APw-ller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz M+APw-ller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/035.crlf.json b/resources/eml/legacy/035.crlf.json index f8a15d7..5b5ff83 100644 --- a/resources/eml/legacy/035.crlf.json +++ b/resources/eml/legacy/035.crlf.json @@ -56,8 +56,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -103,8 +107,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/035.json b/resources/eml/legacy/035.json index f8a15d7..5b5ff83 100644 --- a/resources/eml/legacy/035.json +++ b/resources/eml/legacy/035.json @@ -56,8 +56,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -103,8 +107,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/036.crlf.json b/resources/eml/legacy/036.crlf.json index e9a0ac8..a45a331 100644 --- a/resources/eml/legacy/036.crlf.json +++ b/resources/eml/legacy/036.crlf.json @@ -36,8 +36,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + ] } }, "offset_field": 45, @@ -50,8 +54,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 91, diff --git a/resources/eml/legacy/036.json b/resources/eml/legacy/036.json index e9a0ac8..a45a331 100644 --- a/resources/eml/legacy/036.json +++ b/resources/eml/legacy/036.json @@ -36,8 +36,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + ] } }, "offset_field": 45, @@ -50,8 +54,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 91, diff --git a/resources/eml/legacy/037.crlf.json b/resources/eml/legacy/037.crlf.json index 46c30d6..18b8bee 100644 --- a/resources/eml/legacy/037.crlf.json +++ b/resources/eml/legacy/037.crlf.json @@ -51,8 +51,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -98,8 +102,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/037.json b/resources/eml/legacy/037.json index 46c30d6..18b8bee 100644 --- a/resources/eml/legacy/037.json +++ b/resources/eml/legacy/037.json @@ -51,8 +51,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -98,8 +102,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/038.crlf.json b/resources/eml/legacy/038.crlf.json index e9d0ce6..02c70f2 100644 --- a/resources/eml/legacy/038.crlf.json +++ b/resources/eml/legacy/038.crlf.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/038.json b/resources/eml/legacy/038.json index e9d0ce6..02c70f2 100644 --- a/resources/eml/legacy/038.json +++ b/resources/eml/legacy/038.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/039.crlf.json b/resources/eml/legacy/039.crlf.json index c4f490e..91e8dca 100644 --- a/resources/eml/legacy/039.crlf.json +++ b/resources/eml/legacy/039.crlf.json @@ -56,8 +56,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -103,8 +107,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/039.json b/resources/eml/legacy/039.json index c4f490e..91e8dca 100644 --- a/resources/eml/legacy/039.json +++ b/resources/eml/legacy/039.json @@ -56,8 +56,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -103,8 +107,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/040.crlf.json b/resources/eml/legacy/040.crlf.json index ae2c3cd..9feadff 100644 --- a/resources/eml/legacy/040.crlf.json +++ b/resources/eml/legacy/040.crlf.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/040.json b/resources/eml/legacy/040.json index ae2c3cd..9feadff 100644 --- a/resources/eml/legacy/040.json +++ b/resources/eml/legacy/040.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/041.crlf.json b/resources/eml/legacy/041.crlf.json index 3752557..5a57149 100644 --- a/resources/eml/legacy/041.crlf.json +++ b/resources/eml/legacy/041.crlf.json @@ -38,8 +38,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + ] } }, "offset_field": 45, @@ -52,8 +56,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 91, diff --git a/resources/eml/legacy/041.json b/resources/eml/legacy/041.json index 3752557..5a57149 100644 --- a/resources/eml/legacy/041.json +++ b/resources/eml/legacy/041.json @@ -38,8 +38,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + ] } }, "offset_field": 45, @@ -52,8 +56,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 91, diff --git a/resources/eml/legacy/042.crlf.json b/resources/eml/legacy/042.crlf.json index 65845bc..57daf98 100644 --- a/resources/eml/legacy/042.crlf.json +++ b/resources/eml/legacy/042.crlf.json @@ -49,8 +49,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -96,8 +100,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/042.json b/resources/eml/legacy/042.json index 65845bc..57daf98 100644 --- a/resources/eml/legacy/042.json +++ b/resources/eml/legacy/042.json @@ -49,8 +49,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -96,8 +100,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/043.crlf.json b/resources/eml/legacy/043.crlf.json index 053f470..7a14e13 100644 --- a/resources/eml/legacy/043.crlf.json +++ b/resources/eml/legacy/043.crlf.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 83, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 206, diff --git a/resources/eml/legacy/043.json b/resources/eml/legacy/043.json index 053f470..7a14e13 100644 --- a/resources/eml/legacy/043.json +++ b/resources/eml/legacy/043.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 83, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 206, diff --git a/resources/eml/legacy/044.crlf.json b/resources/eml/legacy/044.crlf.json index 14bd492..7737840 100644 --- a/resources/eml/legacy/044.crlf.json +++ b/resources/eml/legacy/044.crlf.json @@ -57,8 +57,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -104,8 +108,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/044.json b/resources/eml/legacy/044.json index 14bd492..7737840 100644 --- a/resources/eml/legacy/044.json +++ b/resources/eml/legacy/044.json @@ -57,8 +57,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -104,8 +108,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/045.crlf.json b/resources/eml/legacy/045.crlf.json index b6b8939..9fafba3 100644 --- a/resources/eml/legacy/045.crlf.json +++ b/resources/eml/legacy/045.crlf.json @@ -38,8 +38,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + ] } }, "offset_field": 45, @@ -51,16 +55,18 @@ "Rfc": "to" }, "value": { - "AddressList": [ - { - "name": "Joe Blow", - "address": "blow@example.com" - }, - { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - ] + "Address": { + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + }, + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] + } }, "offset_field": 91, "offset_start": 94, diff --git a/resources/eml/legacy/045.json b/resources/eml/legacy/045.json index b6b8939..9fafba3 100644 --- a/resources/eml/legacy/045.json +++ b/resources/eml/legacy/045.json @@ -38,8 +38,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@penguin.example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@penguin.example.com" + } + ] } }, "offset_field": 45, @@ -51,16 +55,18 @@ "Rfc": "to" }, "value": { - "AddressList": [ - { - "name": "Joe Blow", - "address": "blow@example.com" - }, - { - "name": "Heinz Müller", - "address": "mueller@example.com" - } - ] + "Address": { + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + }, + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] + } }, "offset_field": 91, "offset_start": 94, diff --git a/resources/eml/legacy/046.crlf.json b/resources/eml/legacy/046.crlf.json index 5e938c7..3034a29 100644 --- a/resources/eml/legacy/046.crlf.json +++ b/resources/eml/legacy/046.crlf.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/046.json b/resources/eml/legacy/046.json index 5e938c7..3034a29 100644 --- a/resources/eml/legacy/046.json +++ b/resources/eml/legacy/046.json @@ -47,8 +47,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -94,8 +98,12 @@ }, "value": { "Address": { - "name": "Jürgen Schmürgen", - "address": "schmuergen@example.com" + "List": [ + { + "name": "Jürgen Schmürgen", + "address": "schmuergen@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/047.crlf.json b/resources/eml/legacy/047.crlf.json index b34ff46..ab3985b 100644 --- a/resources/eml/legacy/047.crlf.json +++ b/resources/eml/legacy/047.crlf.json @@ -49,8 +49,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -96,8 +100,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/047.json b/resources/eml/legacy/047.json index b34ff46..ab3985b 100644 --- a/resources/eml/legacy/047.json +++ b/resources/eml/legacy/047.json @@ -49,8 +49,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -96,8 +100,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/048.crlf.json b/resources/eml/legacy/048.crlf.json index e05a818..25570fe 100644 --- a/resources/eml/legacy/048.crlf.json +++ b/resources/eml/legacy/048.crlf.json @@ -57,8 +57,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -104,8 +108,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/048.json b/resources/eml/legacy/048.json index e05a818..25570fe 100644 --- a/resources/eml/legacy/048.json +++ b/resources/eml/legacy/048.json @@ -57,8 +57,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 84, @@ -104,8 +108,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "blow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "blow@example.com" + } + ] } }, "offset_field": 207, diff --git a/resources/eml/legacy/049.crlf.json b/resources/eml/legacy/049.crlf.json index 151c8e2..84e456d 100644 --- a/resources/eml/legacy/049.crlf.json +++ b/resources/eml/legacy/049.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/049.json b/resources/eml/legacy/049.json index 151c8e2..84e456d 100644 --- a/resources/eml/legacy/049.json +++ b/resources/eml/legacy/049.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Joe Blow", - "address": "jblow@example.com" + "List": [ + { + "name": "Joe Blow", + "address": "jblow@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/050.crlf.json b/resources/eml/legacy/050.crlf.json index 914f8cd..15d9cd0 100644 --- a/resources/eml/legacy/050.crlf.json +++ b/resources/eml/legacy/050.crlf.json @@ -83,8 +83,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -97,8 +101,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/050.json b/resources/eml/legacy/050.json index 914f8cd..15d9cd0 100644 --- a/resources/eml/legacy/050.json +++ b/resources/eml/legacy/050.json @@ -83,8 +83,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -97,8 +101,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/051.crlf.json b/resources/eml/legacy/051.crlf.json index c14fbc5..cfc6a11 100644 --- a/resources/eml/legacy/051.crlf.json +++ b/resources/eml/legacy/051.crlf.json @@ -85,8 +85,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -99,8 +103,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/051.json b/resources/eml/legacy/051.json index c14fbc5..cfc6a11 100644 --- a/resources/eml/legacy/051.json +++ b/resources/eml/legacy/051.json @@ -85,8 +85,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 231, @@ -99,8 +103,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "dwsauder@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "dwsauder@example.com" + } + ] } }, "offset_field": 288, diff --git a/resources/eml/legacy/052.crlf.json b/resources/eml/legacy/052.crlf.json index 715f1e4..45ed97c 100644 --- a/resources/eml/legacy/052.crlf.json +++ b/resources/eml/legacy/052.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Heinz M�ller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz M�ller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/052.json b/resources/eml/legacy/052.json index 715f1e4..45ed97c 100644 --- a/resources/eml/legacy/052.json +++ b/resources/eml/legacy/052.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Heinz M�ller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz M�ller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/053.crlf.json b/resources/eml/legacy/053.crlf.json index d804cdc..387c2b4 100644 --- a/resources/eml/legacy/053.crlf.json +++ b/resources/eml/legacy/053.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/legacy/053.json b/resources/eml/legacy/053.json index d804cdc..387c2b4 100644 --- a/resources/eml/legacy/053.json +++ b/resources/eml/legacy/053.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Doug Sauder", - "address": "doug@example.com" + "List": [ + { + "name": "Doug Sauder", + "address": "doug@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Heinz Müller", - "address": "mueller@example.com" + "List": [ + { + "name": "Heinz Müller", + "address": "mueller@example.com" + } + ] } }, "offset_field": 40, diff --git a/resources/eml/malformed/015.crlf.json b/resources/eml/malformed/015.crlf.json index e442a18..fb4ef2b 100644 --- a/resources/eml/malformed/015.crlf.json +++ b/resources/eml/malformed/015.crlf.json @@ -39,8 +39,12 @@ }, "value": { "Address": { - "name": "Test User", - "address": "test@example.org" + "List": [ + { + "name": "Test User", + "address": "test@example.org" + } + ] } }, "offset_field": 55, @@ -53,8 +57,12 @@ }, "value": { "Address": { - "name": "Another User", - "address": "test2@example.org" + "List": [ + { + "name": "Another User", + "address": "test2@example.org" + } + ] } }, "offset_field": 91, diff --git a/resources/eml/malformed/015.json b/resources/eml/malformed/015.json index 597b407..844bca0 100644 --- a/resources/eml/malformed/015.json +++ b/resources/eml/malformed/015.json @@ -39,8 +39,12 @@ }, "value": { "Address": { - "name": "Test User", - "address": "test@example.org" + "List": [ + { + "name": "Test User", + "address": "test@example.org" + } + ] } }, "offset_field": 53, @@ -53,8 +57,12 @@ }, "value": { "Address": { - "name": "Another User", - "address": "test2@example.org" + "List": [ + { + "name": "Another User", + "address": "test2@example.org" + } + ] } }, "offset_field": 88, diff --git a/resources/eml/rfc/000.crlf.json b/resources/eml/rfc/000.crlf.json index e5606b4..f618ea1 100644 --- a/resources/eml/rfc/000.crlf.json +++ b/resources/eml/rfc/000.crlf.json @@ -33,8 +33,12 @@ }, "value": { "Address": { - "name": "Nathaniel Borenstein", - "address": "nsb@nsb.fv.com" + "List": [ + { + "name": "Nathaniel Borenstein", + "address": "nsb@nsb.fv.com" + } + ] } }, "offset_field": 19, @@ -47,8 +51,12 @@ }, "value": { "Address": { - "name": "Ned Freed", - "address": "ned@innosoft.com" + "List": [ + { + "name": "Ned Freed", + "address": "ned@innosoft.com" + } + ] } }, "offset_field": 64, @@ -334,8 +342,12 @@ }, "value": { "Address": { - "name": "mailbox in US-ASCII", - "address": null + "List": [ + { + "name": "mailbox in US-ASCII", + "address": null + } + ] } }, "offset_field": 1670, @@ -348,8 +360,12 @@ }, "value": { "Address": { - "name": "address in US-ASCII", - "address": null + "List": [ + { + "name": "address in US-ASCII", + "address": null + } + ] } }, "offset_field": 1699, diff --git a/resources/eml/rfc/000.json b/resources/eml/rfc/000.json index 8c0de34..fb62aa0 100644 --- a/resources/eml/rfc/000.json +++ b/resources/eml/rfc/000.json @@ -33,8 +33,12 @@ }, "value": { "Address": { - "name": "Nathaniel Borenstein", - "address": "nsb@nsb.fv.com" + "List": [ + { + "name": "Nathaniel Borenstein", + "address": "nsb@nsb.fv.com" + } + ] } }, "offset_field": 18, @@ -47,8 +51,12 @@ }, "value": { "Address": { - "name": "Ned Freed", - "address": "ned@innosoft.com" + "List": [ + { + "name": "Ned Freed", + "address": "ned@innosoft.com" + } + ] } }, "offset_field": 62, @@ -334,8 +342,12 @@ }, "value": { "Address": { - "name": "mailbox in US-ASCII", - "address": null + "List": [ + { + "name": "mailbox in US-ASCII", + "address": null + } + ] } }, "offset_field": 1607, @@ -348,8 +360,12 @@ }, "value": { "Address": { - "name": "address in US-ASCII", - "address": null + "List": [ + { + "name": "address in US-ASCII", + "address": null + } + ] } }, "offset_field": 1635, diff --git a/resources/eml/rfc/001.crlf.json b/resources/eml/rfc/001.crlf.json index a3f5c69..6e9125a 100644 --- a/resources/eml/rfc/001.crlf.json +++ b/resources/eml/rfc/001.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Whomever", - "address": null + "List": [ + { + "name": "Whomever", + "address": null + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Someone", - "address": null + "List": [ + { + "name": "Someone", + "address": null + } + ] } }, "offset_field": 16, diff --git a/resources/eml/rfc/001.json b/resources/eml/rfc/001.json index 8929cd9..6ae5076 100644 --- a/resources/eml/rfc/001.json +++ b/resources/eml/rfc/001.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Whomever", - "address": null + "List": [ + { + "name": "Whomever", + "address": null + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": "Someone", - "address": null + "List": [ + { + "name": "Someone", + "address": null + } + ] } }, "offset_field": 15, diff --git a/resources/eml/rfc/002.crlf.json b/resources/eml/rfc/002.crlf.json index 4840b76..249db23 100644 --- a/resources/eml/rfc/002.crlf.json +++ b/resources/eml/rfc/002.crlf.json @@ -17,8 +17,12 @@ }, "value": { "Address": { - "name": "Al Gore", - "address": "vice-president@whitehouse.gov" + "List": [ + { + "name": "Al Gore", + "address": "vice-president@whitehouse.gov" + } + ] } }, "offset_field": 0, @@ -31,8 +35,12 @@ }, "value": { "Address": { - "name": "White House Transportation Coordinator", - "address": "transport@whitehouse.gov" + "List": [ + { + "name": "White House Transportation Coordinator", + "address": "transport@whitehouse.gov" + } + ] } }, "offset_field": 48, @@ -201,7 +209,29 @@ "Rfc": "received" }, "value": { - "Text": "from mailhost.whitehouse.gov ([192.168.51.200])\r\n by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453\r\n for ;\r\n Mon, 13 Aug 1998 l8:14:23 +1000" + "Received": { + "from": { + "Name": "mailhost.whitehouse.gov" + }, + "from_ip": "192.168.51.200", + "by": { + "Name": "heartbeat.whitehouse.gov" + }, + "for_": "vice-president@heartbeat.whitehouse.gov", + "with": "ESMTP", + "id": "SAA22453", + "date": { + "year": 1998, + "month": 8, + "day": 13, + "hour": 14, + "minute": 23, + "second": 232, + "tz_before_gmt": true, + "tz_hour": 0, + "tz_minute": 0 + } + } }, "offset_field": 691, "offset_start": 700, @@ -212,7 +242,29 @@ "Rfc": "received" }, "value": { - "Text": "from the_big_box.whitehouse.gov ([192.168.51.50])\r\n by mailhost.whitehouse.gov (8.8.8/8.8.7) with ESMTP id RAA20366\r\n for vice-president@whitehouse.gov; Mon, 13 Aug 1998 17:42:41 +1000" + "Received": { + "from": { + "Name": "the_big_box.whitehouse.gov" + }, + "from_ip": "192.168.51.50", + "by": { + "Name": "mailhost.whitehouse.gov" + }, + "for_": "vice-president@whitehouse.gov", + "with": "ESMTP", + "id": "RAA20366", + "date": { + "year": 1998, + "month": 8, + "day": 13, + "hour": 17, + "minute": 42, + "second": 41, + "tz_before_gmt": false, + "tz_hour": 10, + "tz_minute": 0 + } + } }, "offset_field": 921, "offset_start": 930, @@ -256,8 +308,12 @@ }, "value": { "Address": { - "name": "Bill Clinton", - "address": "president@whitehouse.gov" + "List": [ + { + "name": "Bill Clinton", + "address": "president@whitehouse.gov" + } + ] } }, "offset_field": 1231, @@ -270,8 +326,12 @@ }, "value": { "Address": { - "name": "A1 Gore (The Enforcer)", - "address": "vice-president@whitehouse.gov" + "List": [ + { + "name": "A1 Gore (The Enforcer)", + "address": "vice-president@whitehouse.gov" + } + ] } }, "offset_field": 1278, diff --git a/resources/eml/rfc/002.json b/resources/eml/rfc/002.json index d10a8ab..ded6aae 100644 --- a/resources/eml/rfc/002.json +++ b/resources/eml/rfc/002.json @@ -17,8 +17,12 @@ }, "value": { "Address": { - "name": "Al Gore", - "address": "vice-president@whitehouse.gov" + "List": [ + { + "name": "Al Gore", + "address": "vice-president@whitehouse.gov" + } + ] } }, "offset_field": 0, @@ -31,8 +35,12 @@ }, "value": { "Address": { - "name": "White House Transportation Coordinator", - "address": "transport@whitehouse.gov" + "List": [ + { + "name": "White House Transportation Coordinator", + "address": "transport@whitehouse.gov" + } + ] } }, "offset_field": 47, @@ -201,7 +209,29 @@ "Rfc": "received" }, "value": { - "Text": "from mailhost.whitehouse.gov ([192.168.51.200])\n by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453\n for ;\n Mon, 13 Aug 1998 l8:14:23 +1000" + "Received": { + "from": { + "Name": "mailhost.whitehouse.gov" + }, + "from_ip": "192.168.51.200", + "by": { + "Name": "heartbeat.whitehouse.gov" + }, + "for_": "vice-president@heartbeat.whitehouse.gov", + "with": "ESMTP", + "id": "SAA22453\n", + "date": { + "year": 1998, + "month": 8, + "day": 13, + "hour": 14, + "minute": 23, + "second": 232, + "tz_before_gmt": true, + "tz_hour": 0, + "tz_minute": 0 + } + } }, "offset_field": 667, "offset_start": 676, @@ -212,7 +242,29 @@ "Rfc": "received" }, "value": { - "Text": "from the_big_box.whitehouse.gov ([192.168.51.50])\n by mailhost.whitehouse.gov (8.8.8/8.8.7) with ESMTP id RAA20366\n for vice-president@whitehouse.gov; Mon, 13 Aug 1998 17:42:41 +1000" + "Received": { + "from": { + "Name": "the_big_box.whitehouse.gov" + }, + "from_ip": "192.168.51.50", + "by": { + "Name": "mailhost.whitehouse.gov" + }, + "for_": "vice-president@whitehouse.gov", + "with": "ESMTP", + "id": "RAA20366\n", + "date": { + "year": 1998, + "month": 8, + "day": 13, + "hour": 17, + "minute": 42, + "second": 41, + "tz_before_gmt": false, + "tz_hour": 10, + "tz_minute": 0 + } + } }, "offset_field": 893, "offset_start": 902, @@ -256,8 +308,12 @@ }, "value": { "Address": { - "name": "Bill Clinton", - "address": "president@whitehouse.gov" + "List": [ + { + "name": "Bill Clinton", + "address": "president@whitehouse.gov" + } + ] } }, "offset_field": 1198, @@ -270,8 +326,12 @@ }, "value": { "Address": { - "name": "A1 Gore (The Enforcer)", - "address": "vice-president@whitehouse.gov" + "List": [ + { + "name": "A1 Gore (The Enforcer)", + "address": "vice-president@whitehouse.gov" + } + ] } }, "offset_field": 1244, diff --git a/resources/eml/rfc/003.crlf.json b/resources/eml/rfc/003.crlf.json index 0b078d7..7f746fb 100644 --- a/resources/eml/rfc/003.crlf.json +++ b/resources/eml/rfc/003.crlf.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": "Nathaniel Borenstein", - "address": "nsb@bellcore.com" + "List": [ + { + "name": "Nathaniel Borenstein", + "address": "nsb@bellcore.com" + } + ] } }, "offset_field": 0, @@ -32,8 +36,12 @@ }, "value": { "Address": { - "name": "Ned Freed", - "address": "ned@innosoft.com" + "List": [ + { + "name": "Ned Freed", + "address": "ned@innosoft.com" + } + ] } }, "offset_field": 47, diff --git a/resources/eml/rfc/003.json b/resources/eml/rfc/003.json index fb6cf59..a8a39aa 100644 --- a/resources/eml/rfc/003.json +++ b/resources/eml/rfc/003.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": "Nathaniel Borenstein", - "address": "nsb@bellcore.com" + "List": [ + { + "name": "Nathaniel Borenstein", + "address": "nsb@bellcore.com" + } + ] } }, "offset_field": 0, @@ -32,8 +36,12 @@ }, "value": { "Address": { - "name": "Ned Freed", - "address": "ned@innosoft.com" + "List": [ + { + "name": "Ned Freed", + "address": "ned@innosoft.com" + } + ] } }, "offset_field": 46, diff --git a/resources/eml/rfc/004.crlf.json b/resources/eml/rfc/004.crlf.json index bb5e745..9964887 100644 --- a/resources/eml/rfc/004.crlf.json +++ b/resources/eml/rfc/004.crlf.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": "Moderator-Address", - "address": null + "List": [ + { + "name": "Moderator-Address", + "address": null + } + ] } }, "offset_field": 0, @@ -32,8 +36,12 @@ }, "value": { "Address": { - "name": "Recipient-List", - "address": null + "List": [ + { + "name": "Recipient-List", + "address": null + } + ] } }, "offset_field": 25, @@ -180,8 +188,12 @@ }, "value": { "Address": { - "name": "someone-else", - "address": null + "List": [ + { + "name": "someone-else", + "address": null + } + ] } }, "offset_field": 436, @@ -257,8 +269,12 @@ }, "value": { "Address": { - "name": "someone-else-again", - "address": null + "List": [ + { + "name": "someone-else-again", + "address": null + } + ] } }, "offset_field": 571, diff --git a/resources/eml/rfc/004.json b/resources/eml/rfc/004.json index 729fea7..9d269d6 100644 --- a/resources/eml/rfc/004.json +++ b/resources/eml/rfc/004.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": "Moderator-Address", - "address": null + "List": [ + { + "name": "Moderator-Address", + "address": null + } + ] } }, "offset_field": 0, @@ -32,8 +36,12 @@ }, "value": { "Address": { - "name": "Recipient-List", - "address": null + "List": [ + { + "name": "Recipient-List", + "address": null + } + ] } }, "offset_field": 24, @@ -180,8 +188,12 @@ }, "value": { "Address": { - "name": "someone-else", - "address": null + "List": [ + { + "name": "someone-else", + "address": null + } + ] } }, "offset_field": 418, @@ -257,8 +269,12 @@ }, "value": { "Address": { - "name": "someone-else-again", - "address": null + "List": [ + { + "name": "someone-else-again", + "address": null + } + ] } }, "offset_field": 545, diff --git a/resources/eml/rfc/005.crlf.json b/resources/eml/rfc/005.crlf.json index f55b7f8..5d96dce 100644 --- a/resources/eml/rfc/005.crlf.json +++ b/resources/eml/rfc/005.crlf.json @@ -17,8 +17,12 @@ }, "value": { "Address": { - "name": "Nathaniel Borenstein", - "address": "nsb@bellcore.com" + "List": [ + { + "name": "Nathaniel Borenstein", + "address": "nsb@bellcore.com" + } + ] } }, "offset_field": 0, @@ -31,8 +35,12 @@ }, "value": { "Address": { - "name": "Ned Freed", - "address": "ned@innosoft.com" + "List": [ + { + "name": "Ned Freed", + "address": "ned@innosoft.com" + } + ] } }, "offset_field": 47, diff --git a/resources/eml/rfc/005.json b/resources/eml/rfc/005.json index 9f578c0..8a89017 100644 --- a/resources/eml/rfc/005.json +++ b/resources/eml/rfc/005.json @@ -17,8 +17,12 @@ }, "value": { "Address": { - "name": "Nathaniel Borenstein", - "address": "nsb@bellcore.com" + "List": [ + { + "name": "Nathaniel Borenstein", + "address": "nsb@bellcore.com" + } + ] } }, "offset_field": 0, @@ -31,8 +35,12 @@ }, "value": { "Address": { - "name": "Ned Freed", - "address": "ned@innosoft.com" + "List": [ + { + "name": "Ned Freed", + "address": "ned@innosoft.com" + } + ] } }, "offset_field": 46, diff --git a/resources/eml/rfc/006.crlf.json b/resources/eml/rfc/006.crlf.json index 27fd552..7cf1891 100644 --- a/resources/eml/rfc/006.crlf.json +++ b/resources/eml/rfc/006.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": null, - "address": "sender@example.com" + "List": [ + { + "name": null, + "address": "sender@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": null, - "address": "recipient@example.com" + "List": [ + { + "name": null, + "address": "recipient@example.com" + } + ] } }, "offset_field": 26, diff --git a/resources/eml/rfc/006.json b/resources/eml/rfc/006.json index eb4d6c2..6656542 100644 --- a/resources/eml/rfc/006.json +++ b/resources/eml/rfc/006.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": null, - "address": "sender@example.com" + "List": [ + { + "name": null, + "address": "sender@example.com" + } + ] } }, "offset_field": 0, @@ -29,8 +33,12 @@ }, "value": { "Address": { - "name": null, - "address": "recipient@example.com" + "List": [ + { + "name": null, + "address": "recipient@example.com" + } + ] } }, "offset_field": 25, diff --git a/resources/eml/rfc/008.crlf.json b/resources/eml/rfc/008.crlf.json index 8ff56fe..d6899e7 100644 --- a/resources/eml/rfc/008.crlf.json +++ b/resources/eml/rfc/008.crlf.json @@ -153,8 +153,12 @@ }, "value": { "Address": { - "name": "email@example.com", - "address": "email@example.com" + "List": [ + { + "name": "email@example.com", + "address": "email@example.com" + } + ] } }, "offset_field": 0, @@ -167,8 +171,12 @@ }, "value": { "Address": { - "name": "Name", - "address": "email@example.com" + "List": [ + { + "name": "Name", + "address": "email@example.com" + } + ] } }, "offset_field": 45, diff --git a/resources/eml/rfc/008.json b/resources/eml/rfc/008.json index d289b57..76b2317 100644 --- a/resources/eml/rfc/008.json +++ b/resources/eml/rfc/008.json @@ -153,8 +153,12 @@ }, "value": { "Address": { - "name": "email@example.com", - "address": "email@example.com" + "List": [ + { + "name": "email@example.com", + "address": "email@example.com" + } + ] } }, "offset_field": 0, @@ -167,8 +171,12 @@ }, "value": { "Address": { - "name": "Name", - "address": "email@example.com" + "List": [ + { + "name": "Name", + "address": "email@example.com" + } + ] } }, "offset_field": 45, diff --git a/resources/eml/rfc/009.crlf.json b/resources/eml/rfc/009.crlf.json index cc3715b..f96abd6 100644 --- a/resources/eml/rfc/009.crlf.json +++ b/resources/eml/rfc/009.crlf.json @@ -17,8 +17,12 @@ }, "value": { "Address": { - "name": "Whomever", - "address": "whoever@example.com" + "List": [ + { + "name": "Whomever", + "address": "whoever@example.com" + } + ] } }, "offset_field": 0, @@ -31,8 +35,12 @@ }, "value": { "Address": { - "name": "Someone", - "address": "someone@example.com" + "List": [ + { + "name": "Someone", + "address": "someone@example.com" + } + ] } }, "offset_field": 38, @@ -236,8 +244,12 @@ }, "value": { "Address": { - "name": "Someone Else", - "address": null + "List": [ + { + "name": "Someone Else", + "address": null + } + ] } }, "offset_field": 606, diff --git a/resources/eml/rfc/009.json b/resources/eml/rfc/009.json index 110cb50..284e546 100644 --- a/resources/eml/rfc/009.json +++ b/resources/eml/rfc/009.json @@ -17,8 +17,12 @@ }, "value": { "Address": { - "name": "Whomever", - "address": "whoever@example.com" + "List": [ + { + "name": "Whomever", + "address": "whoever@example.com" + } + ] } }, "offset_field": 0, @@ -31,8 +35,12 @@ }, "value": { "Address": { - "name": "Someone", - "address": "someone@example.com" + "List": [ + { + "name": "Someone", + "address": "someone@example.com" + } + ] } }, "offset_field": 37, @@ -236,8 +244,12 @@ }, "value": { "Address": { - "name": "Someone Else", - "address": null + "List": [ + { + "name": "Someone Else", + "address": null + } + ] } }, "offset_field": 576, diff --git a/resources/eml/thirdparty/007.crlf.json b/resources/eml/thirdparty/007.crlf.json index 87a4347..c03ad6f 100644 --- a/resources/eml/thirdparty/007.crlf.json +++ b/resources/eml/thirdparty/007.crlf.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Moderator-Address", - "address": "moderator" + "List": [ + { + "name": "Moderator-Address", + "address": "moderator" + } + ] } }, "offset_field": 0, @@ -77,8 +81,12 @@ }, "value": { "Address": { - "name": "someone-else", - "address": "someone@else" + "List": [ + { + "name": "someone-else", + "address": "someone@else" + } + ] } }, "offset_field": 93, @@ -133,8 +141,12 @@ }, "value": { "Address": { - "name": "another one", - "address": "another@one" + "List": [ + { + "name": "another one", + "address": "another@one" + } + ] } }, "offset_field": 178, @@ -191,8 +203,12 @@ }, "value": { "Address": { - "name": "attachment", - "address": "attachment@user" + "List": [ + { + "name": "attachment", + "address": "attachment@user" + } + ] } }, "offset_field": 264, diff --git a/resources/eml/thirdparty/007.json b/resources/eml/thirdparty/007.json index 1bff4ee..00bee00 100644 --- a/resources/eml/thirdparty/007.json +++ b/resources/eml/thirdparty/007.json @@ -15,8 +15,12 @@ }, "value": { "Address": { - "name": "Moderator-Address", - "address": "moderator" + "List": [ + { + "name": "Moderator-Address", + "address": "moderator" + } + ] } }, "offset_field": 0, @@ -77,8 +81,12 @@ }, "value": { "Address": { - "name": "someone-else", - "address": "someone@else" + "List": [ + { + "name": "someone-else", + "address": "someone@else" + } + ] } }, "offset_field": 87, @@ -133,8 +141,12 @@ }, "value": { "Address": { - "name": "another one", - "address": "another@one" + "List": [ + { + "name": "another one", + "address": "another@one" + } + ] } }, "offset_field": 166, @@ -191,8 +203,12 @@ }, "value": { "Address": { - "name": "attachment", - "address": "attachment@user" + "List": [ + { + "name": "attachment", + "address": "attachment@user" + } + ] } }, "offset_field": 246, diff --git a/resources/eml/thirdparty/008.crlf.json b/resources/eml/thirdparty/008.crlf.json index 8ed6677..e7aef31 100644 --- a/resources/eml/thirdparty/008.crlf.json +++ b/resources/eml/thirdparty/008.crlf.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": null, - "address": "user@domain.org" + "List": [ + { + "name": null, + "address": "user@domain.org" + } + ] } }, "offset_field": 0, @@ -162,8 +166,12 @@ }, "value": { "Address": { - "name": null, - "address": "sub@domain.org" + "List": [ + { + "name": null, + "address": "sub@domain.org" + } + ] } }, "offset_field": 267, diff --git a/resources/eml/thirdparty/008.json b/resources/eml/thirdparty/008.json index e336628..e064e60 100644 --- a/resources/eml/thirdparty/008.json +++ b/resources/eml/thirdparty/008.json @@ -18,8 +18,12 @@ }, "value": { "Address": { - "name": null, - "address": "user@domain.org" + "List": [ + { + "name": null, + "address": "user@domain.org" + } + ] } }, "offset_field": 0, @@ -162,8 +166,12 @@ }, "value": { "Address": { - "name": null, - "address": "sub@domain.org" + "List": [ + { + "name": null, + "address": "sub@domain.org" + } + ] } }, "offset_field": 252, diff --git a/resources/eml/thirdparty/011.crlf.json b/resources/eml/thirdparty/011.crlf.json index 6522526..2f74816 100644 --- a/resources/eml/thirdparty/011.crlf.json +++ b/resources/eml/thirdparty/011.crlf.json @@ -38,7 +38,27 @@ "Rfc": "received" }, "value": { - "Text": "from [10.1.1.1] (Unknown [10.1.1.1])\r\n\tby xyz-webserver.abcd-gestion.com with ESMTPA\r\n\t; Mon, 18 Jul 2022 08:19:52 -0700" + "Received": { + "from": { + "IpAddr": "10.1.1.1" + }, + "from_ip": "10.1.1.1", + "by": { + "Name": "xyz-webserver.abcd-gestion.com" + }, + "with": "ESMTPA", + "date": { + "year": 2022, + "month": 7, + "day": 18, + "hour": 8, + "minute": 19, + "second": 52, + "tz_before_gmt": true, + "tz_hour": 7, + "tz_minute": 0 + } + } }, "offset_field": 107, "offset_start": 116, @@ -135,8 +155,12 @@ }, "value": { "Address": { - "name": "admin xyz", - "address": "admin@xyz-webserver.abcd-gestion.local" + "List": [ + { + "name": "admin xyz", + "address": "admin@xyz-webserver.abcd-gestion.local" + } + ] } }, "offset_field": 593, @@ -149,8 +173,12 @@ }, "value": { "Address": { - "name": "Dummy", - "address": "dummy@xyz-webserver.abcd-gestion.local" + "List": [ + { + "name": "Dummy", + "address": "dummy@xyz-webserver.abcd-gestion.local" + } + ] } }, "offset_field": 649, diff --git a/resources/eml/thirdparty/011.json b/resources/eml/thirdparty/011.json index 3e343ac..627618b 100644 --- a/resources/eml/thirdparty/011.json +++ b/resources/eml/thirdparty/011.json @@ -38,7 +38,27 @@ "Rfc": "received" }, "value": { - "Text": "from [10.1.1.1] (Unknown [10.1.1.1])\n\tby xyz-webserver.abcd-gestion.com with ESMTPA\n\t; Mon, 18 Jul 2022 08:19:52 -0700" + "Received": { + "from": { + "IpAddr": "10.1.1.1" + }, + "from_ip": "10.1.1.1", + "by": { + "Name": "xyz-webserver.abcd-gestion.com" + }, + "with": "ESMTPA", + "date": { + "year": 2022, + "month": 7, + "day": 18, + "hour": 8, + "minute": 19, + "second": 52, + "tz_before_gmt": true, + "tz_hour": 7, + "tz_minute": 0 + } + } }, "offset_field": 105, "offset_start": 114, @@ -135,8 +155,12 @@ }, "value": { "Address": { - "name": "admin xyz", - "address": "admin@xyz-webserver.abcd-gestion.local" + "List": [ + { + "name": "admin xyz", + "address": "admin@xyz-webserver.abcd-gestion.local" + } + ] } }, "offset_field": 580, @@ -149,8 +173,12 @@ }, "value": { "Address": { - "name": "Dummy", - "address": "dummy@xyz-webserver.abcd-gestion.local" + "List": [ + { + "name": "Dummy", + "address": "dummy@xyz-webserver.abcd-gestion.local" + } + ] } }, "offset_field": 635, diff --git a/resources/eml/thirdparty/012.crlf.json b/resources/eml/thirdparty/012.crlf.json index d7f9e33..8194629 100644 --- a/resources/eml/thirdparty/012.crlf.json +++ b/resources/eml/thirdparty/012.crlf.json @@ -14,8 +14,12 @@ }, "value": { "Address": { - "name": null, - "address": "user@domain.org" + "List": [ + { + "name": null, + "address": "user@domain.org" + } + ] } }, "offset_field": 0, @@ -154,8 +158,12 @@ }, "value": { "Address": { - "name": null, - "address": "sub@domain.org" + "List": [ + { + "name": null, + "address": "sub@domain.org" + } + ] } }, "offset_field": 269, diff --git a/resources/eml/thirdparty/012.json b/resources/eml/thirdparty/012.json index 62dc1fc..a6b481c 100644 --- a/resources/eml/thirdparty/012.json +++ b/resources/eml/thirdparty/012.json @@ -14,8 +14,12 @@ }, "value": { "Address": { - "name": null, - "address": "user@domain.org" + "List": [ + { + "name": null, + "address": "user@domain.org" + } + ] } }, "offset_field": 0, @@ -154,8 +158,12 @@ }, "value": { "Address": { - "name": null, - "address": "sub@domain.org" + "List": [ + { + "name": null, + "address": "sub@domain.org" + } + ] } }, "offset_field": 253, diff --git a/resources/id.json b/resources/id.json new file mode 100644 index 0000000..382a099 --- /dev/null +++ b/resources/id.json @@ -0,0 +1,68 @@ +[ + { + "header": "<1234@local.machine.example>\n", + "expected": [ + "1234@local.machine.example" + ] + }, + { + "header": "<1234@local.machine.example> <3456@example.net>\n", + "expected": [ + "1234@local.machine.example", + "3456@example.net" + ] + }, + { + "header": "<1234@local.machine.example>\n <3456@example.net> \n", + "expected": [ + "1234@local.machine.example", + "3456@example.net" + ] + }, + { + "header": "<1234@local.machine.example>\n\n <3456@example.net>\n", + "expected": [ + "1234@local.machine.example" + ] + }, + { + "header": " \n", + "expected": [ + "testabcd.1234@silly.test" + ] + }, + { + "header": "<5678.21-Nov-1997@example.com>\n", + "expected": [ + "5678.21-Nov-1997@example.com" + ] + }, + { + "header": "<1234 @ local(blah) .machine .example>\n", + "expected": [ + "1234 @ local(blah) .machine .example" + ] + }, + { + "header": "<>\n", + "expected": null + }, + { + "header": "malformed@id.machine.example\n", + "expected": [ + "malformed@id.machine.example" + ] + }, + { + "header": " malformed2@id.machine.example \t \n", + "expected": [ + "malformed2@id.machine.example" + ] + }, + { + "header": " m \n", + "expected": [ + "m" + ] + } +] \ No newline at end of file diff --git a/resources/list.json b/resources/list.json new file mode 100644 index 0000000..b36be8e --- /dev/null +++ b/resources/list.json @@ -0,0 +1,59 @@ +[ + { + "header": " one item \n", + "expected": [ + "one item" + ] + }, + { + "header": "simple, list\n", + "expected": [ + "simple", + "list" + ] + }, + { + "header": "multi \r\n list, \r\n with, cr lf \r\n", + "expected": [ + "multi list", + "with", + "cr lf" + ] + }, + { + "header": "=?iso-8859-1?q?this is some text?=, in, a, list, \n", + "expected": [ + "this is some text", + "in", + "a", + "list" + ] + }, + { + "header": " =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\n =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\n , but, in a list, which, is, more, fun!\n", + "expected": [ + "If you can read this you understand the example.", + "but", + "in a list", + "which", + "is", + "more", + "fun!" + ] + }, + { + "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n , listed\n", + "expected": [ + "ab", + "listed" + ] + }, + { + "header": "ハロー・ワールド, and also, ascii terms\n", + "expected": [ + "ハロー・ワールド", + "and also", + "ascii terms" + ] + } +] \ No newline at end of file diff --git a/resources/unstructured.json b/resources/unstructured.json new file mode 100644 index 0000000..d68ea06 --- /dev/null +++ b/resources/unstructured.json @@ -0,0 +1,122 @@ +[ + { + "header": "Saying Hello\n", + "expected": "Saying Hello" + }, + { + "header": "Re: Saying Hello\r\n", + "expected": "Re: Saying Hello" + }, + { + "header": " Fwd: \n\tSaying \n Hello\r\n", + "expected": "Fwd: Saying Hello" + }, + { + "header": " FWD: \n Saying Hello \nX-Mailer: 123\r\n", + "expected": "FWD: Saying Hello" + }, + { + "header": " from x.y.test\n by example.net\n via TCP\n with ESMTP\n id ABC12345\n for ; 21 Nov 1997 10:05:43 -0600\n", + "expected": "from x.y.test by example.net via TCP with ESMTP id ABC12345 for ; 21 Nov 1997 10:05:43 -0600" + }, + { + "header": "=?iso-8859-1?q?this is some text?=\n", + "expected": "this is some text" + }, + { + "header": "=?iso-8859-1?q?this=20is=20some=20text?=\r\n", + "expected": "this is some text" + }, + { + "header": " =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\n =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\n", + "expected": "If you can read this you understand the example." + }, + { + "header": " =?ISO-8859-1?Q?a?=\n", + "expected": "a" + }, + { + "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n", + "expected": "ab" + }, + { + "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n", + "expected": "ab" + }, + { + "header": "=?ISO-8859-1?Q?a?=\r\n =?ISO-8859-1?Q?b?=\nFrom: unknown@domain.com\n", + "expected": "ab" + }, + { + "header": "=?ISO-8859-1?Q?a_b?=\n", + "expected": "a b" + }, + { + "header": "=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=\r\n", + "expected": "a b" + }, + { + "header": " this =?iso-8859-1?q?is?= some =?iso-8859-1?q?t?=\n =?iso-8859-1?q?e?= \n =?iso-8859-1?q?x?=\n =?iso-8859-1?q?t?=\n", + "expected": "this is some text" + }, + { + "header": " =\n", + "expected": "=" + }, + { + "header": " =? \n", + "expected": "=?" + }, + { + "header": "=?utf-8 \n", + "expected": "=?utf-8" + }, + { + "header": "=?utf-8? \n", + "expected": "=?utf-8?" + }, + { + "header": " let's = try =?iso-8859-1? to break\n =? the \n parser\n", + "expected": "let's = try =?iso-8859-1? to break =? the parser" + }, + { + "header": "ハロー・ワールド \n", + "expected": "ハロー・ワールド" + }, + { + "header": "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb3JpZ2luYWwgc3ViamVjdA==?=\n", + "expected": "[SUSPECTED SPAM] This is the original subject" + }, + { + "header": "Some text =?utf-8?Q??=here\n", + "expected": "Some text here" + }, + { + "header": "=?ISO-8859-1?Q?a?==?ISO-8859-1?Q?b?==?ISO-8859-1?Q?c?= =?ISO-8859-1?Q?d?=\n", + "expected": "abcd" + }, + { + "header": "=?utf-8?Q?Hello\n _there!?=\n", + "expected": "Hello there!" + }, + { + "header": "=?utf-8?Q?Hello\r\n _there!?=\r\n", + "expected": "Hello there!" + }, + { + "header": "=?utf-8?Q?Hello\r\n \t _there!?=\r\n", + "expected": "Hello there!" + }, + { + "header": "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb\n 3JpZ2luYWwgc3ViamVjdA==?=\n", + "expected": "[SUSPECTED SPAM] This is the original subject" + }, + { + "header": "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb\r\n 3JpZ2luYWwgc3ViamVjdA==?=\r\n", + "expected": "[SUSPECTED SPAM] This is the original subject" + }, + { + "header": "Les Communs - =?utf-8?Q?R=C3=A9capitulatif?= de la\r\n =?utf-8?Q?r=C3=A9servation?= 13510164434879\r\n", + "expected": "Les Communs - Récapitulatif de la réservation 13510164434879" + } +] \ No newline at end of file diff --git a/src/core/address.rs b/src/core/address.rs index 6d12b73..a77dbfd 100644 --- a/src/core/address.rs +++ b/src/core/address.rs @@ -9,7 +9,90 @@ * except according to those terms. */ -use crate::{Addr, Group}; +use crate::{Addr, Address, Group}; + +impl<'x> Address<'x> { + /// Returns the first address in the list, or the first address in the first group. + pub fn first(&self) -> Option<&Addr<'x>> { + match self { + Address::List(list) => list.first(), + Address::Group(group) => group.iter().flat_map(|group| group.addresses.iter()).next(), + } + } + + /// Returns the last address in the list, or the last address in the last group. + pub fn last(&self) -> Option<&Addr<'x>> { + match self { + Address::List(list) => list.last(), + Address::Group(group) => group + .iter() + .flat_map(|group| group.addresses.iter()) + .next_back(), + } + } + + /// Converts the address into a list of `Addr`. + pub fn into_list(self) -> Vec> { + match self { + Address::List(list) => list, + Address::Group(group) => group + .into_iter() + .flat_map(|group| group.addresses) + .collect(), + } + } + + /// Converts the address into a group of `Addr`. + pub fn into_group(self) -> Vec> { + match self { + Address::List(list) => list + .into_iter() + .map(|addr| Group { + name: None, + addresses: vec![addr], + }) + .collect(), + Address::Group(group) => group, + } + } + + /// Returns the list of addresses, or `None` if the address is a group. + pub fn as_list(&self) -> Option<&[Addr<'x>]> { + match self { + Address::List(list) => Some(list), + Address::Group(_) => None, + } + } + + /// Returns the group of addresses, or `None` if the address is a list. + pub fn as_group(&self) -> Option<&[Group<'x>]> { + match self { + Address::List(_) => None, + Address::Group(group) => Some(group), + } + } + + /// Returns an iterator over the addresses in the list, or the addresses in the groups. + pub fn iter<'y: 'x>(&'y self) -> Box> + 'x> { + match self { + Address::List(list) => Box::new(list.iter()), + Address::Group(group) => { + Box::new(group.iter().flat_map(|group| group.addresses.iter())) + } + } + } + + pub fn into_owned(self) -> Address<'static> { + match self { + Address::List(list) => { + Address::List(list.into_iter().map(|addr| addr.into_owned()).collect()) + } + Address::Group(list) => { + Address::Group(list.into_iter().map(|group| group.into_owned()).collect()) + } + } + } +} impl<'x> Group<'x> { pub fn new(name: &'x str, addresses: Vec>) -> Self { diff --git a/src/core/header.rs b/src/core/header.rs index 34155ee..4a521f4 100644 --- a/src/core/header.rs +++ b/src/core/header.rs @@ -14,8 +14,8 @@ use std::hash::Hash; use std::{borrow::Cow, fmt::Display}; use crate::{ - ContentType, DateTime, GetHeader, Header, HeaderName, HeaderValue, Host, Message, MessagePart, - MessagePartId, MimeHeaders, PartType, Received, RfcHeader, + Address, ContentType, DateTime, GetHeader, Header, HeaderName, HeaderValue, Host, Message, + MessagePart, MessagePartId, MimeHeaders, PartType, Received, RfcHeader, }; impl<'x> Header<'x> { @@ -68,6 +68,14 @@ impl<'x> HeaderValue<'x> { } } + pub fn unwrap_text_list(self) -> Vec> { + match self { + HeaderValue::TextList(l) => l, + HeaderValue::Text(s) => vec![s], + _ => panic!("HeaderValue::unwrap_text_list called on non-TextList value"), + } + } + pub fn unwrap_datetime(self) -> DateTime { match self { HeaderValue::DateTime(d) => d, @@ -75,6 +83,13 @@ impl<'x> HeaderValue<'x> { } } + pub fn unwrap_address(self) -> Address<'x> { + match self { + HeaderValue::Address(a) => a, + _ => panic!("HeaderValue::unwrap_address called on non-Address value"), + } + } + pub fn unwrap_content_type(self) -> ContentType<'x> { match self { HeaderValue::ContentType(c) => c, @@ -89,6 +104,49 @@ impl<'x> HeaderValue<'x> { } } + pub fn into_text(self) -> Option> { + match self { + HeaderValue::Text(s) => Some(s), + _ => None, + } + } + + pub fn into_text_list(self) -> Option>> { + match self { + HeaderValue::Text(s) => Some(vec![s]), + HeaderValue::TextList(l) => Some(l), + _ => None, + } + } + + pub fn into_address(self) -> Option> { + match self { + HeaderValue::Address(a) => Some(a), + _ => None, + } + } + + pub fn into_datetime(self) -> Option { + match self { + HeaderValue::DateTime(d) => Some(d), + _ => None, + } + } + + pub fn into_content_type(self) -> Option> { + match self { + HeaderValue::ContentType(c) => Some(c), + _ => None, + } + } + + pub fn into_received(self) -> Option> { + match self { + HeaderValue::Received(r) => Some(*r), + _ => None, + } + } + pub fn as_text(&self) -> Option<&str> { match *self { HeaderValue::Text(ref s) => Some(s), @@ -105,6 +163,20 @@ impl<'x> HeaderValue<'x> { } } + pub fn address(&self) -> &Address<'x> { + match *self { + HeaderValue::Address(ref a) => a, + _ => panic!("HeaderValue::address called on non-Address: {:?}", self), + } + } + + pub fn as_address(&self) -> Option<&Address<'x>> { + match *self { + HeaderValue::Address(ref a) => Some(a), + _ => None, + } + } + pub fn as_received(&self) -> Option<&Received> { match *self { HeaderValue::Received(ref r) => Some(r), @@ -122,14 +194,14 @@ impl<'x> HeaderValue<'x> { } } - pub fn as_content_type_ref(&self) -> Option<&ContentType> { + pub fn as_content_type(&self) -> Option<&ContentType> { match *self { HeaderValue::ContentType(ref c) => Some(c), _ => None, } } - pub fn as_datetime_ref(&self) -> Option<&DateTime> { + pub fn as_datetime(&self) -> Option<&DateTime> { match *self { HeaderValue::DateTime(ref d) => Some(d), _ => None, @@ -139,13 +211,6 @@ impl<'x> HeaderValue<'x> { pub fn into_owned(self) -> HeaderValue<'static> { match self { HeaderValue::Address(addr) => HeaderValue::Address(addr.into_owned()), - HeaderValue::AddressList(list) => { - HeaderValue::AddressList(list.into_iter().map(|addr| addr.into_owned()).collect()) - } - HeaderValue::Group(group) => HeaderValue::Group(group.into_owned()), - HeaderValue::GroupList(list) => { - HeaderValue::GroupList(list.into_iter().map(|group| group.into_owned()).collect()) - } HeaderValue::Text(text) => HeaderValue::Text(text.into_owned().into()), HeaderValue::TextList(list) => HeaderValue::TextList( list.into_iter() @@ -172,25 +237,14 @@ impl<'x> HeaderValue<'x> { match self { HeaderValue::Text(text) => text.len(), HeaderValue::TextList(list) => list.iter().map(|t| t.len()).sum(), - HeaderValue::Address(a) => { - a.name.as_ref().map_or(0, |a| a.len()) + a.address.as_ref().map_or(0, |a| a.len()) - } - HeaderValue::AddressList(list) => list + HeaderValue::Address(Address::List(list)) => list .iter() .map(|a| { a.name.as_ref().map_or(0, |a| a.len()) + a.address.as_ref().map_or(0, |a| a.len()) }) .sum(), - HeaderValue::Group(group) => group - .addresses - .iter() - .map(|a| { - a.name.as_ref().map_or(0, |a| a.len()) - + a.address.as_ref().map_or(0, |a| a.len()) - }) - .sum(), - HeaderValue::GroupList(grouplist) => grouplist + HeaderValue::Address(Address::Group(grouplist)) => grouplist .iter() .flat_map(|g| g.addresses.iter()) .map(|a| { @@ -403,7 +457,7 @@ impl<'x> MimeHeaders<'x> for Message<'x> { self.parts[0] .headers .rfc(&RfcHeader::ContentDisposition) - .and_then(|header| header.as_content_type_ref()) + .and_then(|header| header.as_content_type()) } fn content_id(&self) -> Option<&str> { @@ -424,7 +478,7 @@ impl<'x> MimeHeaders<'x> for Message<'x> { self.parts[0] .headers .rfc(&RfcHeader::ContentType) - .and_then(|header| header.as_content_type_ref()) + .and_then(|header| header.as_content_type()) } fn content_language(&self) -> &HeaderValue { @@ -585,7 +639,7 @@ impl<'x> MimeHeaders<'x> for MessagePart<'x> { fn content_disposition(&self) -> Option<&ContentType> { self.headers .rfc(&RfcHeader::ContentDisposition) - .and_then(|header| header.as_content_type_ref()) + .and_then(|header| header.as_content_type()) } fn content_id(&self) -> Option<&str> { @@ -603,7 +657,7 @@ impl<'x> MimeHeaders<'x> for MessagePart<'x> { fn content_type(&self) -> Option<&ContentType> { self.headers .rfc(&RfcHeader::ContentType) - .and_then(|header| header.as_content_type_ref()) + .and_then(|header| header.as_content_type()) } fn content_language(&self) -> &HeaderValue { diff --git a/src/core/message.rs b/src/core/message.rs index f3eb668..aa1fd0f 100644 --- a/src/core/message.rs +++ b/src/core/message.rs @@ -18,8 +18,8 @@ use crate::{ preview::{preview_html, preview_text}, MessageStream, }, - AttachmentIterator, BodyPartIterator, DateTime, GetHeader, Header, HeaderForm, HeaderName, - HeaderValue, Message, MessagePart, PartType, RfcHeader, + Address, AttachmentIterator, BodyPartIterator, DateTime, GetHeader, Header, HeaderForm, + HeaderName, HeaderValue, Message, MessagePart, PartType, RfcHeader, }; impl<'x> Message<'x> { @@ -126,19 +126,19 @@ impl<'x> Message<'x> { } /// Returns the BCC header field - pub fn bcc(&self) -> &HeaderValue { + pub fn bcc<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::Bcc) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns the CC header field - pub fn cc(&self) -> &HeaderValue { + pub fn cc<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::Cc) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns all Comments header fields @@ -154,15 +154,15 @@ impl<'x> Message<'x> { self.parts[0] .headers .rfc(&RfcHeader::Date) - .and_then(|header| header.as_datetime_ref()) + .and_then(|header| header.as_datetime()) } /// Returns the From header field - pub fn from(&self) -> &HeaderValue { + pub fn from<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::From) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns all In-Reply-To header fields @@ -270,27 +270,27 @@ impl<'x> Message<'x> { } /// Returns the Reply-To header field - pub fn reply_to(&self) -> &HeaderValue { + pub fn reply_to<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::ReplyTo) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns the Resent-BCC header field - pub fn resent_bcc(&self) -> &HeaderValue { + pub fn resent_bcc<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::ResentBcc) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns the Resent-CC header field - pub fn resent_cc(&self) -> &HeaderValue { + pub fn resent_cc<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::ResentTo) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns all Resent-Date header fields @@ -302,11 +302,11 @@ impl<'x> Message<'x> { } /// Returns the Resent-From header field - pub fn resent_from(&self) -> &HeaderValue { + pub fn resent_from<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::ResentFrom) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns all Resent-Message-ID header fields @@ -318,19 +318,19 @@ impl<'x> Message<'x> { } /// Returns the Sender header field - pub fn resent_sender(&self) -> &HeaderValue { + pub fn resent_sender<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::ResentSender) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns the Resent-To header field - pub fn resent_to(&self) -> &HeaderValue { + pub fn resent_to<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::ResentTo) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns all Return-Path header fields @@ -348,21 +348,18 @@ impl<'x> Message<'x> { Some(HeaderValue::Text(text)) => Some(text.as_ref()), Some(HeaderValue::TextList(text_list)) => text_list.last().map(|t| t.as_ref()), _ => match self.parts[0].headers.rfc(&RfcHeader::From) { - Some(HeaderValue::Address(addr)) => addr.address.as_deref(), - Some(HeaderValue::AddressList(addr_list)) => { - addr_list.last().and_then(|a| a.address.as_deref()) - } + Some(HeaderValue::Address(addr)) => addr.first()?.address.as_deref(), _ => None, }, } } /// Returns the Sender header field - pub fn sender(&self) -> &HeaderValue { + pub fn sender<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::Sender) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns the Subject header field @@ -380,11 +377,11 @@ impl<'x> Message<'x> { } /// Returns the To header field - pub fn to(&self) -> &HeaderValue { + pub fn to<'y: 'x>(&'y self) -> Option<&Address<'x>> { self.parts[0] .headers .rfc(&RfcHeader::To) - .unwrap_or(&HeaderValue::Empty) + .and_then(|a| a.as_address()) } /// Returns a preview of the message body diff --git a/src/lib.rs b/src/lib.rs index 0f36980..ca52b56 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -158,16 +158,16 @@ //! //! // Parses addresses (including comments), lists and groups //! assert_eq!( -//! message.from(), -//! &HeaderValue::Address(Addr::new( +//! message.from().unwrap().first().unwrap(), +//! &Addr::new( //! "Art Vandelay (Vandelay Industries)".into(), //! "art@vandelay.com" -//! )) +//! ) //! ); //! //! assert_eq!( -//! message.to(), -//! &HeaderValue::GroupList(vec![ +//! message.to().unwrap().as_group().unwrap(), +//! &[ //! Group::new( //! "Colleagues", //! vec![Addr::new("James Smythe".into(), "james@vandelay.com")] @@ -179,7 +179,7 @@ //! Addr::new("John Smîth".into(), "john@example.com"), //! ] //! ) -//! ]) +//! ] //! ); //! //! assert_eq!( @@ -376,7 +376,7 @@ pub struct Group<'x> { #[cfg_attr(feature = "serde_support", serde(default))] pub name: Option>, - /// Addressess member of the group + /// Addresses member of the group #[cfg_attr(feature = "serde_support", serde(default))] pub addresses: Vec>, } @@ -448,17 +448,8 @@ pub enum RfcHeader { #[derive(Debug, PartialEq, Eq, Clone, Default)] #[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] pub enum HeaderValue<'x> { - /// Single address - Address(Addr<'x>), - - /// Address list - AddressList(Vec>), - - /// Group of addresses - Group(Group<'x>), - - /// List containing two or more address groups - GroupList(Vec>), + /// Address list or group + Address(Address<'x>), /// String Text(Cow<'x, str>), @@ -479,6 +470,15 @@ pub enum HeaderValue<'x> { Empty, } +#[derive(Debug, PartialEq, Eq, Clone)] +#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] +pub enum Address<'x> { + /// Address list + List(Vec>), + /// Group of addresses + Group(Vec>), +} + /// Header form #[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] pub enum HeaderForm { diff --git a/src/parsers/fields/address.rs b/src/parsers/fields/address.rs index 4332282..ddb6a37 100644 --- a/src/parsers/fields/address.rs +++ b/src/parsers/fields/address.rs @@ -11,7 +11,7 @@ use std::borrow::Cow; -use crate::{parsers::MessageStream, Addr, Group, HeaderValue}; +use crate::{parsers::MessageStream, Addr, Address, Group, HeaderValue}; #[derive(PartialEq, Clone, Copy, Debug)] enum AddressState { @@ -358,17 +358,9 @@ impl<'x> MessageStream<'x> { if parser.group_name.is_some() || !parser.result.is_empty() { parser.add_group(); - if parser.result.len() > 1 { - HeaderValue::GroupList(parser.result) - } else { - HeaderValue::Group(parser.result.pop().unwrap()) - } + HeaderValue::Address(Address::Group(parser.result)) } else if !parser.addresses.is_empty() { - if parser.addresses.len() > 1 { - HeaderValue::AddressList(parser.addresses) - } else { - HeaderValue::Address(parser.addresses.pop().unwrap()) - } + HeaderValue::Address(Address::List(parser.addresses)) } else { HeaderValue::Empty } @@ -470,574 +462,21 @@ pub fn parse_address_detail_part(addr: &str) -> Option<&str> { None } +#[cfg(test)] mod tests { - use super::*; + use crate::parsers::{fields::load_tests, MessageStream}; + #[test] fn parse_addresses() { - use super::*; - let inputs = [ - ( - "John Doe \n", - concat!( - "---\n", - "Address:\n", - " name: John Doe\n", - " address: jdoe@machine.example\n" - ), - ), - ( - " Mary Smith \n", - concat!( - "---\n", - "Address:\n", - " name: Mary Smith\n", - " address: mary@example.net\n" - ), - ), - ( - "\"Joe Q. Public\" \n", - concat!( - "---\n", - "Address:\n", - " name: Joe Q. Public\n", - " address: john.q.public@example.com\n" - ), - ), - ( - "Mary Smith , jdoe@example.org, Who? \n", - concat!( - "---\n", - "AddressList:\n", - " - name: Mary Smith\n", - " address: mary@x.test\n", - " - address: jdoe@example.org\n", - " - name: Who?\n", - " address: one@y.test\n" - ), - ), - ( - ", \"Giant; \\\"Big\\\" Box\" \n", - concat!( - "---\n", - "AddressList:\n", - " - address: boss@nil.test\n", - " - name: \"Giant; \\\"Big\\\" Box\"\n", - " address: sysservices@example.net\n" - ), - ), - ( - "A Group:Ed Jones ,joe@where.test,John ;\n", - concat!( - "---\n", - "Group:\n", - " name: A Group\n", - " addresses:\n", - " - name: Ed Jones\n", - " address: c@a.test\n", - " - address: joe@where.test\n", - " - name: John\n", - " address: jdoe@one.test\n" - ), - ), - ( - "Undisclosed recipients:;\n", - concat!("---\n", "Group:\n", " name: Undisclosed recipients\n"), - ), - ( - "\"Mary Smith: Personal Account\" \n", - concat!( - "---\n", - "Address:\n", - " name: \"Mary Smith: Personal Account\"\n", - " address: smith@home.example\n" - ), - ), - ( - "Pete(A nice \\) chap) \n", - concat!( - "---\n", - "Address:\n", - " name: Pete (A nice ) chap his account his host)\n", - " address: pete@silly.test\n" - ), - ), - ( - "Pete(A nice \n \\\n ) chap) \n", - concat!( - "---\n", - "Address:\n", - " name: Pete (A nice ) chap his account his host)\n", - " address: pete@silly.test\n" - ), - ), - ( - concat!( - "A Group(Some people)\n :Chris Jones ,\n joe@example.org,\n John (my dear", - " friend); (the end of the group)\n" - ), - concat!( - "---\n", - "GroupList:\n", - " - name: A Group (Some people)\n", - " addresses:\n", - " - name: \"Chris Jones (Chris's host.)\"\n", - " address: c@public.example\n", - " - address: joe@example.org\n", - " - name: John (my dear friend)\n", - " address: jdoe@one.test\n", - " - addresses:\n", - " - name: the end of the group\n" - ), - ), - ( - "(Empty list)(start)Hidden recipients :(nobody(that I know)) ;\n", - concat!( - "---\n", - "Group:\n", - " name: Hidden recipients (Empty list start)\n", - " addresses:\n", - " - name: nobody(that I know)\n" - ), - ), - ( - "Joe Q. Public \n", - concat!( - "---\n", - "Address:\n", - " name: Joe Q. Public\n", - " address: john.q.public@example.com\n" - ), - ), - ( - "Mary Smith <@node.test:mary@example.net>, , jdoe@test . example\n", - concat!( - "---\n", - "AddressList:\n", - " - name: Mary Smith\n", - " address: \"@node.test:mary@example.net\"\n", - " - address: jdoe@test . example\n" - ), - ), - ( - "John Doe \n", - concat!( - "---\n", - "Address:\n", - " name: John Doe (comment)\n", - " address: jdoe@machine. example\n" - ), - ), - ( - "Mary Smith\n \n\t\n", - concat!( - "---\n", - "Address:\n", - " name: Mary Smith\n", - " address: mary@example.net\n" - ), - ), - ( - "=?US-ASCII*EN?Q?Keith_Moore?= \n", - concat!( - "---\n", - "Address:\n", - " name: Keith Moore\n", - " address: moore@cs.utk.edu\n" - ), - ), - ( - "John =?US-ASCII*EN?Q?Doe?= \n", - concat!( - "---\n", - "Address:\n", - " name: John Doe\n", - " address: moore@cs.utk.edu\n" - ), - ), - ( - "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= \n", - concat!( - "---\n", - "Address:\n", - " name: Keld Jørn Simonsen\n", - " address: keld@dkuug.dk\n" - ), - ), - ( - "=?ISO-8859-1?Q?Andr=E9?= Pirard \n", - concat!( - "---\n", - "Address:\n", - " name: André Pirard\n", - " address: PIRARD@vm1.ulg.ac.be\n" - ), - ), - ( - "=?ISO-8859-1?Q?Olle_J=E4rnefors?= \n", - concat!( - "---\n", - "Address:\n", - " name: Olle Järnefors\n", - " address: ojarnef@admin.kth.se\n" - ), - ), - ( - "ietf-822@dimacs.rutgers.edu, ojarnef@admin.kth.se\n", - concat!( - "---\n", - "AddressList:\n", - " - address: ietf-822@dimacs.rutgers.edu\n", - " - address: ojarnef@admin.kth.se\n" - ), - ), - ( - concat!( - "Nathaniel Borenstein \n (=?iso-8859-8?b?7e", - "Xs+SDv4SDp7Oj08A==?=)\n" - ), - concat!( - "---\n", - "Address:\n", - " name: Nathaniel Borenstein (םולש ןב ילטפנ)\n", - " address: nsb@thumper.bellcore.com\n" - ), - ), - ( - concat!( - "Greg Vaudreuil , Ned Freed\n , Keith Moore \n" - ), - concat!( - "---\n", - "AddressList:\n", - " - name: Greg Vaudreuil\n", - " address: gvaudre@NRI.Reston.VA.US\n", - " - name: Ned Freed\n", - " address: ned@innosoft.com\n", - " - name: Keith Moore\n", - " address: moore@cs.utk.edu\n" - ), - ), - ( - "=?ISO-8859-1?Q?a?= \n", - concat!( - "---\n", - "Address:\n", - " name: a\n", - " address: test@test.com\n" - ), - ), - ( - "\"=?ISO-8859-1?Q?a?= b\" \n", - concat!( - "---\n", - "Address:\n", - " name: a b\n", - " address: test@test.com\n" - ), - ), - ( - "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?= \n", - concat!( - "---\n", - "Address:\n", - " name: ab\n", - " address: test@test.com\n" - ), - ), - ( - "=?ISO-8859-1?Q?a?=\n =?ISO-8859-1?Q?b?= \n", - concat!( - "---\n", - "Address:\n", - " name: ab\n", - " address: test@test.com\n" - ), - ), - ( - "=?ISO-8859-1?Q?a?= \"=?ISO-8859-2?Q?_b?=\" \n", - concat!( - "---\n", - "Address:\n", - " name: a b\n", - " address: test@test.com\n" - ), - ), - ( - " \n", - concat!("---\n", "Address:\n", " address: test@test.com\n"), - ), - ( - "test@test.com\ninvalid@address.com\n", - concat!("---\n", "Address:\n", " address: test@test.com\n"), - ), - ( - concat!( - "\"=?ISO-8859-1?Q =?ISO-8859-1?Q?a?= \\\" =?ISO-8859-1?Q?b?=\" \n\nbody@content.com" - ), - concat!( - "---\n", - "Address:\n", - " name: \"=?ISO-8859-1?Q a \\\" b\"\n", - " address: last@address.com\n" - ), - ), - ( - "=? \n", - concat!( - "---\n", - "Address:\n", - " name: \"=?\"\n", - " address: name@domain.com\n" - ), - ), - ( - concat!( - "\" James Smythe\" , Friends:\n jane@example.com, =?U", - "TF-8?Q?John_Sm=C3=AEth?=\n ;\n" - ), - concat!( - "---\n", - "GroupList:\n", - " - addresses:\n", - " - name: \" James Smythe\"\n", - " address: james@example.com\n", - " - name: Friends\n", - " addresses:\n", - " - address: jane@example.com\n", - " - name: John Smîth\n", - " address: john@example.com\n" - ), - ), - ( - concat!( - "List 1: addr1@test.com, addr2@test.com; List 2: addr3@test.com, addr4@", - "test.com; addr5@test.com, addr6@test.com\n" - ), - concat!( - "---\n", - "GroupList:\n", - " - name: List 1\n", - " addresses:\n", - " - address: addr1@test.com\n", - " - address: addr2@test.com\n", - " - name: List 2\n", - " addresses:\n", - " - address: addr3@test.com\n", - " - address: addr4@test.com\n", - " - addresses:\n", - " - address: addr5@test.com\n", - " - address: addr6@test.com\n" - ), - ), - ( - concat!( - "\"List 1\": addr1@test.com, addr2@test.com; \"List 2\": addr3@test.com, ad", - "dr4@test.com; addr5@test.com, addr6@test.com\n" - ), - concat!( - "---\n", - "GroupList:\n", - " - name: List 1\n", - " addresses:\n", - " - address: addr1@test.com\n", - " - address: addr2@test.com\n", - " - name: List 2\n", - " addresses:\n", - " - address: addr3@test.com\n", - " - address: addr4@test.com\n", - " - addresses:\n", - " - address: addr5@test.com\n", - " - address: addr6@test.com\n" - ), - ), - ( - concat!( - "\"=?utf-8?b?VGjDrXMgw61zIHbDoWzDrWQgw5pURjg=?=\": addr1@test.com, addr2@", - "test.com; =?utf-8?b?VGjDrXMgw61zIHbDoWzDrWQgw5pURjg=?=: addr3@test.com", - ", addr4@test.com; addr5@test.com, addr6@test.com\n" - ), - concat!( - "---\n", - "GroupList:\n", - " - name: Thís ís válíd ÚTF8\n", - " addresses:\n", - " - address: addr1@test.com\n", - " - address: addr2@test.com\n", - " - name: Thís ís válíd ÚTF8\n", - " addresses:\n", - " - address: addr3@test.com\n", - " - address: addr4@test.com\n", - " - addresses:\n", - " - address: addr5@test.com\n", - " - address: addr6@test.com\n" - ), - ), - ( - " (Web Archive)\n", - concat!( - "---\n", - "Address:\n", - " name: Web Archive\n", - " address: \"http://www.host.com/list/archive/\"\n" - ), - ), - ( - "\n", - concat!( - "---\n", - "Address:\n", - " address: \"mailto:archive@host.com?subject=index%20list\"\n" - ), - ), - ( - " (Postings are Moderated)\n", - concat!( - "---\n", - "Address:\n", - " name: Postings are Moderated\n", - " address: \"mailto:moderator@host.com\"\n" - ), - ), - ( - concat!( - "(Use this command to join the list)\n \n" - ), - concat!( - "---\n", - "Address:\n", - " name: Use this command to join the list\n", - " address: \"mailto:list-manager@host.com?body=subscribe%20list\"\n" - ), - ), - ( - concat!( - ",\n \n" - ), - concat!( - "---\n", - "AddressList:\n", - " - address: \"http://www.host.com/list.cgi?cmd=sub&lst=list\"\n", - " - address: \"mailto:list-manager@host.com?body=subscribe%20list\"\n" - ), - ), - ( - "NO (posting not allowed on this list)\n", - concat!( - "---\n", - "Address:\n", - " name: posting not allowed on this list\n", - " address: \"NO\"\n" - ), - ), - ( - concat!( - " (FTP),\n \n" - ), - concat!( - "---\n", - "AddressList:\n", - " - name: FTP\n", - " address: \"ftp://ftp.host.com/list.txt\"\n", - " - address: \"mailto:list@host.com?subject=help\"\n" - ), - ), - ( - ", \n", - concat!( - "---\n", - "AddressList:\n", - " - address: \"http://www.host.com/list/\"\n", - " - address: \"mailto:list-info@host.com\"\n" - ), - ), - ( - concat!( - "(Use this command to get off the list)\n \n" - ), - concat!( - "---\n", - "Address:\n", - " name: Use this command to get off the list\n", - " address: \"mailto:list-manager@host.com?body=unsubscribe%20list\"\n" - ), - ), - ( - concat!( - ",\n \n" - ), - concat!( - "---\n", - "AddressList:\n", - " - address: \"http://www.host.com/list.cgi?cmd=unsub&lst=list\"\n", - " - address: \"mailto:list-request@host.com?subject=unsubscribe\"\n" - ), - ), - ( - " (Contact Person for Help)\n", - concat!( - "---\n", - "Address:\n", - " name: Contact Person for Help\n", - " address: \"mailto:listmom@host.com\"\n" - ), - ), - ( - r#""\\\\\\\\S. NIG\\\\\\\\" "#, - concat!( - "---\n", - "Address:\n", - " name: \"\\\\\\\\\\\\\\\\S. NIG\\\\\\\\\\\\\\\\\"\n", - " address: first.last@host.com\n", - ), - ), - ]; - - let mut builder = crate::parsers::fields::TestBuilder::new("address.json"); - - for input in inputs { - let str = input.0.to_string(); - let result = MessageStream::new(str.as_bytes()).parse_address(); - let expected: HeaderValue = serde_yaml::from_str(input.1).unwrap_or(HeaderValue::Empty); - - /*if input.0.len() >= 70 { - println!( - "(concat!({:?}), concat!({:?})),", - input - .0 - .chars() - .collect::>() - .chunks(70) - .map(|c| c.iter().collect::()) - .collect::>(), - serde_yaml::to_string(&result) - .unwrap_or("".to_string()) - .split_inclusive("\n") - .collect::>() - ); - } else { - println!( - "({:?}, concat!({:?})),", - input.0, - serde_yaml::to_string(&result) - .unwrap_or("".to_string()) - .split_inclusive("\n") - .collect::>() - ); - }*/ - - assert_eq!(result, expected, "Failed for '{:?}'", input.0); - - builder.add(str, expected); + for test in load_tests("address.json") { + assert_eq!( + MessageStream::new(test.header.as_bytes()) + .parse_address() + .unwrap_address(), + test.expected, + "failed for {:?}", + test.header + ); } - - builder.write(); } } diff --git a/src/parsers/fields/content_type.rs b/src/parsers/fields/content_type.rs index 0a7b517..c02cb17 100644 --- a/src/parsers/fields/content_type.rs +++ b/src/parsers/fields/content_type.rs @@ -514,1101 +514,32 @@ impl<'x> MessageStream<'x> { } #[cfg(test)] mod tests { - use std::{borrow::Cow, collections::HashMap}; - - use serde::{Deserialize, Serialize}; - - use crate::{parsers::MessageStream, HeaderValue}; - - #[derive(Serialize, Deserialize, PartialEq, Eq, Debug)] - pub struct ContentTypeMap<'x> { - pub c_type: Cow<'x, str>, - pub c_subtype: Option>, - pub attributes: Option, Cow<'x, str>>>, - } - - #[derive(Serialize, Deserialize, PartialEq, Eq, Debug)] - pub enum HeaderValueMap<'x> { - ContentType(ContentTypeMap<'x>), - Empty, - } + use crate::parsers::{fields::load_tests, MessageStream}; #[test] fn parse_content_fields() { - let inputs = - [ - ( - "audio/basic\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: audio\n", - " c_subtype: basic\n" - ), - ), - ( - "application/postscript \n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: postscript\n" - ), - ), - ( - "image/ jpeg\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: image\n", - " c_subtype: jpeg\n" - ), - ), - ( - " message / rfc822\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: rfc822\n" - ), - ), - ( - "inline\n", - concat!("---\n", "ContentType:\n", " c_type: inline\n"), - ), - ( - " text/plain; charset =us-ascii (Plain text)\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "text/plain; charset= \"us-ascii\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "text/plain; charset =ISO-8859-1\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " charset: ISO-8859-1\n" - ), - ), - ( - "text/foo; charset= bar\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: foo\n", - " attributes:\n", - " charset: bar\n" - ), - ), - ( - " text /plain; charset=\"iso-8859-1\"; format=flowed\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " charset: iso-8859-1\n", - " format: flowed\n" - ), - ), - ( - "application/pgp-signature; x-mac-type=70674453;\n name=PGP.sig\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: pgp-signature\n", - " attributes:\n", - " name: PGP.sig\n", - " x-mac-type: \"70674453\"\n" - ), - ), - ( - "multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: mixed\n", - " attributes:\n", - " boundary: gc0p4Jq0M2Yt08j34c0p\n" - ), - ), - ( - "multipart/mixed; boundary=gc0pJq0M:08jU534c0p\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: mixed\n", - " attributes:\n", - " boundary: \"gc0pJq0M:08jU534c0p\"\n" - ), - ), - ( - "multipart/mixed; boundary=\"gc0pJq0M:08jU534c0p\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: mixed\n", - " attributes:\n", - " boundary: \"gc0pJq0M:08jU534c0p\"\n" - ), - ), - ( - "multipart/mixed; boundary=\"simple boundary\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: mixed\n", - " attributes:\n", - " boundary: simple boundary\n" - ), - ), - ( - "multipart/mixed; boundary=\"foo\n bar\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: mixed\n", - " attributes:\n", - " boundary: \"foo bar\"\n" - ), - ), - ( - "multipart/alternative; boundary=boundary42\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: alternative\n", - " attributes:\n", - " boundary: boundary42\n" - ), - ), - ( - " multipart/mixed;\n boundary=\"---- main boundary ----\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: mixed\n", - " attributes:\n", - " boundary: \"---- main boundary ----\"\n" - ), - ), - ( - "multipart/alternative; boundary=42\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: alternative\n", - " attributes:\n", - " boundary: \"42\"\n" - ), - ), - ( - "message/partial; id=\"ABC@host.com\";\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: partial\n", - " attributes:\n", - " id: ABC@host.com\n" - ), - ), - ( - "multipart/parallel;boundary=unique-boundary-2\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: parallel\n", - " attributes:\n", - " boundary: unique-boundary-2\n" - ), - ), - ( - concat!( - "message/external-body; name=\"BodyFormats.ps\";\n site=\"thumper.bellcor", - "e.com\"; mode=\"image\";\n access-type=ANON-FTP; directory=\"pub\";\n expir", - "ation=\"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: external-body\n", - " attributes:\n", - " expiration: \"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)\"\n", - " site: thumper.bellcore.com\n", - " directory: pub\n", - " name: BodyFormats.ps\n", - " mode: image\n", - " access-type: ANON-FTP\n" - ), - ), - ( - concat!( - "message/external-body; access-type=local-file;\n name=\"/u/nsb/writing", - "/rfcs/RFC-MIME.ps\";\n site=\"thumper.bellcore.com\";\n expiration=\"Fri", - ", 14 Jun 1991 19:13:14 -0400 (EDT)\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: external-body\n", - " attributes:\n", - " expiration: \"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)\"\n", - " access-type: local-file\n", - " name: /u/nsb/writing/rfcs/RFC-MIME.ps\n", - " site: thumper.bellcore.com\n" - ), - ), - ( - concat!( - "message/external-body;\n access-type=mail-server\n server=\"listse", - "rv@bogus.bitnet\";\n expiration=\"Fri, 14 Jun 1991 19:13:14 -0400 (ED", - "T)\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: external-body\n", - " attributes:\n", - " access-type: mail-server\n", - " server: listserv@bogus.bitnet\n", - " expiration: \"Fri, 14 Jun 1991 19:13:14 -0400 (EDT)\"\n" - ), - ), - ( - concat!( - "Message/Partial; number=2; total=3;\n id=\"oc=jpbe0M2Yt4s@thumper.be", - "llcore.com\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: partial\n", - " attributes:\n", - " total: \"3\"\n", - " number: \"2\"\n", - " id: oc=jpbe0M2Yt4s@thumper.bellcore.com\n" - ), - ), - ( - concat!( - "multipart/signed; micalg=pgp-sha1; protocol=\"application/pgp-signature", - "\";\n boundary=\"=-J1qXPoyGtE2XNN5N6Z6j\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: multipart\n", - " c_subtype: signed\n", - " attributes:\n", - " boundary: \"=-J1qXPoyGtE2XNN5N6Z6j\"\n", - " micalg: pgp-sha1\n", - " protocol: application/pgp-signature\n" - ), - ), - ( - concat!( - "message/external-body;\n access-type=local-file;\n name=\"/u/nsb/M", - "e.jpeg\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: external-body\n", - " attributes:\n", - " name: /u/nsb/Me.jpeg\n", - " access-type: local-file\n" - ), - ), - ( - concat!( - "message/external-body; access-type=URL;\n URL*0=\"ftp://\";\n URL*1=", - "\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: external-body\n", - " attributes:\n", - " url: \"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"\n", - " access-type: URL\n" - ), - ), - ( - concat!( - "message/external-body; access-type=URL;\n URL=\"ftp://cs.utk.edu/pub", - "/moore/bulk-mailer/bulk-mailer.tar\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: external-body\n", - " attributes:\n", - " url: \"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"\n", - " access-type: URL\n" - ), - ), - ( - concat!( - "application/x-stuff;\n title*=us-ascii'en-us'This%20is%20%2A%2A%2Af", - "un%2A%2A%2A\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: x-stuff\n", - " attributes:\n", - " title: This is ***fun***\n", - " title-language: en-us\n" - ), - ), - ( - concat!( - "application/x-stuff\n title*0*=us-ascii'en'This%20is%20even%20more%20", - "\n title*1*=%2A%2A%2Afun%2A%2A%2A%20\n title*2=\"isn't it!\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: x-stuff\n", - " attributes:\n", - " title-language: en\n", - " title: \"This is even more ***fun*** isn't it!\"\n" - ), - ), - ( - concat!( - "application/pdf\n filename*0*=iso-8859-1'es'%D1and%FA\n ", - "filename*1*=iso-8859-1'", - "%20r%E1pido\n filename*2*=\"iso-8859-1' ", - "(versi%F3n \\'99 \\\"oficial\\\").pdf\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: pdf\n", - " attributes:\n", - " filename: \"Ñandú rápido (versión '99 \\\"oficial\\\").pdf\"\n", - " filename-language: es\n", - ), - ), - ( - concat!( - " image/png;\n name=\"=?utf-8?q?=E3=83=8F=E3=83=AD=E3=83=BC=E3=83=BB=E3", - "=83=AF=E3=83=BC=E3=83=AB=E3=83=89?=.png\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: image\n", - " c_subtype: png\n", - " attributes:\n", - " name: ハロー・ワールド.png\n" - ), - ), - ( - " image/gif;\n name==?iso-8859-6?b?5dHNyMcgyMfk2cfk5Q==?=.gif\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: image\n", - " c_subtype: gif\n", - " attributes:\n", - " name: مرحبا بالعالم.gif\n" - ), - ), - ( - concat!( - "image/jpeg;\n name=\"=?iso-8859-1?B?4Q==?= =?utf-8?B?w6k=?= =?iso-8859", - "-1?q?=ED?=.jpeg\"\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: image\n", - " c_subtype: jpeg\n", - " attributes:\n", - " name: á é í.jpeg\n" - ), - ), - ( - concat!( - "image/jpeg;\n name==?iso-8859-1?B?4Q==?= =?utf-8?B?w6k=?= =?iso-8859-", - "1?q?=ED?=.jpeg\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: image\n", - " c_subtype: jpeg\n", - " attributes:\n", - " name: áéí.jpeg\n" - ), - ), - ( - "image/gif;\n name==?iso-8859-6?b?5dHNyMcgyMfk2cfk5S5naWY=?=\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: image\n", - " c_subtype: gif\n", - " attributes:\n", - " name: مرحبا بالعالم.gif\n" - ), - ), - ( - " image/gif;\n name=\"=?iso-8859-6?b?5dHNyMcgyMfk2cfk5S5naWY=?=\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: image\n", - " c_subtype: gif\n", - " attributes:\n", - " name: مرحبا بالعالم.gif\n" - ), - ), - ( - " inline; filename=\" best \\\"file\\\" ever with \\\\ escaped ' stuff. \"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: inline\n", - " attributes:\n", - " filename: \" best \\\"file\\\" ever with \\\\ escaped ' stuff. \"\n" - ), - ), - ( - "test/\n", - concat!("---\n", "ContentType:\n", " c_type: test\n"), - ), - ("/invalid\n", concat!("---\n", "ContentType:\n", "~\n")), - ("/\n", concat!("---\n", "ContentType:\n", "~\n")), - (";\n", concat!("---\n", "ContentType:\n", "~\n")), - ( - "/ ; name=value\n", - concat!("---\n", "ContentType:\n", "~\n"), - ), - ( - "text/plain;\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n" - ), - ), - ( - "text/plain;;\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n" - ), - ), - ( - "text/plain ;;;;; = ;; name=\"value\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " name: value\n" - ), - ), - ( - "=\n", - concat!("---\n", "ContentType:\n", " c_type: \"=\"\n"), - ), - ( - "name=value\n", - concat!("---\n", "ContentType:\n", " c_type: name=value\n"), - ), - ( - "text/plain; name= \n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n" - ), - ), - ( - "a/b; = \n", - concat!( - "---\n", - "ContentType:\n", - " c_type: a\n", - " c_subtype: b\n" - ), - ), - ( - "a/b; = \n \n", - concat!( - "---\n", - "ContentType:\n", - " c_type: a\n", - " c_subtype: b\n" - ), - ), - ( - "a/b; =value\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: a\n", - " c_subtype: b\n" - ), - ), - ( - "test/test; =\"value\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: test\n", - " c_subtype: test\n" - ), - ), - ( - "á/é; á=é\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: á\n", - " c_subtype: é\n", - " attributes:\n", - " á: é\n" - ), - ), - ( - "inva/lid; name=\" \n", - concat!( - "---\n", - "ContentType:\n", - " c_type: inva\n", - " c_subtype: lid\n", - " attributes:\n", - " name: \" \"\n" - ), - ), - ( - "inva/lid; name=\" \n \n", - concat!( - "---\n", - "ContentType:\n", - " c_type: inva\n", - " c_subtype: lid\n", - " attributes:\n", - " name: \" \"\n" - ), - ), - ( - "inva/lid; name=\" \n \"; test=test\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: inva\n", - " c_subtype: lid\n", - " attributes:\n", - " test: test\n", - " name: \" \"\n" - ), - ), - ( - "name=value\n", - concat!("---\n", "ContentType:\n", " c_type: name=value\n"), - ), - ( - concat!( - "test/encoded; key4*=us-ascii''foo; key*9999=ba%; key2*0=a; key3*0*=us-asc", - "ii'en'xyz; key*0=\"f\u{0}oo\"; key2*1*=b%25; key3*1=plop%; key*1=baz; ", - "*=test; =test2;\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: test\n", - " c_subtype: encoded\n", - " attributes:\n", - " key: \"f\\u0000oobazba%\"\n", - " key2: ab%\n", - " key3: xyzplop%\n", - " key4: foo\n", - " key3-language: en\n", - ), - ), - ( - "text/plain; name*=\"iso-8859-1''HasenundFr%F6sche.txt\"\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " name: HasenundFrösche.txt\n" - ), - ), - ( - concat!( - "malicious/attempt; 1*2*=a; 3**=b; 4***=c; *5**6*=d;", - "*****7*8*=e; 9*10*11*12*13*14=f; 15*x***fff*===g;", - "1 * 999999999999999999 *= h; 18 *=*=*=*=*==i;\n" - ), - concat!( - "---\n", - "ContentType:\n", - " c_type: malicious\n", - " c_subtype: attempt\n", - " attributes:\n", - " \"1\": ha\n", - " \"3\": b\n", - " \"4\": c\n", - " \"5\": d\n", - " \"7\": e\n", - " \"9\": f\n", - " \"15\": \"==g\"\n", - " \"18\": \"*=*=*=*==i\"\n", - ), - ), - ( - ";charset=us-ascii\n", - concat!("---\n", "ContentType:\n", "~\n"), - ), - ( - " ;charset=us-ascii\n", - concat!("---\n", "ContentType:\n", "~\n"), - ), - ("/\n", concat!("---\n", "ContentType:\n", "~\n")), - ( - "/;charset=us-ascii\n", - concat!("---\n", "ContentType:\n", "~\n"), - ), - ( - "/ ;charset=us-ascii\n", - concat!("---\n", "ContentType:\n", "~\n"), - ), - ( - "text/\n", - concat!("---\n", "ContentType:\n", " c_type: text\n"), - ), - ( - "text/;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "text/ ;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ("/plain\n", concat!("---\n", "ContentType:\n", "~\n")), - ( - "/plain;charset=us-ascii\n", - concat!("---\n", "ContentType:\n", "~\n"), - ), - ( - "/plain ;charset=us-ascii\n", - concat!("---\n", "ContentType:\n", "~\n"), - ), - ( - "text/plain\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n" - ), - ), - ( - "text/plain;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "text/plain ;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "text/plain/format\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain/format\n" - ), - ), - ( - "text/plain/format;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain/format\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "text/plain/format ;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain/format\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "application/ld+json\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: ld+json\n" - ), - ), - ( - "application/ld+json;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: ld+json\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "application/ld+json ;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: ld+json\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "application/x-magic-cap-package-1.0\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: x-magic-cap-package-1.0\n" - ), - ), - ( - "application/x-magic-cap-package-1.0;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: x-magic-cap-package-1.0\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "application/x-magic-cap-package-1.0 ;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: x-magic-cap-package-1.0\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "application/pro_eng\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: pro_eng\n" - ), - ), - ( - "application/pro_eng;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: pro_eng\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "application/pro_eng ;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: pro_eng\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "application/wordperfect6.1\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: wordperfect6.1\n" - ), - ), - ( - "application/wordperfect6.1;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: wordperfect6.1\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "application/wordperfect6.1 ;charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: application\n", - " c_subtype: wordperfect6.1\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - concat!( - "application/vnd.openxmlformats-officedocument.wordprocessingml.templat", - "e\n" - ), - concat!( - "---\n", "ContentType:\n", - " c_type: application\n", - " c_subtype: vnd.openxmlformats-officedocument.wordprocessingml.template\n" - ), - ), - ( - concat!( - "application/vnd.openxmlformats-officedocument.wordprocessingml.templat", - "e;charset=us-ascii\n" - ), - concat!( - "---\n", "ContentType:\n", - " c_type: application\n", - " c_subtype: vnd.openxmlformats-officedocument.wordprocessingml.template\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - concat!( - "application/vnd.openxmlformats-officedocument.wordprocessingml.templat", - "e ;charset=us-asii\n" - ), - concat!( - "---\n", "ContentType:\n", - " c_type: application\n", - " c_subtype: vnd.openxmlformats-officedocument.wordprocessingml.template\n", - " attributes:\n", - " charset: us-asii\n" - ), - ), - ( - "(hello) text (plain) / (world) plain (eod)\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n" - ), - ), - ( - "(hello) text (plain) / (world) plain (eod);charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "(hello) text (plain) / (world) plain (eod); charset=us-ascii\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: text\n", - " c_subtype: plain\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - "message/rfc822\r\n\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: rfc822\n" - ), - ), - ( - " \t\r message/rfc822 \t\r\n\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: rfc822\n" - ), - ), - ( - " \t\r message/rfc822 \t ;charset=us-ascii\r\n\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: rfc822\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ( - " \t\r message/rfc822 \t ; charset=us-ascii\r\n", - concat!( - "---\n", - "ContentType:\n", - " c_type: message\n", - " c_subtype: rfc822\n", - " attributes:\n", - " charset: us-ascii\n" - ), - ), - ]; - - for input in inputs { - let str = input.0.to_string(); - - // TODO: Redo tests without using hashmaps. - let result = match MessageStream::new(str.as_bytes()).parse_content_type() { - HeaderValue::ContentType(ct) => HeaderValueMap::ContentType(ContentTypeMap { - c_type: ct.c_type, - c_subtype: ct.c_subtype, - attributes: ct.attributes.map(|a| a.into_iter().collect()), - }), - HeaderValue::Empty => HeaderValueMap::Empty, - _ => unreachable!(), - }; - let expected: HeaderValueMap = - serde_yaml::from_str(input.1).unwrap_or(HeaderValueMap::Empty); - - /* - if input.0.len() >= 70 { - println!( - "(concat!({:?}), concat!({:?})),", - input - .0 - .chars() - .collect::>() - .chunks(70) - .map(|c| c.iter().collect::()) - .collect::>(), - serde_yaml::to_string(&result) - .unwrap_or("".to_string()) - .split_inclusive("\n") - .collect::>() - ); - } else { - println!( - "({:?}, concat!({:?})),", - input.0, - serde_yaml::to_string(&result) - .unwrap_or("".to_string()) - .split_inclusive("\n") - .collect::>() - ); - }*/ - + for test in load_tests("content_type.json") { assert_eq!( - result, - expected, - "Failed for '{:?}', result was:\n{}", - input.0, - serde_yaml::to_string(&result).unwrap() + MessageStream::new(test.header.as_bytes()) + .parse_content_type() + .into_content_type(), + test.expected, + "failed for {:?}", + test.header ); } + + /*let mut builder = crate::parsers::fields::TestBuilder::new("content_type.json"); + + for input in inputs { + println!("Testing: {:?}", input.0); + let result = MessageStream::new(input.0.as_bytes()) + .parse_content_type() + .into_content_type(); + + builder.add(input.0.to_string(), result); + } + + builder.write();*/ } } diff --git a/src/parsers/fields/date.rs b/src/parsers/fields/date.rs index 99b2941..cadf28c 100644 --- a/src/parsers/fields/date.rs +++ b/src/parsers/fields/date.rs @@ -463,127 +463,49 @@ pub static MONTH_MAP: &[u8; 31] = &[ mod tests { use chrono::{FixedOffset, LocalResult, SecondsFormat, TimeZone, Utc}; - use crate::{parsers::MessageStream, HeaderValue}; + use crate::parsers::{fields::load_tests, MessageStream}; #[test] fn parse_dates() { - let inputs = [ - ( - "Tue, 1 Jul 2003 10:52:37 +0200", - "2003-07-01T10:52:37+02:00", - ), - ( - "Tue, 1 Jul 2003 10:52:37 +0200", - "2003-07-01T10:52:37+02:00", - ), - ( - "Fri, 21 Nov 1997 09:55:06 -0600", - "1997-11-21T09:55:06-06:00", - ), - ( - "Mon, 24 Nov 1997 14:22:01 -0800", - "1997-11-24T14:22:01-08:00", - ), - ( - "Tue, 30 Dec 1969 23:32:54 -0330", - "1969-12-30T23:32:54-03:30", - ), - ( - "Thu, 13 Feb 1969 23:32:54 -0330", - "1969-02-13T23:32:54-03:30", - ), - ( - "Thu,\n 13\n Feb\n 1969\n 23:32\n -0330 (Newfoundland Time)\n", - "1969-02-13T23:32:00-03:30", - ), - ( - " 1 Jul 2003 (comment about date) 10:52:37 +0200", - "2003-07-01T10:52:37+02:00", - ), - ( - "Tue, 1 Jul 2003 ((tricky)\n comment) 10:52:37 +0200", - "2003-07-01T10:52:37+02:00", - ), - ("21 Nov 97 09:55:06 GMT", "1997-11-21T09:55:06Z"), - ( - "20 11 (some \n 44 comments(more comments\n )) 79 05:34:27 -0300", - "1979-11-20T05:34:27-03:00", - ), - (" Wed, 27 Jun 99 04:11 +0900 ", "1999-06-27T04:11:00+09:00"), - ( - " 4 8 15 16 23 42, 4 8 15 16 23 42, 4 8 15 16 23 42, ", - "1915-08-04T16:23:42+00:04", - ), - (" some numbers 0 1 2 but invalid ", ""), - ("Tue, 1 Jul 2003 ((invalid)\ncomment) 10:52:37 +0200", ""), - ("1 jan 2021 09:55:06 +0200", "2021-01-01T09:55:06+02:00"), - ("2 feb 2021 09:55:06 +0200", "2021-02-02T09:55:06+02:00"), - ("3 mar 2021 09:55:06 +0200", "2021-03-03T09:55:06+02:00"), - ("4 apr 2021 09:55:06 +0200", "2021-04-04T09:55:06+02:00"), - ("5 may 2021 09:55:06 +0200", "2021-05-05T09:55:06+02:00"), - ("6 jun 2021 09:55:06 +0200", "2021-06-06T09:55:06+02:00"), - ("7 jul 2021 09:55:06 +0200", "2021-07-07T09:55:06+02:00"), - ("8 aug 2021 09:55:06 +0200", "2021-08-08T09:55:06+02:00"), - ("9 sep 2021 09:55:06 +0200", "2021-09-09T09:55:06+02:00"), - ("10 oct 2021 09:55:06 +0200", "2021-10-10T09:55:06+02:00"), - ("11 nov 2021 09:55:06 +0200", "2021-11-11T09:55:06+02:00"), - ("12 dec 2021 09:55:06 +0200", "2021-12-12T09:55:06+02:00"), - ("13 zzz 2021 09:55:06 +0200", "2021-00-13T09:55:06+02:00"), - ( - concat!( - "by 2002:aa7:cd10:0:b0:45c:2c83:1208 with SMTP id ", - "b16-20020aa7cd10000000b0045c2c831208mr4220805edw.81.1665423075119;\n\t", - "Mon, 10 Oct 2022 10:31:15 -0700 (PDT)" - ), - "2022-10-10T10:31:15-07:00", - ), - ]; + for test in load_tests("date.json") { + let datetime = MessageStream::new(test.header.as_bytes()) + .parse_date() + .into_datetime(); + assert_eq!(datetime, test.expected, "failed for {:?}", test.header); - for (pos, (input, expected_result)) in inputs.iter().enumerate() { - match MessageStream::new(input.as_bytes()).parse_date() { - HeaderValue::DateTime(datetime) => { - if pos < 6 { - assert_eq!(*input, datetime.to_rfc822()); - } - assert_eq!(*expected_result, datetime.to_rfc3339()); - - if datetime.is_valid() { - if let LocalResult::Single(chrono_datetime) - | LocalResult::Ambiguous(chrono_datetime, _) = FixedOffset::west_opt( - ((datetime.tz_hour as i32 * 3600i32) + datetime.tz_minute as i32 * 60) - * if datetime.tz_before_gmt { 1i32 } else { -1i32 }, - ) - .unwrap_or_else(|| FixedOffset::east_opt(0).unwrap()) - .with_ymd_and_hms( - datetime.year as i32, - datetime.month as u32, - datetime.day as u32, - datetime.hour as u32, - datetime.minute as u32, - datetime.second as u32, - ) { - assert_eq!( - chrono_datetime.timestamp(), - datetime.to_timestamp(), - "{} -> {} ({}) -> {} ({})", - input.escape_debug(), - datetime.to_timestamp(), - Utc.timestamp_opt(datetime.to_timestamp(), 0) - .unwrap() - .to_rfc3339_opts(SecondsFormat::Secs, true), - chrono_datetime.timestamp(), - Utc.timestamp_opt(chrono_datetime.timestamp(), 0) - .unwrap() - .to_rfc3339_opts(SecondsFormat::Secs, true) - ); - } + match datetime { + Some(datetime) if datetime.is_valid() => { + if let LocalResult::Single(chrono_datetime) + | LocalResult::Ambiguous(chrono_datetime, _) = FixedOffset::west_opt( + ((datetime.tz_hour as i32 * 3600i32) + datetime.tz_minute as i32 * 60) + * if datetime.tz_before_gmt { 1i32 } else { -1i32 }, + ) + .unwrap_or_else(|| FixedOffset::east_opt(0).unwrap()) + .with_ymd_and_hms( + datetime.year as i32, + datetime.month as u32, + datetime.day as u32, + datetime.hour as u32, + datetime.minute as u32, + datetime.second as u32, + ) { + assert_eq!( + chrono_datetime.timestamp(), + datetime.to_timestamp(), + "{} -> {} ({}) -> {} ({})", + test.header.escape_debug(), + datetime.to_timestamp(), + Utc.timestamp_opt(datetime.to_timestamp(), 0) + .unwrap() + .to_rfc3339_opts(SecondsFormat::Secs, true), + chrono_datetime.timestamp(), + Utc.timestamp_opt(chrono_datetime.timestamp(), 0) + .unwrap() + .to_rfc3339_opts(SecondsFormat::Secs, true) + ); } } - HeaderValue::Empty => { - //println!("{} -> None", input.0.escape_debug()); - assert!(expected_result.is_empty()); - } - _ => panic!("Unexpected result"), + _ => {} } } } diff --git a/src/parsers/fields/id.rs b/src/parsers/fields/id.rs index 9e4c3ae..3921a43 100644 --- a/src/parsers/fields/id.rs +++ b/src/parsers/fields/id.rs @@ -77,65 +77,21 @@ impl<'x> MessageStream<'x> { } #[cfg(test)] mod tests { - use crate::{parsers::MessageStream, HeaderValue}; + use std::borrow::Cow; + + use crate::parsers::{fields::load_tests, MessageStream}; #[test] fn parse_message_ids() { - let inputs = [ - ( - "<1234@local.machine.example>\n", - vec!["1234@local.machine.example"], - ), - ( - "<1234@local.machine.example> <3456@example.net>\n", - vec!["1234@local.machine.example", "3456@example.net"], - ), - ( - "<1234@local.machine.example>\n <3456@example.net> \n", - vec!["1234@local.machine.example", "3456@example.net"], - ), - ( - "<1234@local.machine.example>\n\n <3456@example.net>\n", - vec!["1234@local.machine.example"], - ), - ( - " \n", - vec!["testabcd.1234@silly.test"], - ), - ( - "<5678.21-Nov-1997@example.com>\n", - vec!["5678.21-Nov-1997@example.com"], - ), - ( - "<1234 @ local(blah) .machine .example>\n", - vec!["1234 @ local(blah) .machine .example"], - ), - ("<>\n", vec![""]), - // Malformed Ids should be parsed anyway - ( - "malformed@id.machine.example\n", - vec!["malformed@id.machine.example"], - ), - ( - " malformed2@id.machine.example \t \n", - vec!["malformed2@id.machine.example"], - ), - (" m \n", vec!["m"]), - ]; - - for input in inputs { - let str = input.0.to_string(); - match MessageStream::new(str.as_bytes()).parse_id() { - HeaderValue::TextList(ids) => { - assert_eq!(ids, input.1, "Failed to parse '{:?}'", input.0); - } - HeaderValue::Text(id) => { - assert!(input.1.len() == 1, "Failed to parse '{:?}'", input.0); - assert_eq!(id, input.1[0], "Failed to parse '{:?}'", input.0); - } - HeaderValue::Empty if input.1[0].is_empty() => {} - result => panic!("Unexpected result: {:?}", result), - } + for test in load_tests::>>>("id.json") { + assert_eq!( + MessageStream::new(test.header.as_bytes()) + .parse_id() + .into_text_list(), + test.expected, + "failed for {:?}", + test.header + ); } } } diff --git a/src/parsers/fields/list.rs b/src/parsers/fields/list.rs index 06d91d8..1f2d142 100644 --- a/src/parsers/fields/list.rs +++ b/src/parsers/fields/list.rs @@ -119,60 +119,19 @@ impl<'x> MessageStream<'x> { } #[cfg(test)] mod tests { - use crate::{parsers::MessageStream, HeaderValue}; + use crate::parsers::{fields::load_tests, MessageStream}; #[test] fn parse_comma_separated_text() { - let inputs = [ - (" one item \n", vec!["one item"]), - ("simple, list\n", vec!["simple", "list"]), - ( - "multi \r\n list, \r\n with, cr lf \r\n", - vec!["multi list", "with", "cr lf"], - ), - ( - "=?iso-8859-1?q?this is some text?=, in, a, list, \n", - vec!["this is some text", "in", "a", "list"], - ), - ( - concat!( - " =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\n ", - "=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\n", - " , but, in a list, which, is, more, fun!\n" - ), - vec![ - "If you can read this you understand the example.", - "but", - "in a list", - "which", - "is", - "more", - "fun!", - ], - ), - ( - "=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n , listed\n", - vec!["ab", "listed"], - ), - ( - "ハロー・ワールド, and also, ascii terms\n", - vec!["ハロー・ワールド", "and also", "ascii terms"], - ), - ]; - - for input in inputs { - let str = input.0.to_string(); - - match MessageStream::new(str.as_bytes()).parse_comma_separared() { - HeaderValue::TextList(ids) => { - assert_eq!(ids, input.1, "Failed to parse '{:?}'", input.0); - } - HeaderValue::Text(id) => { - assert!(input.1.len() == 1, "Failed to parse '{:?}'", input.0); - assert_eq!(id, input.1[0], "Failed to parse '{:?}'", input.0); - } - _ => panic!("Unexpected result"), - } + for test in load_tests::>("list.json") { + assert_eq!( + MessageStream::new(test.header.as_bytes()) + .parse_comma_separared() + .unwrap_text_list(), + test.expected, + "failed for {:?}", + test.header + ); } } } diff --git a/src/parsers/fields/raw.rs b/src/parsers/fields/raw.rs index 19a796b..a6dd9e0 100644 --- a/src/parsers/fields/raw.rs +++ b/src/parsers/fields/raw.rs @@ -77,13 +77,14 @@ mod tests { ), ]; - for input in inputs { - let str = input.0.to_string(); + for (input, expected) in inputs { assert_eq!( - MessageStream::new(str.as_bytes()).parse_raw().unwrap_text(), - input.1, + MessageStream::new(input.as_bytes()) + .parse_raw() + .unwrap_text(), + expected, "Failed for '{:?}'", - input.0 + input ); } } diff --git a/src/parsers/fields/received.rs b/src/parsers/fields/received.rs index f3b9d3e..65003d4 100644 --- a/src/parsers/fields/received.rs +++ b/src/parsers/fields/received.rs @@ -856,34 +856,5 @@ mod tests { test.header ); } - - /*let file = std::fs::File::open("/Users/me/code/mail-parser/test/headers.txt").unwrap(); - //let file = std::fs::File::open("/Users/me/code/mail-parser/test/tokens.txt").unwrap(); - let reader = std::io::BufReader::new(file); - let mut lines = String::new(); - - for line in reader.lines() { - lines += &line.unwrap(); - lines += "\n"; - } - - let mut tests = vec![]; - - for line in lines.split_inclusive('\n') { - let expected = MessageStream::new(line.as_bytes()) - .parse_received() - .unwrap_received(); - - tests.push(Test { - header: line, - expected, - }); - } - - std::fs::write( - "/Users/me/code/mail-parser/test/headers.json", - serde_json::to_string_pretty(&tests).unwrap(), - ) - .unwrap();*/ } } diff --git a/src/parsers/fields/unstructured.rs b/src/parsers/fields/unstructured.rs index d07b4e3..16792d8 100644 --- a/src/parsers/fields/unstructured.rs +++ b/src/parsers/fields/unstructured.rs @@ -95,119 +95,18 @@ impl<'x> MessageStream<'x> { #[cfg(test)] mod tests { - use crate::parsers::MessageStream; + use crate::parsers::{fields::load_tests, MessageStream}; #[test] fn parse_unstructured() { - let inputs = [ - ("Saying Hello\n", "Saying Hello", true), - ("Re: Saying Hello\r\n", "Re: Saying Hello", true), - (" Fwd: \n\tSaying \n Hello\r\n", "Fwd: Saying Hello", false), - ( - " FWD: \n Saying Hello \nX-Mailer: 123\r\n", - "FWD: Saying Hello", - false, - ), - ( - concat!( - " from x.y.test\n by example.net\n via TCP\n", - " with ESMTP\n id ABC12345\n ", - "for ; 21 Nov 1997 10:05:43 -0600\n" - ), - concat!( - "from x.y.test by example.net via TCP with ESMTP id ABC12345", - " for ; 21 Nov 1997 10:05:43 -0600" - ), - false, - ), - ( - "=?iso-8859-1?q?this is some text?=\n", - "this is some text", - false, - ), - ( - "=?iso-8859-1?q?this=20is=20some=20text?=\r\n", - "this is some text", - false, - ), - ( - concat!( - " =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=\n ", - "=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=\n" - ), - "If you can read this you understand the example.", - false, - ), - (" =?ISO-8859-1?Q?a?=\n", "a", false), - ("=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n", "ab", false), - ("=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=\n", "ab", false), - ( - "=?ISO-8859-1?Q?a?=\r\n =?ISO-8859-1?Q?b?=\nFrom: unknown@domain.com\n", - "ab", - false, - ), - ("=?ISO-8859-1?Q?a_b?=\n", "a b", false), - ("=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=\r\n", "a b", false), - ( - concat!( - " this =?iso-8859-1?q?is?= some =?iso-8859-1?q?t?=\n =?iso-8859-1?q?e?=", - " \n =?iso-8859-1?q?x?=\n =?iso-8859-1?q?t?=\n" - ), - "this is some text", - false, - ), - (" =\n", "=", true), - (" =? \n", "=?", true), - ("=?utf-8 \n", "=?utf-8", true), - ("=?utf-8? \n", "=?utf-8?", true), - ( - " let's = try =?iso-8859-1? to break\n =? the \n parser\n", - "let's = try =?iso-8859-1? to break =? the parser", - false, - ), - ("ハロー・ワールド \n", "ハロー・ワールド", true), - ( - "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb3JpZ2luYWwgc3ViamVjdA==?=\n", - "[SUSPECTED SPAM] This is the original subject", - true, - ), - ("Some text =?utf-8?Q??=here\n", "Some text here", true), - ( - "=?ISO-8859-1?Q?a?==?ISO-8859-1?Q?b?==?ISO-8859-1?Q?c?= =?ISO-8859-1?Q?d?=\n", - "abcd", - true, - ), - ("=?utf-8?Q?Hello\n _there!?=\n", "Hello there!", true), - ("=?utf-8?Q?Hello\r\n _there!?=\r\n", "Hello there!", true), - ( - "=?utf-8?Q?Hello\r\n \t _there!?=\r\n", - "Hello there!", - true, - ), - ( - "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb\n 3JpZ2luYWwgc3ViamVjdA==?=\n", - "[SUSPECTED SPAM] This is the original subject", - true, - ), - ( - "[SUSPECTED SPAM]=?utf-8?B?VGhpcyBpcyB0aGUgb\r\n 3JpZ2luYWwgc3ViamVjdA==?=\r\n", - "[SUSPECTED SPAM] This is the original subject", - true, - ), - ( - "Les Communs - =?utf-8?Q?R=C3=A9capitulatif?= de la\r\n =?utf-8?Q?r=C3=A9servation?= 13510164434879\r\n", - "Les Communs - Récapitulatif de la réservation 13510164434879", - true, - ), - ]; - - for (input, expected_result, _) in inputs { + for test in load_tests::("unstructured.json") { assert_eq!( - MessageStream::new(input.as_bytes()) + MessageStream::new(test.header.as_bytes()) .parse_unstructured() .unwrap_text(), - expected_result, - "Failed to parse '{input:?}'", + test.expected, + "failed for {:?}", + test.header ); } } diff --git a/src/parsers/header.rs b/src/parsers/header.rs index 9db6f2d..4a41523 100644 --- a/src/parsers/header.rs +++ b/src/parsers/header.rs @@ -73,7 +73,8 @@ impl<'x> MessageStream<'x> { RfcHeader::Keywords | RfcHeader::ContentLanguage => { self.parse_comma_separared() } - RfcHeader::Received | RfcHeader::MimeVersion => self.parse_raw(), + RfcHeader::Received => self.parse_received(), + RfcHeader::MimeVersion => self.parse_raw(), RfcHeader::ContentType | RfcHeader::ContentDisposition => { self.parse_content_type() } diff --git a/src/parsers/message.rs b/src/parsers/message.rs index 9a299cb..b605f38 100644 --- a/src/parsers/message.rs +++ b/src/parsers/message.rs @@ -151,7 +151,7 @@ impl<'x> Message<'x> { let content_type = part_headers .rfc(&RfcHeader::ContentType) - .and_then(|c| c.as_content_type_ref()); + .and_then(|c| c.as_content_type()); let (is_multipart, mut is_inline, mut is_text, mut mime_type) = mime_type(content_type, &state.mime_type); diff --git a/tests/integration_test.rs b/tests/integration_test.rs index dd078d8..17ffce3 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -65,16 +65,16 @@ R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 ); assert_eq!( - message.from(), - &HeaderValue::Address(Addr::new( + message.from().unwrap().first().unwrap(), + &Addr::new( "Art Vandelay (Vandelay Industries)".into(), "art@vandelay.com" - )) + ) ); assert_eq!( - message.to(), - &HeaderValue::GroupList(vec![ + message.to().unwrap().as_group().unwrap(), + &[ Group::new( "Colleagues", vec![Addr::new("James Smythe".into(), "james@vandelay.com")] @@ -86,7 +86,7 @@ R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 Addr::new("John Smîth".into(), "john@example.com"), ] ) - ]) + ] ); assert_eq!(