Parsing message with empty address as '<>'

This commit is contained in:
Michal Horejsek 2020-09-24 15:37:21 +02:00
parent 15c1d7bc24
commit e02c7c7f06
4 changed files with 5 additions and 4 deletions

View File

@ -5,7 +5,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
## Unreleased
### Fixed
* GODT-752 Parsing message with empty CC.
* GODT-752 Parsing message with empty addresses.
* GODT-752 Parsing non-utf8 multipart/alternative message.
* GODT-752 Parsing message with duplicate charset parameter.

View File

@ -152,7 +152,7 @@ func parseAddressComment(raw string) string {
}
func parseAddressList(val string) (addrs []*mail.Address, err error) {
if val == "" {
if val == "" || val == "<>" {
return
}

View File

@ -224,8 +224,8 @@ func TestParseTextPlainWithPlainAttachment(t *testing.T) {
assert.Equal(t, readerToString(attReaders[0]), "attachment")
}
func TestParseTextPlainEmptyCC(t *testing.T) {
f := getFileReader("text_plain_empty_cc.eml")
func TestParseTextPlainEmptyAddresses(t *testing.T) {
f := getFileReader("text_plain_empty_addresses.eml")
m, _, plainBody, attReaders, err := Parse(f, "", "")
require.NoError(t, err)

View File

@ -1,5 +1,6 @@
From: Sender <sender@pm.me>
To: Receiver <receiver@pm.me>
CC:
Reply-To: <>
body