On 2/7/21 10:03 AM, Brian Carpenter wrote:
I am trying to import some old archives (going back to 2003) into a Mailman 3 list. The import job is terminating very early in the process with the following error:
IndexError: string index out of range
- Is there a way to fix a mbox file that is generating this type of error?
Yes, but you need to understand what message is causing the error and why. The full traceback from the error can help. So can the script at <https://www.msapiro.net/scripts/check_hk_import>.
- If a message is causing this error, is there a way to import the rest of the mbox file by importing messages after a certain date within the mbox file? I know the --since flag should be able to do that but I am unsure what the date/time format should be.
There are things you can do. The --since date syntax is very flexible. It uses dateutil.parser.parse. See <https://dateutil.readthedocs.io/en/stable/parser.html#module-dateutil.parser>
You can also just make a new mbox which deletes the messages up to and including the offending one or just delete/fix the offending message. hyperkitty_import won't re-import message that are already in the archive, and without a --since option won't import messages older than the newest in the existing archive.
- The --no-sync--mailman flag indicates the possibility of doing batch imports. What are batch imports and how do you do them?
Batch imports means running hyperkitty_import multiple times wiuth multiple mbox inputs (batches). It is only necessary to run the sync_mailman job once after all the imports are done (even if importing to multiple lists). I.e. specify --no-sync--mailman on all but the last import, or on all and then run sync_mailman after done.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan