List-archive link not working

Bug #266232 reported by Grahamk
2
Affects Status Importance Assigned to Milestone
GNU Mailman
New
Medium
Unassigned

Bug Description

Running mailman version 2.1.6rc1, new installation on
Scientific Linux 3.04 with Apache and Postfix as
distributed.

The list-archive link supplied in messages loses the
archive name when clicking through to the view by
"thread" link.

Example:

1. Message contains:
List-Archive:
<http://lists.ontonet.org/mailman/private/ontogenesis>

2. Clicking on this yields a page at the given URI.
NOTE browser is running and already logged into view
the private archive (see step 6 below)

3. Clicking on view by thread link displays new page at
this URI:
http://lists.ontonet.org/mailman/private/2005q2/thread.html
containing the text:
No such list 2005q2

Note that the mailing list name (ontogenesis) has been
dropped.

4. If I browse directly to the same URI, same result
(no surprise).

5. If I browse directly to this URI
http://lists.ontonet.org/mailman/private/ontogenesis/
(note trailing '/') then it works just fine.

6. And here's an extra wrinkle. If the browser is not
already logged in to view the private mailing list,
then the login page is displayed. After logging in,
the requested archive frontpage is displayes *with a
trailing '/' in its URI*, and the view-by link works
just fine.

...

Hypothesis: relative URI calculation is dropping the
final path segment of the base URI when there is no
trailing '/'. (This would be correct behaviour
according to URI spec)

Examination of "view page source" shows that the links
are relative refererecnes within the TOC page, so this
hypothesis appears to be confirmed. Thus, it is vital
that the index page is accessed using a URI with a
trailing '/', otherwise the list name is dropped when a
full URI is formed from the relative reference.

One solution is to place a <BASE> directive in the
<head> of the TOC document. I've edited the
corresponding Index.html by hand, and this seems to work.

I've also identified two simple patches that I think
achieve this:

(1) In Archive/HyperArch.py:
[[
    def html_TOC(self):
        mlist = self.maillist
        listname = mlist.internal_name()
        mbox =
os.path.join(mlist.archive_dir()+'.mbox', listname+'.mbox')
        d = {"listname": mlist.real_name,
             "listinfo": mlist.GetScriptURL('listinfo',
absolute=1),
             "archurl": mlist.GetScriptURL('private',
absolute=1)+'/', [[[GK]]]
             "fullarch": '../%s.mbox/%s.mbox' %
(listname, listname),
             "size": sizeof(mbox,
mlist.preferred_language),
             'meta': '',
             }
 :
]]
(added "archurl" entry)

(2) In templates/en/archtoc.html, archtocnombx.html
[[
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
  <HEAD>
     <title>The %(listname)s Archives</title>
     <META NAME="robots" CONTENT="noindex,follow">
     <BASE href="%(archurl)S">
     %(meta)s
  </HEAD>
  :
]]
(added <BASE ...> in <HEAD>

Similar edits would be needed for other languages.

I haven't figured out how to force mailman to
regenerate the archive TOC file, so haven't yet been
able to test thisyet.

...

Not sure if this might be related to:
[ 767596 ] mailman list archive links not working with
virtual hosts

[http://sourceforge.net/tracker/index.php?func=detail&aid=1203596&group_id=103&atid=100103]

Tags: pipermail
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.