如何在 Spring Integration 邮件接收适配器中设置我的 Store-Uri 时转义

我正在使用 imapIdle 配置我的电子邮件接收通道,我的电子邮件帐户密码中包含字符“@”。我注意到代码 store-uri 中断了,因为它根据“@”字符拆分字符串。

我读了 Gary Russel 的评论,他说这个角色需要逃避。我尝试通过键入“\@”来转义“@”字符,但这没有用。store-uri 字符串仍在第一个“@”字符处拆分。因此我得到

我尝试用它的 unicode 表示“U+0040”替换“@”,但这也不起作用

store-uri="imaps://${email.username}:${email.password.contains("@")}@outlook.office365.com"


08:38:24.536 WARN  [task-scheduler-1][org.springframework.integration.mail.ImapIdleChannelAdapter] error occurred in idle task

com.sun.mail.util.MailConnectException: Couldn't connect to host, port: PASSWORDCHARACTERSAFTER"@"SYMBOL@imap.HOSTDOMAIN, 993; timeout -1

    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:740) ~[javax.mail-1.6.2.jar:1.6.2]

    at javax.mail.Service.connect(Service.java:366) ~[javax.mail-api-1.6.2.jar:1.6.2]

    at javax.mail.Service.connect(Service.java:246) ~[javax.mail-api-1.6.2.jar:1.6.2]

    at javax.mail.Service.connect(Service.java:195) ~[javax.mail-api-1.6.2.jar:1.6.2]

    at org.springframework.integration.mail.AbstractMailReceiver.connectStoreIfNecessary(AbstractMailReceiver.java:332) ~[spring-integration-mail-5.2.0.M2.jar:5.2.0.M2]

    at org.springframework.integration.mail.AbstractMailReceiver.openFolder(AbstractMailReceiver.java:339) ~[spring-integration-mail-5.2.0.M2.jar:5.2.0.M2]

    at org.springframework.integration.mail.ImapMailReceiver.waitForNewMessages(ImapMailReceiver.java:170) ~[spring-integration-mail-5.2.0.M2.jar:5.2.0.M2]

    at org.springframework.integration.mail.ImapIdleChannelAdapter$IdleTask.run(ImapIdleChannelAdapter.java:289) [spring-integration-mail-5.2.0.M2.jar:5.2.0.M2]

    at org.springframework.integration.mail.ImapIdleChannelAdapter$ReceivingTask.run(ImapIdleChannelAdapter.java:254) [spring-integration-mail-5.2.0.M2.jar:5.2.0.M2]



慕妹3242003
浏览 83回答 0
0回答

炎炎设计

%40- 请参阅HTML URL 编码参考。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java