forked from Silverfish/proton-bridge
Parsing message with empty address as '<>'
This commit is contained in:
@ -5,7 +5,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
### Fixed
|
### 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 non-utf8 multipart/alternative message.
|
||||||
* GODT-752 Parsing message with duplicate charset parameter.
|
* GODT-752 Parsing message with duplicate charset parameter.
|
||||||
|
|
||||||
|
|||||||
@ -152,7 +152,7 @@ func parseAddressComment(raw string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parseAddressList(val string) (addrs []*mail.Address, err error) {
|
func parseAddressList(val string) (addrs []*mail.Address, err error) {
|
||||||
if val == "" {
|
if val == "" || val == "<>" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -224,8 +224,8 @@ func TestParseTextPlainWithPlainAttachment(t *testing.T) {
|
|||||||
assert.Equal(t, readerToString(attReaders[0]), "attachment")
|
assert.Equal(t, readerToString(attReaders[0]), "attachment")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParseTextPlainEmptyCC(t *testing.T) {
|
func TestParseTextPlainEmptyAddresses(t *testing.T) {
|
||||||
f := getFileReader("text_plain_empty_cc.eml")
|
f := getFileReader("text_plain_empty_addresses.eml")
|
||||||
|
|
||||||
m, _, plainBody, attReaders, err := Parse(f, "", "")
|
m, _, plainBody, attReaders, err := Parse(f, "", "")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
From: Sender <sender@pm.me>
|
From: Sender <sender@pm.me>
|
||||||
To: Receiver <receiver@pm.me>
|
To: Receiver <receiver@pm.me>
|
||||||
CC:
|
CC:
|
||||||
|
Reply-To: <>
|
||||||
|
|
||||||
body
|
body
|
||||||
Reference in New Issue
Block a user