質問

Hello all :) I'm fetching some mails from a pop3 server and I'm having a bit of troubles reading a multipart/mixed mail. I traced what is happening when I do a:

} else if (p.isMimeType("multipart/*")) {
    Multipart mp = (Multipart) p.getContent();
    System.out.println(mp.getCount()); // Throws
    // ...
}

This throws:

javax.mail.MessagingException: Unexpected response:  Write back to blah@blah.com
    at org.apache.geronimo.javamail.store.pop3.POP3ResponseBuilder.buildResponse(POP3ResponseBuilder.java:86)
    at org.apache.geronimo.javamail.store.pop3.POP3Connection.sendCommand(POP3Connection.java:154)
    at org.apache.geronimo.javamail.store.pop3.message.POP3Message.getContentStream(POP3Message.java:88)
    at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:46)
    at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:169)
    at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:104)
    at fr.clcg.basemkt.npai.ImportNPAIFromMail.getText(ImportNPAIFromMail.java:214)

Write back to blah@blah.com is missing some response status from the server.

According to this implementation, which I am using, it is supposed to receive +OK Write back to blah@blah.com, or -ERR Write back to blah@blah.com, or + [...]; But I only get the message and not the status and an error is thrown on line 86.

Outlook, on the other hand, has no problem dealing with this email. So my question is: Am I missing something, am I using Java Mail incorrectly? Can I activate a mode where the POP3 connection status checking is less strict? Is the pop3 provider badly configured?

役に立ちましたか?

解決

Try using the JavaMail reference implementation instead.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top