Commit graph

15 commits

Author SHA1 Message Date
Shautvast
a709a3a946 implemented safe cache 2026-02-25 16:48:40 +01:00
Shautvast
facb44d561 Store credentials in OS keychain via keyring crate
Passwords are no longer stored in config.toml. Instead:
- New setup wizard (--configure) prompts for credentials on first run
  and stores them in the OS keychain (macOS Keychain, GNOME Keyring /
  KWallet on Linux, Windows Credential Manager)
- Env-var fallback: TUIMAIL_<KEY> for headless environments
- ProtonMail session token moves from session.json to the keychain
- Config file path moves to {config_dir}/tuimail/config.toml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 10:50:23 +01:00
Shautvast
2287b08cb5 Integrate proton-bridge in-process and silence verbose logging
- Add proton-bridge as optional dep behind `proton` feature flag
- New proton-bridge/src/lib.rs: pub fn start() spins a background Tokio
  thread, pre-binds ports, and signals readiness via mpsc before returning
- src/main.rs: conditionally starts bridge before TUI enters raw mode;
  derives effective IMAP/SMTP config via Provider enum
- src/config.rs: add Provider enum, optional imap/smtp, ProtonConfig/
  BridgeConfig mirrors, effective_imap/smtp() helpers
- Remove all per-operation eprintln!/println! from imap_server, smtp_server,
  and api.rs that fired during TUI operation and corrupted the display
- config.toml.example: unified format covering both imap and proton providers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 22:51:30 +01:00
Shautvast
05b6aac692 Add proton-bridge crate: workspace setup and SRP authentication (Step 2)
- Convert tuimail repo to Cargo workspace with tuimail and proton-bridge members
- Add proton-bridge binary crate with config, SRP 6a, and auth modules
- Implement ProtonMail SRP 6a exactly matching go-srp:
  - Little-endian bigints throughout
  - expandHash = SHA512(data||0..3) producing 256 bytes
  - k, u, M1, M2 all via expandHash with 256-byte normalised inputs
  - Password hashing v3/v4: bcrypt($2y$, salt+proton) + expandHash(output||N)
- Authenticate against Proton API (auth/info → auth/v4), verify server proof
- Persist session (UID, access/refresh tokens) to session.json
- Add bridge.toml and session.json to .gitignore (contain credentials/tokens)
- Add PROTON.md with full build plan for the mini-bridge

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 21:31:10 +01:00
Shautvast
fba2623f15 Add SMTP send with TLS mode support and timeouts
- Add smtp.rs with send_email using lettre; supports none/starttls/smtps
- Replace use_tls: bool with TlsMode enum in SmtpConfig for explicit port 465 (SMTPS) support
- Add SMTP_IO_TIMEOUT (15s) for socket I/O and SMTP_WALL_TIMEOUT (30s) covering DNS + connect
- Spawn SMTP send on a dedicated thread so the IMAP worker thread is never blocked
- Update config.toml.example with tls_mode documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 20:07:17 +01:00
Shautvast
23f179df24 Replace html2text with fast_html2md + tui-markdown for styled email preview
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>
2026-02-18 13:39:14 +01:00
Shautvast
e871c1aab8 Clean up leftover quoted-printable artifacts in email body
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>
2026-02-17 21:47:47 +01:00
Shautvast
d0df411c57 Render HTML emails as plain text using html2text
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>
2026-02-17 21:45:44 +01:00
Shautvast
3a2ce88ebf Extract plain text from emails using mailparse
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>
2026-02-17 21:38:46 +01:00
Shautvast
328a5fa5d2 Rename project to skim
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 21:33:37 +01:00
Shautvast
904f89f1b4 timezone correction 2026-02-17 20:52:15 +01:00
Shautvast
ddb2c314d0 geen timezone 2026-02-17 20:45:21 +01:00
Shautvast
cc7eeba7f8 Add TLS support and limit inbox fetch to last 50 messages
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>
2026-02-17 20:25:37 +01:00
Shautvast
9bbfad554e Fetch and display inbox emails with periodic polling
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>
2026-02-17 17:31:37 +01:00
Shautvast
78f5c4655c basic gui and login to imap 2026-02-17 17:24:35 +01:00