🐛 Bug Description
msgvault fails to sync certain IMAP emails with failed to fetch message (nil response) errors. The root cause appears to be an IMAP protocol parsing issue when the server returns a "faulty continuation request".
Environment
- msgvault version: v0.15.0
- commit: e7e8593
- built: 2026-05-29T00:16:55Z
- go: go1.26.3
- os/arch: linux/amd64
- IMAP server: Tencent Exmail (exmail.qq.com)
Error Logs
time=2026-06-01T17:03:19.990+08:00 level=WARN msg="failed to fetch message (nil response)" run_id=9379eaae2e44 id=INBOX|914
IMAP codec warnings:
WARN imap_codec::response: Rectified faulty continuation request `+ ` to `+ ... `
WARN imap_codec::response: Rectified missing `text` to "..."
Impact
- Total emails affected: 261 emails
- Sync success rate: 87.5% (1,835/2,096 emails synced)
- Data integrity: 99.3% (by folder count)
Investigation Results
- ✅ Emails DO exist on the IMAP server (verified with himalaya CLI)
- ❌ msgvault's IMAP parser cannot handle the server's response format
- ❌ Retrying with exponential backoff (5 attempts) produces the same errors
- ❌ The 261 affected emails have identical error patterns across all retry attempts
Reproduction Steps
- Configure msgvault with an IMAP account (Tencent Exmail/exmail.qq.com)
- Run
msgvault sync
- Observe
failed to fetch message (nil response) errors for specific email IDs
Affected Email IDs (sample)
INBOX|914, INBOX|916, INBOX|918, INBOX|920, INBOX|921, INBOX|922, INBOX|925, INBOX|927, INBOX|934, INBOX|1029... (261 total, see attached list)
Expected Behavior
msgvault should either:
- Successfully sync these emails despite the server's non-standard IMAP response
- Provide a clearer error message indicating the IMAP protocol parsing issue
- Allow manual retry of specific failed email IDs
Possible Cause
The imap_codec library (used by msgvault) is detecting and "rectifying" faulty continuation requests from the server, but the higher-level msgvault sync logic is not handling this gracefully, resulting in nil response errors.
Workaround
Users can access these emails via alternative IMAP clients (e.g., himalaya, Thunderbird) that handle the server's response format correctly.
Attachments
- Full error log: Available upon request
- List of affected email IDs: 261 emails in INBOX folder
Priority: Medium-High (affects ~12.5% of emails in affected accounts)
Label: bug, imap, sync-failure
🐛 Bug Description
msgvault fails to sync certain IMAP emails with
failed to fetch message (nil response)errors. The root cause appears to be an IMAP protocol parsing issue when the server returns a "faulty continuation request".Environment
Error Logs
IMAP codec warnings:
Impact
Investigation Results
Reproduction Steps
msgvault syncfailed to fetch message (nil response)errors for specific email IDsAffected Email IDs (sample)
INBOX|914, INBOX|916, INBOX|918, INBOX|920, INBOX|921, INBOX|922, INBOX|925, INBOX|927, INBOX|934, INBOX|1029... (261 total, see attached list)
Expected Behavior
msgvault should either:
Possible Cause
The
imap_codeclibrary (used by msgvault) is detecting and "rectifying" faulty continuation requests from the server, but the higher-level msgvault sync logic is not handling this gracefully, resulting innil responseerrors.Workaround
Users can access these emails via alternative IMAP clients (e.g., himalaya, Thunderbird) that handle the server's response format correctly.
Attachments
Priority: Medium-High (affects ~12.5% of emails in affected accounts)
Label: bug, imap, sync-failure