aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorMathiasB <git@denbeke.be>2015-04-10 12:14:16 +0200
committerRuss Cox <rsc@golang.org>2015-07-22 20:36:46 +0000
commitdaaa45073e887cb6d8075c2caafdfe8425bca25a (patch)
tree04e26ddf5671cf0438753468d52b6a69c4453e92 /src/os
parent5201bf7ad184cac07466016a78b80aed5e472be4 (diff)
downloadgo-daaa45073e887cb6d8075c2caafdfe8425bca25a.tar.xz
net/mail: enhanced Address.String and ParseAddress to match RFC 5322
Updated Address.String so it restores quoted local parts, which wasn't done before. When parsing `<" "@example.com>`, the formatted string returned `< @example>`, which doens't match RFC 5322, since a space is not atext. Another example is `<"bob@valid"@example.com>` which returned `<bob@valid@example.com>`, which is completely invalid. I also added support for quotes and backslashes in a quoted local part. Besides formatting a parsed Address, the ParseAddress function also needed more testing and finetuning for special cases. Things like `<.john.doe@example.com>` and `<john..doe@example.com>` e.a. were accepted, but are invalid. I fixed those details and add tests for some other special cases. Fixes #10768 Change-Id: Ib0caf8ad603eb21e32fcb957a5f1a0fe5d1c6e6e Reviewed-on: https://go-review.googlesource.com/8724 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/os')
0 files changed, 0 insertions, 0 deletions