Handle non-tuple IMAP fetch responses
The prompts used to arrive at this change since the previous commit Ik krijg de volgende foutmelding: AttributeError: 'int' object has no attribute 'decode' while running verplaats_bestaand.py --account backup --uitvoeren. Any special observations that may be relevant for version management for this version. Be brief. The actual backup run modified local verplaats_log.json with processed INBOX UID entries; that run-state was intentionally not committed. Rerunning should preserve it so already logged moves are skipped.
This commit is contained in:
@@ -80,6 +80,7 @@ Scripts using shared IMAP folder handling:
|
||||
- `--audit` is available only in dry-run mode. It suppresses per-message dry-run lines and prints planned move counts grouped by source folder and destination folder for step 2 and step 3.
|
||||
- Long scans show progress counters: source folders are printed as `[current/total]`, and audit mode prints `Gescand: processed/total` every 250 messages and at folder completion.
|
||||
- IMAP `LIST`, `SELECT`, `UID SEARCH`, and `UID FETCH` aborts are logged and retried once after reconnecting. If reconnect also fails, the script records an `ABORT`/`ERROR` in `verplaats_log.json` instead of printing a Python traceback.
|
||||
- IMAP `FETCH` responses are parsed by selecting the first tuple bytes payload. This avoids crashes when `imaplib` returns extra response items before/after the actual header payload.
|
||||
- `MAP_RENAMES` is intentionally empty.
|
||||
- Source folders are selected by shared `list_folders()` plus `mail_routes.is_source_folder()`.
|
||||
- Step 2 routes all eligible source folders, not just `INBOX`.
|
||||
@@ -188,6 +189,7 @@ Latest live mailbox verification:
|
||||
|
||||
- Direct read-only IMAP count audit of both `hans` and `backup` accounts after the mirror.
|
||||
- The user ran the previous dry-run sorter version against `backup@australius.nl`. It reached `INBOX.Archief.2022.verzonden` after completing `INBOX.Archief.2022.inkomend`, then the IMAP server closed the connection with `Server shutting down.`. The current code has reconnect/retry handling for that failure mode.
|
||||
- The user started an actual sorter run on `backup@australius.nl`; it began moving messages from `INBOX` and then crashed on an unexpected IMAP `FETCH` response shape: `AttributeError: 'int' object has no attribute 'decode'`. The local `verplaats_log.json` contains processed `INBOX:<uid>` entries from that run and should be preserved if the user resumes sorting. The current code fixes this parser crash.
|
||||
- No live mailbox script was run by Codex while adding the latest reconnect changes.
|
||||
|
||||
## What To Do Next
|
||||
|
||||
Reference in New Issue
Block a user