Index: ChangeLog
===================================================================
--- ChangeLog	(revision 9495)
+++ ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-09-08  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #503662
+
+	* libedataserver/e-url.c: (e_uri_new):
+	Use last '@' in the address part to be the delimiter between
+	user name and server address, not the first one.
+
 2008-09-03  Srinivasa Ragavan  <sragavan@novell.com>
 
 	* libedataserver/e-sexp.c (parse_list): Fix a crash in sexp.
Index: libedataserver/e-url.c
===================================================================
--- libedataserver/e-url.c	(revision 9495)
+++ libedataserver/e-url.c	(working copy)
@@ -180,6 +180,16 @@ e_uri_new (const char *uri_string)
 		slash = uri_string + strcspn (uri_string, "/#");
 		at = strchr (uri_string, '@');
 		if (at && at < slash) {
+			const char *at2;
+			/* this is for cases where username contains '@' at it, like:
+			   http://user@domain.com@server.addr.com/path
+			   We skip all at-s before the slash here. */
+
+			while (at2 = strchr (at + 1, '@'), at2 && at2 < slash) {
+				at = at2;
+			}
+		}
+		if (at && at < slash) {
 			colon = strchr (uri_string, ':');
 			if (colon && colon < at) {
 				uri->passwd = g_strndup (colon + 1, at - colon - 1);
