Menu

#7 GreenMail IMAP does not escape quotes in ENVELOPE Message-ID response

v1.0 (example)
closed
nobody
None
3
2014-12-08
2013-11-23
dm222
No

If I send a test email to GreenMail, containing a Message-ID containing a quoted address, e.g.

<11111.22222.3333.JavaMail."FOO\BAR"@HOSTNAME>

and then I retrieve it from GreenMail's IMAP server, JavaMail's ENVELOPE class, which is reading the response, throws

javax.mail.MessagingException: Failed to load IMAP Envelope

JavaMail generated the legal quoted Message-ID when calling MimeMessage.saveChanges() prior to sending it.

The IMAP RFC3501 (section 9) says that the envelope's message-id will either be a quoted string, or a literal surround by braces. GreenMail is correctly quoting around the entire Message-ID. But in doing so, all quotes inside the Message-ID must be escaped prior to sending the response. Since these quotes are not escaped in GreenMail's envelope response data, the JavaMail reading code (ENVELOPE.java) rejects the invalid response.

Discussion

  • Marcel (mayma)

    Marcel (mayma) - 2014-12-08
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB