2
我使用IMAP空閒通道適配器來接收春季整合電子郵件:IMAP電子郵件通道適配器拋出異常「A5 BAD無效的命令或參數;」
A5 SEARCH NOT (ANSWERED) NOT (DELETED) NOT (SEEN) NOT (FLAGGED) ALL
A5 BAD invalid command or parameters
似乎上面的IMAP服務器方面的命令無效,誰能告訴我如何解決?
我調試消息:
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle]
DEBUG IMAPS: mail.imap.fetchsize: 16384
DEBUG IMAPS: mail.imap.ignorebodystructuresize: false
DEBUG IMAPS: mail.imap.statuscachetimeout: 1000
DEBUG IMAPS: mail.imap.appendbuffersize: -1
DEBUG IMAPS: mail.imap.minidletime: 10
DEBUG IMAPS: closeFoldersOnStoreFailure
DEBUG IMAPS: trying to connect to host "imap.mxhichina.com", port 993, isSSL true
* OK AliYun IMAP Server Ready(10.177.11.50)
A0 CAPABILITY
* CAPABILITY IMAP4rev1 IDLE XLIST UIDPLUS ID SASL-IR AUTH=XOAUTH AUTH=EXTERNAL
A0 OK CAPABILITY completed
DEBUG IMAPS: AUTH: XOAUTH
DEBUG IMAPS: AUTH: EXTERNAL
DEBUG IMAPS: protocolConnect login, host=imap.mxhichina.com, user=*****, password=<non-null>
DEBUG IMAPS: mechanism PLAIN not supported by server
DEBUG IMAPS: mechanism LOGIN not supported by server
DEBUG IMAPS: mechanism NTLM not supported by server
DEBUG IMAPS: mechanism XOAUTH2 disabled by property: mail.imaps.auth.xoauth2.disable
DEBUG IMAPS: LOGIN command trace suppressed
DEBUG IMAPS: LOGIN command result: A1 OK LOGIN completed
A2 CAPABILITY
* CAPABILITY IMAP4rev1 IDLE XLIST UIDPLUS ID SASL-IR AUTH=XOAUTH AUTH=EXTERNAL
A2 OK CAPABILITY completed
DEBUG IMAPS: AUTH: XOAUTH
DEBUG IMAPS: AUTH: EXTERNAL
A3 LIST "" INBOX
* LIST() "/" "INBOX"
A3 OK LIST completed
DEBUG IMAPS: connection available -- size: 1
A4 SELECT INBOX
* 2 EXISTS
* 0 RECENT
* OK [UNSEEN 0]
* OK [UIDNEXT 25] Predicted next UID.
* OK [UIDVALIDITY 2] UIDs valid.
* FLAGS (\Answered \Seen \Deleted \Draft \Flagged)
* OK [PERMANENTFLAGS (\Answered \Seen \Deleted \Draft \Flagged)] Limited.
A4 OK [READ-WRITE] SELECT completed
A5 SEARCH NOT (ANSWERED) NOT (DELETED) NOT (SEEN) NOT (FLAGGED) ALL
A5 BAD invalid command or parameters
13:41:00.557 WARN [task-scheduler-1][org.springframework.integration.mail.ImapIdleChannelAdapter] error occurred in idle task
javax.mail.MessagingException: A5 BAD invalid command or parameters;
我的配置
<int-mail:imap-idle-channel-adapter id="mailAdapter"
store-uri="imaps://${username}:${password}@imap.mxhichina.com/INBOX"
channel="inboundChannel"
auto-startup="true"
should-delete-messages="true"
should-mark-messages-as-read="true"
java-mail-properties="javaMailProperties"/>
<util:properties id="javaMailProperties">
<prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<prop key="mail.imap.socketFactory.fallback">false</prop>
<prop key="mail.store.protocol">imaps</prop>
<prop key="mail.transport.protocol">smtps</prop>
<prop key="mail.smtps.auth">true</prop>
<prop key="mail.debug">true</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
</util:properties>
請添加更多標籤,你的問題。這看起來不像Spring集成問題。您的IMAP服務器有一些限制。 –
謝謝,添加標籤imap和javamail –
好。但我仍然認爲你應該爲你的電子郵件服務器添加標籤。這可能根本不是Java客戶端問題。 –