Spring集成 - imap - 凭证问题

时间:2013-07-21 12:39:01

标签: imap credentials spring-integration

这是我的xml:

<mail:inbound-channel-adapter id="imapAdapter"
                                  store-uri="imaps://[avita.nir@gmail.com]:[secretPass]@imap.gmail.com/INBOX"                                   
                                  channel="recieveEmailChannel"                                         
                                  should-delete-messages="false"
                                  should-mark-messages-as-read="true"                                     
                                  auto-startup="true"                                                                           
                                  java-mail-properties="javaMailProperties">

出于某种原因,当我输入“store-uri”时,我得到此异常(空密码):

    DEBUG: protocolConnect returning false, host=gmail.com], user=[avita.nir, password=<null>
21 יול 2013 15:32:05 ERROR LoggingHandler - org.springframework.integration.MessagingException:      failure occurred while polling for mail
at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:73)
at org.springframework.integration.endpoint.SourcePollingChannelAdapter.doPoll(SourcePollingChannelAdapter.java:89)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:145)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:143)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:206)
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:201)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53)
at              org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at         java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolE  xecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.integration.MessagingException: failure occurred while receiving from folder
at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:240)
at org.springframework.integration.mail.MailReceivingMessageSource.receive(MailReceivingMessageSource.java:59)
... 18 more
Caused by: javax.mail.AuthenticationFailedException: failed to connect, no password specified?

1 个答案:

答案 0 :(得分:1)

删除[]并且你应该是好的 - 如果用户名或密码包含特殊字符,你将不得不逃避它们。

对于这些问题,将mail.debug设置为true总是有用的,您将在控制台上获得更多信息。