FAQ
hello,

the mail header List-Archive for private archives does not work,
because the URL does not contain the trailing slash:

The private lists are handled by CGI /usr/lib/mailman/cgi-bin/private which can
not handle the URL without the trailing slash properly

in Mailman/Handlers/CookHeaders.py there is in fact a code, which
removes the slash from the URL you send in this header:
what is the purpose of this?

a quick patch is not to remove the slash, when the archive is private:
I send the patch in the attachment

or maybe the slash-removing code can be removed entirely, but
I am not sure what it was originally for...

regards,

Daniel Novotny

Search Discussions

  • Daniel Novotny at Mar 30, 2009 at 1:52 pm
    hello,

    somehow, the patch in the attachment did not appear in the mailing list, sending
    it here as plaintext:

    diff -up mailman-2.1.12/Mailman/Handlers/CookHeaders.py.privurl mailman-2.1.12/Mailman/Handlers/CookHeaders.py
    --- mailman-2.1.12/Mailman/Handlers/CookHeaders.py.privurl 2009-03-30 15:03:58.000000000 +0200
    +++ mailman-2.1.12/Mailman/Handlers/CookHeaders.py 2009-03-30 15:06:45.000000000 +0200
    @@ -215,7 +215,7 @@ def process(mlist, msg, msgdata):
    # Add this header if we're archiving
    if mlist.archive:
    archiveurl = mlist.GetBaseArchiveURL()
    - if archiveurl.endswith('/'):
    + if archiveurl.endswith('/') and archiveurl.find("private") == -1:
    archiveurl = archiveurl[:-1]
    headers['List-Archive'] = '<%s>' % archiveurl
    # First we delete any pre-existing headers because the RFC permits only
  • Mark Sapiro at Mar 30, 2009 at 10:33 pm

    Daniel Novotny wrote:
    somehow, the patch in the attachment did not appear in the mailing list, sending
    it here as plaintext:

    This list's content filtering removes attachments which have MIME types
    other than text/plain.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Mark Sapiro at Mar 30, 2009 at 10:31 pm

    Daniel Novotny wrote:
    the mail header List-Archive for private archives does not work,
    because the URL does not contain the trailing slash:

    The private lists are handled by CGI /usr/lib/mailman/cgi-bin/private which can
    not handle the URL without the trailing slash properly

    in Mailman/Handlers/CookHeaders.py there is in fact a code, which
    removes the slash from the URL you send in this header:
    what is the purpose of this?

    I don't know. It's been there since the beginning of Mailman 2.1, but I
    don't know why.

    a quick patch is not to remove the slash, when the archive is private:
    I send the patch in the attachment

    or maybe the slash-removing code can be removed entirely, but
    I am not sure what it was originally for...

    Neither am I sure what it was for. It doesn't matter much either way
    for the public 'pipermail' URLs because the browser knows whether it
    is serving a file or an index document and informs the browser, but it
    does matter for private URLs.

    In fact, I have a bigger problem with users typing archive URLs without
    the slash, so I have in Apache

    RewriteEngine on
    RewriteCond %{REQUEST_URI} ![.][^/]+$
    RewriteRule ^/mailman/(private/.*[^/])$ http://%{HTTP_HOST}/mailman/$1/
    [L,R]

    to append a slash to the end of any /mailman/private/* url that doesn't
    end with a slash or a file extension.

    At present, there are no more 2.1.x releases planned, but I'll stop
    removing the slash for 2.2.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Mark Sapiro at Mar 30, 2009 at 10:43 pm

    Mark Sapiro wrote:
    Neither am I sure what it was for. It doesn't matter much either way
    for the public 'pipermail' URLs because the browser knows whether it
    is serving a file or an index document and informs the browser, but it
    does matter for private URLs.

    That should have been "... the web server knows ..."

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedMar 30, '09 at 1:20p
activeMar 30, '09 at 10:43p
posts5
users2
websitelist.org

2 users in discussion

Mark Sapiro: 3 posts Daniel Novotny: 2 posts

People

Translate

site design / logo © 2023 Grokbase