On Fri, Nov 4, 2011 at 11:52 AM, Donald Whytock <[email protected]> wrote:
> On Fri, Nov 4, 2011 at 10:48 AM, Donald Whytock <[email protected]> wrote:
>> This showed up with camel-mail also.  It has to do with how URIs are
>> parsed.  I believe there was a JIRA.
>
> Looks like camel-ftp/RemoteFileConfiguration gets the user ID from the
> URI the same way camel-mail/MailConfiguration does, by using
> URI.getUserInfo().  This comes up null for URIs like
> username@[email protected].

Actually, I think the URI is handling it correctly.  After running my
initial tests I looked up the FTP RFC spec and found that all
usernames must escape special characters (eg: @'s) embedded within.
Using a %40 yielded the correct results.  (Hence the reason for
getRawXXX w/in the URI class).  Giving camel-ftp the escaped string
works correctly.

I would expect a uri string of 'ftp://user@blah@actualhost/' to fail
within camel (user%40@actualhost) works.  The question, then becomes
is it necessary to escape the format of
'ftp://actualhost/?username=user@blah' ?  Not sure... (I imagine it
currently only works with %40).
\
I imagine the issue with camel-mail also be similar.  The MAIL RFC
spec may also specify special characters require escaping. Try
substituting all @'s except the last with %40 in the email address
before passing it to camel.

Reply via email to