Re: Mangling of /message-id/flat links

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: PostgreSQL WWW <pgsql-www(at)postgresql(dot)org>
Subject: Re: Mangling of /message-id/flat links
Date: 2016-02-15 16:48:04
Message-ID: CABUevEzmU+9nUUTzqBXcQrMk8iX5V1apQioPSTovfeqyQWtfQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Tue, Feb 2, 2016 at 10:38 PM, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com
> wrote:

> Hi
>
> The archives mangled a URL in the following message:
>
>
> http://www.postgresql.org/message-id/CAEepm=03=BT=NSEbufQ6JTvWVC2fm3jyddLfUi66fn2cJ727rw@mail.gmail.com
>
> Perhaps the pattern needs tweaking, something like this?
>
> diff --git a/django/archives/mailarchives/templatetags/pgfilters.py
> b/django/archives/mailarchives/templatetags/pgfilters.py
> index 337a1a3..577ff03 100644
> --- a/django/archives/mailarchives/templatetags/pgfilters.py
> +++ b/django/archives/mailarchives/templatetags/pgfilters.py
> @@ -23,7 +23,7 @@ def hidemail(value):
> #
> # Those are not email addresses, so ignore them. The links won't work if
> they
> # are mangled.
> -_re_mail =
> re.compile('(/message-id/)?[^()<>@,;:\/\s"\'&|]+(at)[^()<>@,;:\/\s"\'&|]+')
> +_re_mail =
> re.compile('(/message-id/|/message-id/flat/)?[^()<>@,;:\/\s"\'&|]+(at)[^()<>@,;:\/\s"\'&|]+')
> def _rewrite_email_match(match):
> if match.group(1):
> return match.group(0) # was preceded by /message-id/
>
> Or perhaps, instead of trying to recognise URLs that point back into
> the archives, it shouldn't mangle anything that looks like a URL.
>

Apologies for a late response. I've been working on a tool that lets us
make these changes and then do a "dry-run reapply" against existing
archivse and show diffs of what changed to make it a bit more safe to make
such changes. Unfortunately, that dug some old corruption in the archives,
so I'm working on fixing that first. Will get back to this one later.

When you say "anything that looks like an URL", how wouldyou define that?
In the form of a regexp? I agree that this might be a good idea..

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-www by date

  From Date Subject
Next Message Aman Rathi 2016-02-25 06:24:58 Fwd: Psql.exe error logging
Previous Message Pavel Stehule 2016-02-15 09:32:11 Re: editor rights for wiki