Version: 10.0.3 (entityDefs unchanged on current master: messageId maxLength 255, messageIdInternal 300)
Steps to reproduce:
1. Personal or group account fetches a message whose Message-ID header is longer than 255 chars (RFC 5322 sets no limit).
2. Import fails: ERROR: (22001) Import message error. EmailAccount <id>. PDOException: SQLSTATE[22001]: ... 1406 Data too long for column 'message_id'
Observed:
Real-world senders that trigger it:
On our instance: 20 failed import events in 4 weeks across 5 accounts; 25 messages lost, confirmed via IMAP header scan.
Expected: import must not fail on a standards-compliant header.
Suggested fix: widen messageId/messageIdInternal, plus defensive truncation (or hashing of overlong IDs) in DefaultImporter: processMessageId, width alone is not sufficient.
Workaround: custom entityDefs override "messageId": {"maxLength": 512}, "messageIdInternal": {"maxLength": 640} + rebuild. Index stays under the 3072-byte InnoDB limit (utf8mb4, DYNAMIC).
Steps to reproduce:
1. Personal or group account fetches a message whose Message-ID header is longer than 255 chars (RFC 5322 sets no limit).
2. Import fails: ERROR: (22001) Import message error. EmailAccount <id>. PDOException: SQLSTATE[22001]: ... 1406 Data too long for column 'message_id'
Observed:
- No email record is created.
- UID is still marked processed → the message is never retried.
- No admin-visible signal beyond the log line. Silent permanent loss.
Real-world senders that trigger it:
- Microsoft 365 notification mails (…@odspnotify: Teams missed activity, guest invites, file shares) — 262–337 chars. Every M365 tenant emits these.
- Legacy Outlook <!&!AAA…base64…> IDs — 338 chars observed.
- Bulk mailers with tracking payloads in the ID — up to 424 chars observed.
On our instance: 20 failed import events in 4 weeks across 5 accounts; 25 messages lost, confirmed via IMAP header scan.
Expected: import must not fail on a standards-compliant header.
Suggested fix: widen messageId/messageIdInternal, plus defensive truncation (or hashing of overlong IDs) in DefaultImporter: processMessageId, width alone is not sufficient.
Workaround: custom entityDefs override "messageId": {"maxLength": 512}, "messageIdInternal": {"maxLength": 640} + rebuild. Index stays under the 3072-byte InnoDB limit (utf8mb4, DYNAMIC).

Comment