On 9/28/21 6:02 AM, Prasanth Nair wrote:
Hello,
Does anyone know how to edit an archived email in Mailman3? It is possible in Mailman2 ( https://wiki.list.org/DOC/How%20do%20I%20edit%20the%20archives%20of%20a%20Ma...). Is there any option similar to this in Mailman3?
In some sense the process is the same but possibly even simpler in Mailman 3. You need to modify the underlying data which requires appropriate access to the server.
In Mailman 3, the data are in the hyperkitty_email table in Mailman's database. You can get the Message-ID hash from the URL to the archived message, e.g. for the message to which I'm replying, the URL is https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/... and the hash is 7PVJL23DLSWMXXL44ALQUO6VSYBRZ4OA. Then if you have access, you can do database queries like
SELECT subject, content FROM hyperkitty_email WHERE message_id_hash =
'7PVJL23DLSWMXXL44ALQUO6VSYBRZ4OA';
and
UPDATE hyperkitty_email SET content = '<new content>' WHERE
message_id_hash = '7PVJL23DLSWMXXL44ALQUO6VSYBRZ4OA';
UPDATE hyperkitty_email SET subject = '<new subject>' WHERE
message_id_hash = '7PVJL23DLSWMXXL44ALQUO6VSYBRZ4OA';
If the message has attachments, they are in the hyperkitty_attachment
table and can be referenced by email_id
which is the corresponding
id
from the hyperkitty_email entry.
You can also do similar things via django-admin shell
. E.g.
$ django-admin shell
Python ...
(InteractiveConsole)
>>> from hyperkitty.models.email import Email
>>> x =
Email.objects.filter(message_id_hash='7PVJL23DLSWMXXL44ALQUO6VSYBRZ4OA')
>>> print(x[0].content)
but this requires some knowledge of HyperKitty's models and Django's ORM.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan