Encode URL in mail components
In what version(s) of Spring Integration are you seeing this issue?
For example:
5.3.8.RELEASE
Between 4.3.15 and 5.2.5
Describe the bug Getting UnknownHostException if imap password contains '@' character. for Example : spring: imapUser: 'username' imapSecret: 'springmail@123'
'imaps://${spring.imapUser}:${spring.imapSecret}@${spring.imapHost}:993/INBOX' Caused by: java.net.UnknownHostException: [email protected] in case
To Reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
Sample
A link to a GitHub repository with a minimal, reproducible sample.
Reports that include a sample will take priority over reports that do not. At times, we may require a sample, so it is good to try and include a sample up front.
You have to encode special characters (e.g. %40 for @) in URLs.
https://stackoverflow.com/questions/57205851/how-do-i-escape-the-character-when-setting-up-my-store-uri-in-spring-integrati
It was always like that and there is nothing Spring Integration specific. So, yes, better to start from Stack Overflow question first before raising issue over here.
So, closing as Invalid and reference to existing similar SO question and its answer like Gary has just done.
There is also a message note in the docs: https://docs.spring.io/spring-integration/docs/current/reference/html/mail.html#mail-namespace
If your username contains the '@' character, use '%40' instead of '@' to avoid parsing errors from the underlying JavaMail API.
After some team discussion we decided to reopen this issue with a decision to introduce an encodeUrl in the next 6.0 version, with true by default.
Thanks @garyrussell, @artembilan yes, I'll try to find answers from stackoverflow first, regret for inconvenience