- Add imap_uid column + unique index for proper deduplication
- Use deterministic message_id for emails without Message-ID header
- Dedup by (account_id, folder_id, imap_uid) first, message_id fallback
- Track folder moves: update folder_id when email appears in different folder
- Fix Sent folder lookup: check Sent/INBOX.Sent/Sent Items/Sent Mail + ILIKE
- Detect IMAP delimiter from LIST response instead of hardcoding dot
- Use detected delimiter in stale folder name migration
- Migration 0004_imap_uid.sql with imap_uid column and unique index
- Frontend: decodeMimeHeader() on attachment filenames in MailDetail for display
- Backend: _decode_mime_filename() helper with Q-encoding fallback for edge cases
- Attachments now visible in mail detail UI (was 0 records, now 44+)
- Notifications table updated_at column added via migration 0020
- Add _decode_mime_filename() helper with Q-encoding fallback decoder
- Use helper for both new and existing email attachment saving
- Handles edge cases where email.header.decode_header fails on partially processed filenames
- Decode =?utf-8?q?...?= filenames before sanitizing for both new and existing emails
- Prevents filenames like __utf-8_q_Wire_236095209372_2Epdf_2Ehtml__
- Uses email.header.decode_header + make_header for proper decoding
- IMAP sync now saves attachments for existing emails that have has_attachments=true
but no attachment records in the database (retroactive attachment saving)
- Replace silent exception catching with logger.warning for attachment save failures
- Add logging module import and logger instance
- This fixes the issue where 62 emails had has_attachments=true but 0 attachment records
- Add username field to account creation form (defaults to email if empty)
- Add is_shared checkbox toggle for shared mailboxes
- Update CreateAccountPayload type with optional username and is_shared
- The infinite re-render fix (previous commit) resolves the main issue:
accounts were not shown in settings because loadAccounts was looping,
flooding the browser with requests and preventing API calls from completing
- Fix infinite re-render: loadAccounts had selectedAccountId in deps causing
repeated fetches every render; use functional setState and empty deps
- Fix all error handlers in MailSettings: err?.message || err?.detail instead of String(err)
- Fix sync result handling: backend returns {synced, error?} not {success, synced_count}
- This infinite re-render was flooding the browser with requests, causing
Network Error for SignatureManager API calls
- Fix error handling in SignatureManager load/save/delete to extract message from ApiError
- Same pattern as sync fix: err?.message || err?.detail instead of String(err)
- Replace textarea in SignatureManager with TipTap RichTextEditor
- Add placeholder variable buttons: {{user.name}}, {{user.first_name}},
{{user.last_name}}, {{user.email}}, {{user.role}}, {{tenant.name}}, {{date}}
- Add replaceSignatureVariables() utility in mail API
- ComposeModal now replaces variables with actual user/tenant data when inserting signature
- Variables resolved from auth store (user name, email, role, tenant name)
- Add RichTextEditor component with TipTap (ProseMirror-based) editor
- Full toolbar: bold, italic, underline, strikethrough, H1/H2/H3, bullet/numbered lists,
blockquote, inline code, code block, text alignment (left/center/right/justify),
text color picker, link insert/edit, image insert, clear formatting, undo/redo
- Replace old contentEditable div + document.execCommand in ComposeModal
- Add Placeholder extension for empty editor hint
- Add ProseMirror CSS styles (lists, blockquote, code, headings, links, images)
- Update signature/template insertion to work with new editor state
- Fix sync error: backend returns {synced, error?} not {success, synced_count}; frontend now checks error field
- Decode MIME encoded-words (=?UTF-8?Q?...?=) in backend during IMAP sync for subject/from/to/cc headers
- Add frontend decodeMimeHeader() utility for already-stored encoded subjects (MailList + MailDetail)
- Make pagination sticky at bottom of mail list (flex-col h-full, ul scrolls, pagination flex-shrink-0)
- Make pagination compact: smaller padding (px-1.5 py-0.5), text-xs, smaller icons, tighter spacing
- Remove duplicate action bar from MailDetail (actions are in global plugin toolbar)
- Change iframe sandbox from "" to "allow-same-origin" so height auto-resize works
- Move attachments inside the scrollable body container so they are visible
- Remove unused imports (clsx, Badge) and unused destructured props
- Remove duplicate updated_at from NotificationPreference model (inherited from TimestampMixin)
- Add migration 0018 to add created_at and deleted_at columns
- Fixes 500 error on GET /notifications/types and /preferences