On 2024-07-10 12:05, Danil Smirnov via Mailman-users wrote:
After importing from Mailman 2, thousands of badly compiled messages from the past appeared with empty content on the same date (date of import).
Is there a safe way to delete them all? If we delete them from the database - hyperkitty_email table - do we need to do some clean-up of hyperkitty_thread table as well?
Per https://docs.mailman3.org/en/latest/migration.html, there's a tool with mailman2 that can clean messages *prior* to import:
all mailboxes should be checked for defects before importing. Certain defects such as missing Message-ID: headers or missing or unparseable Date: headers will be corrected or ignored by the import process. The one defect that will definitely cause problems is lines beginning with From in message bodies. These will be seen as the start of a new message. There is a Mailman 2 script at $prefix/bin/cleanarch.
I'd try deleting the corrupt list, running cleanarch
on the old list,
and re-importing.
If the new list has messages that are not in the old list (i.e. it's in live production), then I'm not sure of how to proceed.
Note the linked page also mentions a tool called check_hk_import script in hyperkitty/contrib folder.