The only big catch I see is that if someone emails -bugs directly, no
number is assigned, so we would have to leave that be.
Yeah, those would be entirely out of scope.
I don't know if we would want to use "/message-id/" as the parent URL,
just in case someone sent a message with an ID of just digits (for
whatever reason). Dare I suggest something like "/bugs/<id>/?
Or would we perhaps want tp use the
postgr.es urls-shorterner with just a /b/ (like we have /m/ for messageids)?
Assuming buy-in, what would need to be done is:
- Adjust the message import script to parse inbound messages with above
message beginning to -bugs. Determine if it is the first message to the
thread / bug ID is already registered. If it does not exist, record the
bug ID, message ID combo in a new table
That would suddenly put a very hard coded assumption into the archives code about this format, which I think is a bad idea in general since the archives code is not specific to the pgsql list usage *at all* today....
- Write a one time script to map old bug id to first message id in the
thread.
- Update the urls.py in pgarchives to handle said route and fail
gracefully if bug ID does not exist
- Note in pgweb where the email is generated that any changes to email
subject could break things.
And that should be that.
I think it would be easier to just have a simple piece of lookup code that has access to the archives db. When fed a bug number, it first looks for a messageid according to the new format messageid, and if its found (and just one) then redirect to that. If not, then to a subject prefix search and validate that the messageid is one that does match what it should do (e.g. that it comes from the correct servers -- there haven't been many so far, so it's easy to construct a whitelist) and returns exactly one, then redirect to that, otherwise 404.
The difficulty in all those is we don't currently index the subject other than as part of the full text. But that can probably be added pretty cheaply.