Strip images, simplify links to just text, remove very long bare URLs,
and collapse excessive blank lines for a cleaner preview pane.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HTML emails are now converted to markdown then rendered with rich formatting
(bold, italic, headings, links) in the preview pane via tui-markdown.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensure disable_raw_mode and LeaveAlternateScreen run even when the
app returns an error. Also add a panic hook to restore the terminal
on unexpected panics.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses Arc<AtomicU32> to track the most recently wanted email sequence
number. The worker skips fetch requests that no longer match, avoiding
wasted network calls when scrolling through emails rapidly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The eager connect() call in the worker thread could hang if the server
was unreachable, preventing the worker from ever processing commands.
Let refresh() handle the initial connection instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Press 'd' to delete the selected email. Removes it from the list
immediately and performs the server-side delete in the background
for a snappy user experience.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a second-pass QP decode to catch =XX sequences that survive
the initial mailparse decoding.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fall back to html2text when no text/plain part is available,
converting HTML emails to readable terminal output.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fetch full raw email and parse MIME structure to find the
text/plain part, removing MIME headers and boundaries from
the preview pane.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After refresh, find the previously selected email by its IMAP
sequence number and keep the highlight on it. Falls back to the
first email if the selected one was deleted.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tab toggles focus between inbox list and preview. Focused pane
gets a cyan border. When preview is focused, up/down scrolls the
email body instead of navigating the list.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Spawn a worker thread that owns the IMAP session and processes
fetch commands via channels. The UI thread polls for results
non-blockingly, keeping the app responsive during network operations.
Shows loading indicator while fetching.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduce Inbox struct to track the oldest fetched sequence number.
When scrolling past the last email, automatically fetch the next
batch of 50 older messages and append them to the list.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Support both plain and TLS IMAP connections via an ImapSession enum,
enabling use with Gmail and other TLS-only servers. Limit fetch range
to the most recent 50 messages to avoid hanging on large mailboxes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace simple IMAP login with full inbox fetch that displays
Subject, From, and Date for each message. Auto-refreshes every
30 seconds and supports manual refresh with 'r' key.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>