Hi
I am working on CAMEL-335 and digging into the mail component code to:
- improve the documentation
- improve the unit tests
- and improve the mail component itself with suggestions from Lars Heinemann
who coded the mail component in ServiceMix
I am puzzled with this code
class MailConfiguration
method: configure
// we can either be invoked with
// mailto:address
// or
// smtp:[EMAIL PROTECTED]:port/[EMAIL PROTECTED]
String fragment = uri.getFragment();
if (fragment == null || fragment.length() == 0) {
fragment = userInfo + "@" + host;
} else {
setFolderName(fragment);
}
setDestination(fragment);
1)
Why is uri fragments used for URI configuration of this component?
http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html
According to http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html the
fragment is the part after the #
Should we use fragments at all it seems confusing since the mail component is
the only component in Camel that uses this.
2)
The comments above do not stand true.
URI as "smtp:[EMAIL PROTECTED]:port/[EMAIL PROTECTED]" will not configure the
destination as [EMAIL PROTECTED]
And mailto using the fluent builder will not be recognized as the mail
component so is the comment wrong?
3)
Why is the foldername set with the fragment part? This is really confusing?
Isn't folderName only used for polling? And it should be INBOX, DRAFTS or
whatever the names can be?
I am included to rewrite this part of the configuration based on the stuff from
ServiceMix but wanted to get a clue why the code is as it is.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk