On 7/10/24 12:27 PM, Danil Smirnov via Mailman-users wrote:
I'm aware of the tools you mentioned and they were properly used.
Your issue is almost certainly caused by unescaped From
lines in
message bodies and preprocessing the mbox with the
hyperkitty/contrib/cleanarch3 script should fix those.
Please let us focus on the question I asked - how do we delete messages of a particular date if there are too many of them so using Hyperkitty UI isn't an option?
You can do
DELETE FROM hyperkitty_email WHERE archived_date = <your datetime>;
but as you note there are entries in the hyperkitty_thread table that need to be removed too. So, before doing the above, maybe something like
DELETE FROM hyperkitty_thread WHERE id IN (SELECT thread_id FROM
hyperkitty_email WHERE archived_date = <your datetime>);
but there are also possibly entries relating to these messages/threads in the hyperkitty_favorite, hyperkitty_tagging, hyperkitty_lastview and hyperkitty_vote tables. It seems unlikely that there would be such entries in your case, but if you are concerned about them, here in order are what you can do in the database.
DELETE FROM hyperkitty_favorite WHERE thread_id IN (SELECT id FROM
hyperkitty_thread WHERE id IN (SELECT thread_id FROM hyperkitty_email
WHERE archived_date = <your datetime>));
DELETE FROM hyperkitty_tagging WHERE thread_id IN (SELECT id FROM
hyperkitty_thread WHERE id IN (SELECT thread_id FROM hyperkitty_email
WHERE archived_date = <your datetime>));
DELETE FROM hyperkitty_lastview WHERE thread_id IN (SELECT id FROM
hyperkitty_thread WHERE id IN (SELECT thread_id FROM hyperkitty_email
WHERE archived_date = <your datetime>));
DELETE FROM hyperkitty_vote WHERE email_id IN (SELECT id FROM
hyperkitty_email WHERE archived_date = <your datetime>);
DELETE FROM hyperkitty_thread WHERE id IN (SELECT thread_id FROM
hyperkitty_email WHERE archived_date = <your datetime>);
DELETE FROM hyperkitty_email WHERE archived_date = <your datetime>;
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan