Closed Bug 216154 Opened 21 years ago Closed 21 years ago

Anchors in e-mails are broken (Clicking Anchor doesn't go to target in e-mail) (is not a registered protocol)

Categories

(MailNews Core :: Backend, defect)

x86
Windows NT
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Peter, Assigned: sspitzer)

References

Details

Attachments

(5 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5b) Gecko/20030810
Build Identifier: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5b) Gecko/20030810

Anchors in e-mails are broken (Clicking Anchor doesn't go to target in e-mail)

Reproducible: Always

Steps to Reproduce:
1. receive an HTML e-mail that contains anchors (e.g., GameSpy newsletter)
2. Click on table of Contents item (that should take you to article further down)
Actual Results:  
- e-mail doesn't scroll to anchored location
- Error message appears (see screenshots)

Expected Results:  
- e-mail is scrolled to anchored location (further down in e-mail).
*** Bug 214416 has been marked as a duplicate of this bug. ***
Interestingly, the anchors *do* work when opening the HTML e-mail in the
browser; but they do *not* work in mail-news.
Broken base url?
Unlikely, because this bug exists now for *all* e-mails (completely unrelated to
each other) i receive that have anchors. In older mozilla versions, the anchors
all used to work.
I was refering to a possible change that broke the base-url in mailnews.
*** Bug 216864 has been marked as a duplicate of this bug. ***
*** Bug 217722 has been marked as a duplicate of this bug. ***
*** Bug 219340 has been marked as a duplicate of this bug. ***
*** Bug 220048 has been marked as a duplicate of this bug. ***
updating summary
Summary: Anchors in e-mails are broken (Clicking Anchor doesn't go to target in e-mail) → Anchors in e-mails are broken (Clicking Anchor doesn't go to target in e-mail) (is not a registered protocol)
The base URL may have been broken all along, but anchor scrolling was recently
changed to use nsIURI instead of strings.
Debug warning:

WARNING: malformed url: no scheme, file
c:/mozilla/netwerk/base/src/nsStandardURL.cpp, line 686
Hmmm ... one of the first steps when clicking on a link is resolving the link to
a new complete url. This also happens with anchors. The debug message indicates
that the resolving process results in a string that can not be identified as an
url. I see only one options here: The base url is already invalid (or not
existing) before the resolving ... the result does not change that. Maybe
switching to nsIURI (as Boris mentioned) caused the baseurl to get lost or
getting invalid. The link-strings from the testcase look ok, so I don't think
they can be the reason.
Neil, what is the string that necko is passed when you get that warning?  The
stack for the warning should be under TriggerLink().  What is the baseURI there?
The baseURI looks fine, but unfortunately nsMailboxService::NewURI appears to
ignore it, unless the spec contains "?uidl" or "&uidl" for some pop3 reason.
More mail URI mess....
Component: Mail Window Front End → Mail Back End
*** Bug 221089 has been marked as a duplicate of this bug. ***
*** Bug 222170 has been marked as a duplicate of this bug. ***
I've observed that these email links to anchors within the email do work with
other email readers, just not with Mozilla 1.5 email reader.

I double checked with UNIX netscape communicater 4.77 email reader and the links
work fine there.  So I believe the links are valid, just not working correctly
within the email reader.
Surprised this bug wasn't fixed in Moz 1.5 release as it is clearly regressive
to Moz 1.4.1, that is, the anchors worked fine in 1.4.1, not in any version of
1.5 so far. I haven't checked to see if the same bug occurs in FBird.
*** Bug 222434 has been marked as a duplicate of this bug. ***
Blocks: 210164
Mail are also broken when you send it with moz 1.5
Sorry, but is this bug being worked on? It has been out there for a very long
time.. 
I will try to take a look starting with neil's comment #18, can anybody send me
such an email for tests.
Attached file email with ancors
Added an attachment with an email with ancors that do not work.
Thanks to all sending me testmails ... I think I have a fix for this. Neil was
right. Unfortunally I already have a patched nsMailboxService.cpp from bug 93666
... the bug is more than 2 years old ... the patch rots away for more than half
a year now ... still assigned to a netscape.com address. So this needs a little
bit more work from my side.
Comment on attachment 134706 [details] [diff] [review]
This patch fixes the problem for me ... please apply and test 

OK, so this does appear to fix the problem for POP3 and local accounts, but not
IMAP and presumably not news either.

>     nsCOMPtr<nsIMailboxUrl> aMsgUrl;
>     nsresult rv = NS_OK;
>     nsACString::const_iterator b, e;
>+    nsCString newSpec;
Should be defined where it is used... but then again, so should aMsgUrl ;-)

>+      if (!aBaseURI) {
>+        aUrl->SetSpec(aSpec);
>+      } else {
>+        aBaseURI->Resolve(aSpec,newSpec);
>+        aUrl->SetSpec(newSpec);
>+      }
Brace style in this file is each brace on its own line.
Attached patch beautified patchSplinter Review
patch beautified and extended for imap and news. I left pop3Service out, I
don't think it makes sense there.
Attachment #134706 - Attachment is obsolete: true
Comment on attachment 134730 [details] [diff] [review]
beautified patch

sr=bzbarsky if you switch to nsCAutoString and put spaces between "," and
"newSpec" in the Resolve() calls...

bienvenu, what do you think?
Attachment #134730 - Flags: superreview+
Attachment #134730 - Flags: review?(bienvenu)
Comment on attachment 134730 [details] [diff] [review]
beautified patch

yes, r=bienvenu, with the same conditions as bz (nsCAutoString, formatting...)
and no, nsPop3Service is not needed for this.
Attachment #134730 - Flags: review?(bienvenu) → review+
*** Bug 215248 has been marked as a duplicate of this bug. ***
Patch tweaked slightly and checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
*** Bug 224690 has been marked as a duplicate of this bug. ***
Thanks Neal. :) Another of my most-hated bugs fixed by you. You're rapidly
turning into my mozilla-hero-of-the-year. ;)
As a user, I also thank you Neal!  The nightly windows update seems to be frozen
at 28-Oct-2003. When will this patch be applied..

Thanks Again...
 
  
The build at http://frp.pryan.org/firebird/mozjf/ includes the patch for this bug.

I've got it working right now and all looks good.

It does have the calendar built in but that can be removed if you don't want it.

Sorry Rollin, 

but I am looking for the Mozilla updated version not firebird.

The good mozilla build which includes the fix for this bug has been moved to
http://frederic.bezies.free.fr/weblog/mozilla/

Sorry about the earlier misdirection.
*** Bug 225154 has been marked as a duplicate of this bug. ***
*** Bug 225581 has been marked as a duplicate of this bug. ***
*** Bug 225600 has been marked as a duplicate of this bug. ***
*** Bug 225975 has been marked as a duplicate of this bug. ***
*** Bug 226083 has been marked as a duplicate of this bug. ***
*** Bug 226966 has been marked as a duplicate of this bug. ***
*** Bug 227443 has been marked as a duplicate of this bug. ***
*** Bug 233042 has been marked as a duplicate of this bug. ***
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: