Open Bug 617287 Opened 14 years ago Updated 3 months ago

news: URIs are mangled (RFC 5538)

Categories

(MailNews Core :: Networking: NNTP, defect)

defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: psychonaut, Unassigned)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101026 SUSE/2.0.10-1.2 SeaMonkey/2.0.10
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101026 SUSE/2.0.10-1.2 SeaMonkey/2.0.10

SeaMonkey mangles RFC 5538-compliant news: URIs of the form news:foo.bar.baz, which is used to refer to the newsgroup foo.bar.baz.  It rewrites them to news://foo.bar.baz/, which instead refers to the NNTP server foo.bar.baz.  It should not do this!  A newsgroup is different from an NNTP server.

The problem also affects the syntax of news: URIs which refer to individual articles.  For example, news:foo@bar is supposed to refer to the article with the Message-ID <foo@bar>.  However, SeaMonkey rewrites the link as news://foo@bar/, which according to RFC 5538 and RFC 3986 tells a user agent to log into the NNTP server bar with the username foo.

Reproducible: Always

Steps to Reproduce:
1. Open a web page containing the following HTML:
   <a href="news:comp.lang.c">comp.lang.c</a>
See the URL above for an example.
2. Hover the mouse over the link.
3. Right-click on the link, select "Copy link location" from the context menu, and then paste the link into some other application, such as a text editor.
Actual Results:  
2a. The status bar shows the link as "news://comp.lang.c/", not "news:comp.lang.c".  According to RFC 5538, the former is the URI of an NNTP server named comp.lang.c, whereas the latter is the URI of the newsgroup comp.lang.c.  In the first case, a user agent supporting the news: protocol should open a connection to the NNTP server, but not access any particular newsgroup.  (It might instead show a list of available groups on the server.)  In the second case, the user agent would normally open the comp.lang.c newsgroup using the user's default NNTP server.
3a. The link is copied and pasted as "news://comp.lang.c/", not "news:comp.lang.c".

