Closed Bug 17214 Opened 25 years ago Closed 25 years ago

Pre-escape username and hostname before constructing URLs and URIs.

Categories

(SeaMonkey :: MailNews: Account Configuration, defect, P1)

x86
Linux
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: alecf, Assigned: alecf)

Details

Now that the URI parsing consolidation is basically complete, it's time to
tackle escaping all the components that make up a URI.

I think the appropriate place to is all the way at the top, in
nsIMsgIncomingServer::GetServerURI() the first time we create any
server-oriented URI. The only trick is making sure that all consumers of URIs
(and possibly URLs) unescape the username and hostname if they ever need the
actual values.

It would be much cooler if these consumers went right to the server to get the
real username and password however. I'll look into it.

I need to do this to fix some of the "Local Mail" problems that came up today,
CC'ing shaver because this may be the solution he's looking for for solving the
"@" in usernames problem.
Status: NEW → ASSIGNED
Priority: P3 → P1
Summary: pre-escape username and hostname before constructing URLs and URIs. → [DOGFOOD] pre-escape username and hostname before constructing URLs and URIs.
marking dogfood.
This must be fixed or we'll have serious problems with Local Mail.
Please explain what the exact problem is with mail.
it's kind of hard to explain. If a username or a hostname contains a space, URL
creation may fail, which means certain network operations like moving messages
between folders may fail to run. In the case of Local Mail, "Local Mail" has a
space in it, and so message copy operations to and from local mail don't work...

This is really more of a "mail porkjockey" bug I guess.
Target Milestone: M11
Summary: [DOGFOOD] pre-escape username and hostname before constructing URLs and URIs. → Pre-escape username and hostname before constructing URLs and URIs.
Per alexf, taking dogfood off.
I don't understand.  Is local mail (or support for usernames/password with / or
@ or space) not a dogfood requirement?

I took alecf's ``mail porkjockey'' description as an amplification of the
urgency, not as a contradiction of the [DOGFOOD] status.  Was there some
out-of-band conversation about the [DOGFOOD]ness?

(What's the difference between you removing [DOGFOOD] and marking [PDT-]?)
fix in my tree. Will checkin this afternoon.
It's looking like my change has somehow broke displaying the subject of messages
in the thread pane. I'm investigating now, but I think this will have to wait
for M12.
Unless you've checked in, I see the same thing on my linux box.
it turns out the other bug was in fact I18N's fault.
This bug will get fixed tonight after all.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
oops, forgot to mark this fixed.
QA Contact: lchiang → ppandit
In nsMsgIncomingServer.cpp:

if (NS_SUCCEEDED(rv) && ((const char*)username) && username[0]) {
164         nsXPIDLCString escapedUsername;
165         *((char **)getter_Copies(escapedUsername)) =
166             nsEscape(username, url_Path);
167         // not all servers have hostnames
168         uri += escapedUsername;
169         uri += '@';
170     }

if (NS_SUCCEEDED(rv) && ((const char*)hostname) && hostname[0]) {
176         nsXPIDLCString escapedHostname;
177         *((char **)getter_Copies(escapedHostname)) =
178             nsEscape(hostname, url_Path);
179         // not all servers have hostnames
180         uri += escapedHostname;
181     }
Status: RESOLVED → VERIFIED
Able to move a message into a folder called "TestFolder 2".
Using a debug build from 1/11/00 on Windows NT.

VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.