Closed Bug 302213 Opened 19 years ago Closed 19 years ago

Embedded mailto: URLs are broken in mail

Categories

(MailNews Core :: Networking, defect)

x86
Windows XP
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.8beta4

People

(Reporter: stephend, Assigned: bzbarsky)

References

Details

(Keywords: regression)

Attachments

(1 file)

Build ID: 2005-07-26-05, Windows XP SeaMonkey trunk.

Not sure if your checkin to bug 244964 merely exposed an underlying problem, or
if it broke this outright...

Summary: Embedded mailto: URLs are broken in mail.

Steps to Reproduce:

1. Click on any <a href="mailto:blah@blah.com"> link in mail.

Actual Results:

The file "blah@blah.com" is of type
application/x-java-applet;jpi-version=1.5.0_04, and SeaMonkey does not know how
to handle this file type.  This file is located at:

mailto:

What should SeaMonkey do with this file?

* Open it with the default application
* Open it with ________________ Choose...
* Save it to disk
[ ] Always perform this action when handling files of this type

Expected Results:

Just launch a mail compose window.
Stephen, what makes you think this has anything to do with the checkin for bug
244964?
[12:15] <DavidBienvenu> yup
[12:15] <DavidBienvenu> I updated in netwerk, and now I can't do mailto links -
Thx, Stephen! :-)
So the problem is that the mailto protocol handler creates an input stream
channel as follows:

  357   return NS_NewInputStreamChannel(_retval, aURI, pipeIn,
  358                            NS_LITERAL_CSTRING("x-application-mailto"));

That's not a valid content-type (no '/' in it).  NS_ParseContentType used to not
care and just set that as the type; the new code, just like the old HTTP header
code, ignores the bogus type.

So a wallpaper fix would be to use something like "application/x-mailto" instead.

The real fix would be to not use a fake type here at all -- as things stand a
site can cause a mail compose window to pop up by just returning data with the
"right" content type.  Is there a reason not to open the compose window from
AsyncOpen (with an appropriate channel impl, of course)?
Actually, I was wrong.  It's even worse.  Mailnews will actually throw on
non-mailto: URIs that happen to have the type it's using, which ends up with no
feedback for the user as to why their click did nothing...  So once we fix this,
I'll definitely file a followup but for mailnews to stop using a type here.
> site can cause a mail compose window to pop up by just returning data with the
> "right" content type.

of course they can also do location.href="mailto:foo@bar.com"...
and the code does have the maybe nice feature that asyncOpen has no
side-effects. so things like wbp should not trigger opening of compose windows.
which might the reason why it's implemented as is, re:
> Is there a reason not to open the compose window from
> AsyncOpen (with an appropriate channel impl, of course)?

> so things like wbp should not trigger opening of compose windows.

True, but we need to fix that for various other protocols anyway, at which point
mailto: should just use the "no data" protocol flag and stop doing what it does now.
Component: Networking: HTTP → MailNews: Networking
Attached patch Proposed fixSplinter Review
Attachment #190597 - Flags: superreview?(darin)
Attachment #190597 - Flags: review?(bienvenu)
Comment on attachment 190597 [details] [diff] [review]
Proposed fix

thanks, Boris.
Attachment #190597 - Flags: review?(bienvenu) → review+
Comment on attachment 190597 [details] [diff] [review]
Proposed fix

A #define for the mime type would be nice, but this works.  sr=darin
Attachment #190597 - Flags: superreview?(darin) → superreview+
Comment on attachment 190597 [details] [diff] [review]
Proposed fix

Requesting approval for simple regression fix.
Attachment #190597 - Flags: approval1.8b4?
Comment on attachment 190597 [details] [diff] [review]
Proposed fix

a=shaver
Attachment #190597 - Flags: approval1.8b4? → approval1.8b4+
Fixed.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta4
Verified FIXED using build 2005-07-27-05 on Windows XP SeaMonkey trunk.
Status: RESOLVED → VERIFIED
Filed followup bug 302661
Blocks: 244964
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: