Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Complete
-
None
Description
org.springframework.integration.test.mail.TestMailServer.ImapServer currently replies to FETCH ENVELOPE with
... + "\"Test Email\" ((\"Bar\" NIL \"bar\" \"baz\")) " + "((\"Foo\" NIL \"foo\" \"bar.tv\")) " + "((\"Foo\" NIL \"foo\" \"bar.tv\")) " + "((\"Foo\" NIL \"foo\" \"bar\")) NIL NIL " ...
According to RFC2822, this corresponds to:
from: Bar <[email protected]>
sender: Foo <[email protected]>
reply-to: Foo <[email protected]>
to: Foo <[email protected]>
It would make more sense to have the same from, sender and reply-to, like this:
... + "\"Test Email\" ((\"Bar\" NIL \"bar\" \"baz\")) " + "((\"Bar\" NIL \"bar\" \"baz\")) " + "((\"Bar\" NIL \"bar\" \"baz\")) " + "((\"Foo\" NIL \"foo\" \"bar\")) NIL NIL " ...
With the current implementation, the MimeMessage produced by javax.mail contains the "not-so-meaningful" headers described above. The suggested improvement will "correct" these headers.
Perhaps ImapMailReceiverTests could be enhanced to check for sender and reply-to headers as well.