diff options
author | Arun Isaac | 2020-12-05 00:19:16 +0530 |
---|---|---|
committer | Arun Isaac | 2020-12-05 00:33:24 +0530 |
commit | 37e245539bc9e27db35731e7b517cdde397834e2 (patch) | |
tree | a6eb0e27b46c45bfd53b12e81e37dc414bc665bd /tests | |
parent | 907a5d678c58eff653133df441aeecd3b7025e37 (diff) | |
download | guile-email-37e245539bc9e27db35731e7b517cdde397834e2.tar.gz guile-email-37e245539bc9e27db35731e7b517cdde397834e2.tar.lz guile-email-37e245539bc9e27db35731e7b517cdde397834e2.zip |
email: Support obsolete addressing.
* email/email.scm (obs-qp, obs-fws, obs-no-ws-ctl, obs-ctext,
obs-qtext, obs-phrase, obs-local-part, obs-dtext, obs-domain,
obs-domain-list, obs-route, obs-angle-addr, captured-atom,
captured-obs-domain, captured-domain, obs-mbox-list, obs-group-list,
obs-addr-list, obs-id-left, obs-id-right): New patterns.
(quoted-pair, fws, ctext, qtext, phrase, dtext,
define-angle-addr-pattern, mailbox-list, group-list, address-list,
define-field-pattern, from, sender, bcc, id-left, id-right,
resent-from, resent-sender, resent-bcc, obs-resent-rply): Include
obsolete pattern.
(define-printable-ascii-character-pattern-with-obsolete,
define-atom-pattern, define-obs-domain-pattern): New macros.
(define-domain-pattern): Accept obs-domain as a new argument.
(fields): Include obs-resent-rply.
* tests/email.scm ("RFC5322 A.6.1. Obsolete addressing"): New test.
("parse email addresses with period in name"): Mark as passing.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/email.scm | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/tests/email.scm b/tests/email.scm index a2b6361..8a7be9b 100644 --- a/tests/email.scm +++ b/tests/email.scm @@ -190,6 +190,31 @@ Hi everyone.") (message-id . "5678.21-Nov-1997@example.com")) "Hi everyone.")) +(test-email= "RFC5322 A.6.1. Obsolete addressing" + (parse-email + (string->bytevector + "From: Joe Q. Public <john.q.public@example.com> +To: Mary Smith <@node.test:mary@example.net>, , jdoe@test . example +Date: Tue, 1 Jul 2003 10:52:37 +0200 +Message-ID: <5678.21-Nov-1997@example.com> + +Hi everyone. +" + "utf-8")) + (make-email + `((from ((name . "Joe Q. Public") + (address . "john.q.public@example.com"))) + (to ((name . "Mary Smith") + (address . "mary@example.net")) + ((address . "jdoe@test . example"))) + (date . ,(make-date 0 37 52 10 1 7 2003 7200)) + (message-id . "5678.21-Nov-1997@example.com") + (content-type (type . text) + (subtype . plain) + (charset . "utf-8")) + (content-transfer-encoding . 7bit)) + "Hi everyone.")) + (test-email= "RFC2046 5.1.1. Common syntax" (parse-email (string->bytevector @@ -410,8 +435,6 @@ copyright =A9") (parse-email-address "foo@example.org (Foo)") '((name . "Foo") (address . "foo@example.org"))) -(test-expect-fail "parse email addresses with period in name") - (test-equal "parse email addresses with period in name" (parse-email-address "Foo P. Bar <foo@example.com>") '((name . "Foo P. Bar") (address . "foo@example.com"))) |