我正在使用 Jodd 3.9 版,我想阅读一个 Outlook 帐户(Microsoft Exchange)。]
int port = 993;
ImapSslServer imapServer = new ImapSslServer("mail.myhost.it", port, "authuser", "authpass");
imapServer.setProperty("mail.imap.connectiontimeout", "15000");
ReceiveMailSession session = imapServer.createSession();
session.open();
_log.info("total number of inbox emails : " + session.getMessageCount());
ReceivedEmail[] emails = session.receiveEmailAndMarkSeen(EmailFilter.filter().flag(Flags.Flag.SEEN, false));
但我在该行收到此错误:session.receiveEmailAndMarkSeen(...)
jodd.mail.MailException: Message parsing failed; <---
java.lang.NullPointerException
这是一个调试:
A8 FETCH 4 (BODYSTRUCTURE)
* 4 FETCH (BODYSTRUCTURE (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 1401 35 NIL NIL NIL NIL) "mixed" ("boundary" "----=_Part_1029639_1159929762.1507643405808") NIL NIL))
[ERROR] 11 ott 04:57:31.467 PM [com.afterbit.jobs.EmailJob] (mGxTfT0) EXCEPTION session.receiveEmailAndMarkSeen : jodd.mail.MailException: Message parsing failed; <--- java.lang.NullPointerException
A9 CLOSE
A8 OK FETCH completed.
A9 OK CLOSE completed.
我无法理解为什么...