GH-3560 Parse mail FROM as comma-delimited header (#3562)

Fixes https://github.com/spring-projects/spring-integration/issues/3560

According RFC 5322 `FROM` and `REPLY-TO` received mail message can be
as an array of addresses.

* Fix `MailUtils` to present those arrays as comma-delimited strings for
Spring message headers
* Fix tests to deal already with several addresses for `FROM` mime header.

In the future we may change the logic to map those mime headers to arrays
as it states according the mentioned RFC

**Cherry-pick to `5.4.x` & `5.3.x`**
This commit is contained in:
Artem Bilan
2021-05-05 16:56:01 -04:00
committed by Gary Russell
parent d5ff74b272
commit 56474a5ef5
5 changed files with 13 additions and 21 deletions

View File

@@ -489,7 +489,7 @@ public final class TestMailServer {
"To: Foo <foo@bar>\r\n"
+ "cc: a@b, c@d\r\n"
+ "bcc: e@f, g@h\r\n"
+ "From: Bar <bar@baz>\r\n"
+ "From: Bar <bar@baz>, Bar2 <bar2@baz>\r\n"
+ "Subject: Test Email\r\n"
+ "\r\n" + BODY;