Question
Using
MailNotificationEnhanced, I find that
WebNotify emails contain an incorrect URL. Contrary to the situation described in
WebNotifyEmailURLsAreIncorrect, I actually believe that my
TWiki.cfg is OK.
The
WebNotify emails work great when checked via MS Outlook - the URL is accurate and all links function correctly. Yet I've recently discovered that when the
very same email message is checked via yahoo's website with a web browser, the URLs are incorrect.
Only after asking some of my users did I find that many have been suffering all along - they just thought the
WebNotify emails had always been broken ...
So this effort is for them, to try and figure out why
WebNotify /
MailNotificationEnhanced works sometimes, but not others.
Detailed Description
When the message is viewed from MS Outlook:
<a href="../../view/Common/JapaneseCulture"><b>JapaneseCulture</b></a>
When the same email message is viewed in a web browser (mail.yahoo.com)
URL Generated in the E-Mail =
- Notice how
view appears twice in the URL
<a target="_blank" href="../../view/view/Common/JapaneseCulture"><b>JapaneseCulture</b></a>
Pontifications
Unfortunately, as proficient as I have become with TWiki, I'm a complete dummy with Perl. I don't know where to begin with
TWikiDebugging. But I do have a few thoughts, since I've been working on this & trying to figure it out.
-
Why is the HTML source code different in the two scenarios (for the same email message) ? Seems to me that since it's literally the same email message, a view source on it should be identical when view through a web brower and when viewed through Outlook.
-
I do notice, however, that in the scenario which behaves correctly (outlook), the HTML source code contains the following 1st line. The other source code does not.
<BASE HREF="../view/Common/WebHome">
-
More importantly, why does the URL in both scenarios contain this ../../view business ? Seems like using a fully qualified domain name to form the complete URL would be more appropriate.
-
Tell me where to go to fix this and I think the problem is solved !
Thanks a bunch for your help !! I know this is a funny one. But many of my users are doing without an operational
WebNotify email.
To provide as much information as possible, I've attached output from
testenv, as well as
view source outputs from both the one that works (outlook) and the one that does not (browser)
Environment
--
KeithHelfrich - 15 Jul 2004
Answer
This is due to a part of code, issue from originate mailnotify.pm (so this bug exist in all mailnotify versions). Fix it in Mailnotify.pm :
Old :
# change absolute addresses to relative ones & do some cleanup
$text =~ s/(href=\")$scriptUrlPath/$1..\/../goi;
$text =~ s/(action=\")$scriptUrlPath/$1..\/../goi;
New:
# fix some absolute addresses
$text =~ s/(href=\")$scriptUrlPath/$1$scriptUrl/goi;
$text =~ s/(action=\")$scriptUrlPath/$1$scriptUrl/goi;
--
PatrickNomblot - 06 Aug 2004

THANKS Patrick, that fixed it !!! Take care, --
KeithHelfrich - 07 Aug 2004