[
https://issues.apache.org/activemq/browse/CAMEL-777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wojciech Durczynski reopened CAMEL-777:
---------------------------------------
Sadly your improvement doesn't solve problem.
Look into this usecase:
endpoint: smtp://smtp.server.com?password=secret&[EMAIL PROTECTED]
header: [EMAIL PROTECTED]
Then during sending mail:
In MailConfiguration.setUsername() recipients map doesn't have element "To", so
recipients.put(javax.mail.Message.RecipientType.TO, "[EMAIL PROTECTED]");
is invoked
Later in MailBinding.populateMailMessage()
appendHeadersFromCamel() is invoked, which sets "To" recipients of message
right (to [EMAIL PROTECTED])
but in the same method just after this, is invoked:
if(recipients.containsKey(javax.mail.Message.RecipientType.TO))
mimeMessage.setRecipients(javax.mail.Message.RecipientType.TO,
(String)recipients.get(javax.mail.Message.RecipientType.TO));
And this rewrites "To" recipients of message to these, which are set in
recipients map. And that's "[EMAIL PROTECTED]" only, which is wrong.
Because of this recipient of the mail doesn't receive message, but only sender
gets it.
Why to bother with the following code and not remove it?:
if(!recipients.containsKey(javax.mail.Message.RecipientType.TO))
{
String address = username;
if(address.indexOf("@") == -1)
address = (new
StringBuilder()).append(address).append("@").append(host).toString();
recipients.put(javax.mail.Message.RecipientType.TO, address);
}
> Allow '@' in usernames.
> -----------------------
>
> Key: CAMEL-777
> URL: https://issues.apache.org/activemq/browse/CAMEL-777
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-mail
> Affects Versions: 1.4.0
> Reporter: Wojciech Durczynski
> Assignee: Claus Ibsen
> Fix For: 1.5.0
>
>
> Many servers use 'username'@'servername' as a login name. Camel-mail doesn't
> allow this.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.