Expected Results:  
2a, 3a. SeaMonkey should have left the link as-is, not rewritten it into something that means something entirely different.
Minefield doesn't seem to have this problem (AFAICT - they don't have a statusbar any more).
Firefox doesn't have a protocol handler for news, so it treats them as unknown. SeaMonkey and Thunderbird do have a protocol handler for news, and it's quite possible that it doesn't support newsgroup links.
(In reply to comment #2)
> Firefox doesn't have a protocol handler for news, so it treats them as unknown.
> SeaMonkey and Thunderbird do have a protocol handler for news, and it's quite
> possible that it doesn't support newsgroup links.

The standard URI parser "helpfully" throws in the extra slashes, on the basis that the string is "obviously" an authority, so those "missing" slashes are merely people not typing it in correctly.

So far, the best my no-authority parser is doing is munging the URI from news:foo.bar to news:///foo.bar, which at least puts the group in the right URI portion.
Doesn't SeaMonkey have a built-in news client?  If so, one would hope that it would properly support all the valid syntaxes for nntp: and news: URIs, including links to individual newsgroups and articles.

Can the standard URI parser simply be told not to "fix" news: URIs?  So far as I can tell it doesn't "fix" other URIs such as tel: and sip:.
Actually the latter are simple URIs rather than standard URLs. (Bad terminology, possibly.) Firefox happens to use simple URIs for news as well.
(In reply to comment #4)
> Doesn't SeaMonkey have a built-in news client?  If so, one would hope that it
> would properly support all the valid syntaxes for nntp: and news: URIs,
> including links to individual newsgroups and articles.

bug 167991 and bug 108877. I've been working on supporting no-authority news URIs, but I have had too little time recently to do too much on it.
Should I move this bug over to Core::HTML5/Parser on the news: url parsing issue?
Component: General → Networking: NNTP
Product: SeaMonkey → MailNews Core
QA Contact: general → networking.nntp
The bug still exists in Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120130 Firefox/10.0 SeaMonkey/2.7 but with slightly modified behaviour:  URIs of the form news:foo.bar.baz are now rewritten to news://foo.bar.baz instead of news://foo.bar.baz/ (that is, the trailing slash no longer appears).
Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120312 Thunderbird/11.0

This bug is still open relative to news: URIs where the NNTP server is omitted.  

Unlike the news.mozilla.org newsgroups, which are all on one server, "public" newsgroups (e.g., alt.*, comp.*, news.*, sci.*, humanities.*, rec.*, soc.*, talk.*, and misc.*) are carried on a number of NNTP servers.  If I wish to communicate to someone about the rec.gardens, in which I participate via the reader.albasani.net server, I must allow for the fact that others participate in that same newsgroup via the news.eternal-september.org server.  Thus, the ability to have a functioning news: URI without indicating a specific server.
The bug has mutated yet again.  Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Firefox/11.0 SeaMonkey/2.8 now rewrites news:foo.bar.baz as news:///foo.bar.baz – that is, there are now three(!) slashes following the colon, and no trailing slash.
Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120420 Thunderbird/12.0

This is also a Thunderbird problem.  In the mozilla.test newsgroup on the news.mozilla.org NNTP server, see the message with Subject: Testing news: Protocol at <news://news.mozilla.org:119/tZWdnb95e9ugfQfSnZ2dnUVZ_uWdnZ2d@mozilla.org>.  The third news: URI -- <news:rec.gardens> -- is interpreted by Thunderbird as <news:///rec.gardens>.  This was NOT fixed by the fix for bug #226890.
Attached image screen shot showing problem —
Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0

This is still a problem.  The screenshot was taken while my cursor was over the first (of four) news: URIs.  Note the way the URI is displayed in the status bar.  I get the same result if I "Copy Link Location" and paste into an ASCII editor.  

There is no work-around if I want to view the newsgroup message in Thunderbird, which is the Mozilla newsreader.  That is because Thunderbird has no capability to open a newsgroup message from a pasted URI.  Without any work-around, this bug report should have Severity=major instead of normal.
Severity: normal → major
OS: Linux → All
Hardware: x86_64 → All
I question why this is Mail News Core/Networking:NNTP.  The same problem exists with newsgroup URIs on Web pages rendered by the browser function of SeaMonkey.  The rendering of Web pages is inherent in the Mozilla Core product, but I am not sure which component of Core is affected.
Thunderbird 38.3, Firefox 42.0
Enter news:cn.fan in Firefox's address bar.
Thunderbird opens, but do not jump to cn.fan group.
Error console:
Timestamp: 2015-11-27 20:25:06
Error: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIMsgMessageUrl.messageHeader]
Source File: resource://gre/components/nsMailNewsCommandLineHandler.js
Line: 83
I send two test message:
One is plane text:
news:cn.fan
The other is HTML:
<a href="news:cn.fan" moz-do-not-send="true">cnfan</a>

Thunderbird 38.4 do no respond to both of them. And Error console is blank.
So it seems I can conclude that it is Thunderbird itself that do not support news: protocol well, and Firefox may transfers wrong info also.
Problem (as described in Comment #10) still exists in SeaMonkey 2.39.
Blocks: 108948
Bug 226890 is raised earlier.
And URI like:
news:mailman.8161.1449216174.18044.support-thunderbird@lists.mozilla.org
crashes TB 38.4.
Sorry I can't reproduce the crash again. Now it just gives the error:

Timestamp: 2015-12-8 19:15:56
Error: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMessageUrl.messageHeader]
Source File: resource://gre/components/nsMailNewsCommandLineHandler.js
Line: 83
There is this bug in more details https://bugzilla.mozilla.org/show_bug.cgi?id=745856
Those bugs are all related: bug 11076, bug 16343, bug 167991
Not to say the bugs they block.
15 years ... 

Can someone aggregate all these bugs, or set the depends|duplicates?
Problem as described in Comment #10 is still reproducible in SeaMonkey 2.49.4.  Also reproducible in Thunderbird 52.9.1.

TCW, can you (I hope) do some considlidation work, marking duplicates as needed, for Comment 19, comment 20, and also referencing dependencies here and in bug 108948 and bug 327885 - and by extension decide which one gets to say open?

Severity: major → normal
Flags: needinfo?(thee.chicago.wolf)

(In reply to Wayne Mery (:wsmwk) from comment #22)

TCW, can you (I hope) do some considlidation work, marking duplicates as needed, for Comment 19, comment 20, and also referencing dependencies here and in bug 108948 and bug 327885 - and by extension decide which one gets to say open?

I was trying to repro this news:/// and news: thing but my work work PC is not setting TB as Default for Mail / News for some reason even when I set it to do so via Windows "Choose an App" dialogue box.

I had previously had SM installed with it handling NEWS links an such but after uninstalling SM, I tried to make TB the default app / handler for NEWS and it's not letting me, even with Admin privileges. I'll try at home later and see what happens.

I'm also struggling to find some reference news: and news:// links to test with. Anyone have some handy? Google's turning up zero. =\

Flags: needinfo?(thee.chicago.wolf)

Bug 745856 is probably somewhat related to bug 11076.

(In reply to Arthur K. from comment #23)

I'm also struggling to find some reference news: and news:// links to test with. Anyone have some handy? Google's turning up zero. =\

Perhaps Joshua

Flags: needinfo?(Pidgeot18)

Well, at home I tried Tools > Options > Advanced > System Integration > Check Now button > Use Thunderbird as the default client for: > E-Mail and Newsgroups checked > click Set As Default and....and nothing happened. I went back and both boxes were unchecked. So it's a bug / regression I am guessing.

Error Console spit this out:

TypeError: listbox is nullgdata-migration.js:17:21
<anonymous> chrome://gdata-provider/content/gdata-migration.js:17
_fireButtonEvent chrome://global/content/bindings/dialog.xml:433
_doButtonCommand chrome://global/content/bindings/dialog.xml:407
_handleButtonCommand chrome://global/content/bindings/dialog.xml:395

Sorry, if you want me to file this as a new bug, just say the word.

Opened bug 1568550 in relation to comment 26 as it may be related to this bug in that TB is not setting itself as the default app to handle news:// and related links.

(In reply to Arthur K. from comment #23)

I was trying to repro this news:/// and news: thing but my work work PC is not setting TB as Default for Mail / News for some reason even when I set it to do so via Windows "Choose an App" dialogue box.

Is this really necessary? The problem described in this bug report is that the URIs get rewritten by the browser. You don't need a news client to test this. If checking the URI in the status bar in the browser isn't a surefire way, then you could always write a one-line shell script that simply echoes its arguments to a temp file, and then set that shell script as the default handler for the news: protocol.

I'm also struggling to find some reference news: and news:// links to test with. Anyone have some handy? Google's turning up zero. =\

RFC 5538 contains several example URIs, albeit with placeholder newsgroups and news servers.

If you want some examples with functioning real-world names, then one example of a valid news: URI is as follows:

news:comp.lang.c

This refers to the newsgroup comp.lang.c. A news client should process this by, for example, displaying the messages in the newsgroup by fetching them from some predetermined news server.

Another example of a valid news: URI is as follows:

news://nntp.aioe.org/comp.lang.c

This also refers to the newsgroup comp.lang.c. A news client should process this by, for example, displaying the messages in the newsgroup by fetching them from the news server nntp.aioe.org. (This is a free public news server whose terms of use can be found at http://news.aioe.org/.)

(In reply to Tristan Miller from comment #29)

(In reply to Arthur K. from comment #23)

I was trying to repro this news:/// and news: thing but my work work PC is not setting TB as Default for Mail / News for some reason even when I set it to do so via Windows "Choose an App" dialogue box.

Is this really necessary? The problem described in this bug report is that the URIs get rewritten by the browser. You don't need a news client to test this. If checking the URI in the status bar in the browser isn't a surefire way, then you could always write a one-line shell script that simply echoes its arguments to a temp file, and then set that shell script as the default handler for the news: protocol.

I'm also struggling to find some reference news: and news:// links to test with. Anyone have some handy? Google's turning up zero. =\

RFC 5538 contains several example URIs, albeit with placeholder newsgroups and news servers.

If you want some examples with functioning real-world names, then one example of a valid news: URI is as follows:

news:comp.lang.c

This refers to the newsgroup comp.lang.c. A news client should process this by, for example, displaying the messages in the newsgroup by fetching them from some predetermined news server.

Another example of a valid news: URI is as follows:

news://nntp.aioe.org/comp.lang.c

This also refers to the newsgroup comp.lang.c. A news client should process this by, for example, displaying the messages in the newsgroup by fetching them from the news server nntp.aioe.org. (This is a free public news server whose terms of use can be found at http://news.aioe.org/.)

Thanks for the real-world server. I was having a tough time finding a working free nntp server as many have long since shut down.

I know the origins of this bug are originally Seamonkey related but I have TB 68.0b5 installed alongside FF 68.0.1 and TB is handling my Newsreader stuff so invocation should function the same I would think. I suppose it wouldn't be too hard to just generate a simple test HTML with mangled and non-mangled syntax and see what happens. So I did exactly that. Thankfully with the news://nntp.aioe.org/comp.lang.c example, it seemed to have worked fine. When I clicked the link, it prompted me to subscribe, which I did, but the server did not immediately appear in the Folder Pane. It did after I restarted TB.

But here's where things get a bit weird behaviorally. I'm taking a leap of faith that it's somewhat related to what's happening in this bug. If you guys feel differently (or if I'm making unrelated noise), I'll open another bug and apologize in advance.

I. Based on the server info Tristan provided, I created two links where, I believe, A should be the correct syntactical formatting and B should be incorrect syntactical formatting:
A. news://nntp.aioe.org/comp.lang.c
B. news:///nntp.aioe.org/comp.lang.c

II. I created and published a simple HTML document with clickable links to A & B.
<html><body>
<a href="news://nntp.aioe.org/comp.lang.c">news://nntp.aioe.org/comp.lang.c</a><p>
<a href="news://nntp.aioe.org/comp.lang.c">news:///nntp.aioe.org/comp.lang.c</a>
</body></html>

III. I emailed A and B to myself.

IV. When I click on A from within an email message, all works fine. When I click on B from within an email message, nothing happens. Seems correct.

V. When I click on A from the web page, all works fine. When I click on B from the web page, nothing happens. Seems correct.

VI. Here's where it falls over for me. If I click B from within an email message, nothing happens. But if I immediately go to the web page and click B, it invokes TB to want to subscribe and download headers. It shouldn't. Conversely, if I first click B from the web page (nothing happens) and then click B from an email, nothing happens. Which is correct behavior.

Oops. I see one error already. Sorry.

Is supposed to be <a href="news:///nntp.aioe.org/comp.lang.c">news:///nntp.aioe.org/comp.lang.c</a>

News and NNTP URIs are defined in RFC 5538: https://tools.ietf.org/html/rfc5538

The nntp URL is:
nntp://[userinfo@]host[:port]/group[/article-number]

The authority is optional in news: URIs, and they can refer to either a newsgroup name (more specifically, a newsgroup wildmat), or a newsgroup message ID:
news:[//[userinfo@]host[:port]/]<newsgroup name>
news:[//[userinfo@]host[:port]/]<msg-id>

So the following URLs all reference m.d.a.t:
news:mozilla.dev.apps.thunderbird
news://news.mozilla.org/mozilla.dev.apps.thunderbird
nntp://news.mozilla.org/mozilla.dev.apps.thunderbird

And the following URLs all reference (at this time) the newest message in that newsgroup:
news:VJudnUQgWaGUwa7AnZ2dnUU7-X3NnZ2d@mozilla.org
news://news.mozilla.org/VJudnUQgWaGUwa7AnZ2dnUU7-X3NnZ2d@mozilla.org
nntp://news.mozilla.org/mozilla.dev.apps.thunderbird/16191

Flags: needinfo?(Pidgeot18)
Severity: normal → S3
See Also: → 1785790

No longer reproducible with SeaMonkey 2.53.17.

No longer reproducible with Firefox 117.0.

Still reproducible with Thunderbird 115.2.0.

See Also: → 1886132
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: