Documentation
Email and Calendar
Multi-account IMAP mail and the CalDAV calendar it hosts.
On this page
Overview
TDE Email is a multi-account IMAP client that keeps everything in a local
database, so reading and drafting work whether or not you have a connection.
The Calendar is not a separate app — it is a pane inside TDE Email, opened with
c.
Adding an account
The account screen offers exactly two paths.
Continue with Google runs a browser OAuth flow. TDE opens the consent URL
in TDE Browser's Mobile mode, so you scan a
QR code and approve on your phone. The server settings are filled in for you
(imap.gmail.com:993 and smtp.gmail.com:465, both TLS), and IMAP
authenticates with XOAUTH2. TDE never asks for your Google password — the
hosted broker owns the client secret and the refresh token lands in this
device's encrypted vault.
Other IMAP is the manual form: display name, email address, username, IMAP host and port, SMTP host and port, password, and a TLS / STARTTLS toggle. For most providers the password field wants an app password, not your account password.
Where credentials live
Passwords and refresh tokens go into the encrypted secret
vault, never into a config file. Account
metadata — addresses, hosts, ports, display names — is stored separately in
~/.tde/email/accounts.json, which by design contains no secrets. IMAP and
SMTP passwords are held under separate keys, so a relay with different
credentials is representable.
Each account row on the account screen carries Edit, Test connection, Reconnect, Sync, Bot and Remove.
Sync and the local store
Each account gets its own SQLite database at ~/.tde/email/<account-id>.db,
with attachments kept as files under ~/.tde/email/attachments/. The UI reads
from that store and nothing else, which is why the inbox opens instantly and
stays readable offline.
Sync is incremental by IMAP UID — it asks only for messages newer than the
last one it has. If the server changes UIDVALIDITY, TDE clears that folder's
cache and reimports it rather than attaching new server UIDs to unrelated
cached rows. HTML bodies are sanitized and converted to Markdown on the way in,
with the original sanitized HTML kept alongside. Messages are threaded from
their Message-ID, In-Reply-To and References headers.
Sync is an explicit action — press s, or use the Sync chip on the account
screen. It is not a background poller.
Reading
| Key | Action |
|---|---|
↑ / ↓, Tab | Move within the focused pane |
← / → | Previous / next focus target |
Enter, Space | Activate the focused item |
n | Compose |
r | Reply |
f | Forward |
s | Sync the selected account |
c | Open the Calendar |
a | Manage accounts |
Esc | From the body or attachments back to the message list |
With the body focused, ↑ and ↓ scroll the message instead of changing the
selection. Attachments on a received message are listed and can be opened in
their associated app.
Composing
The composer is a fixed field order — To → Cc → Bcc → Subject → Body →
Preview → Save → Send — walked with ↑ and ↓ (or Tab to go forward).
Enter or Space on the last three toggles the rendered preview, saves a
local draft, or sends.
The body is Markdown. On send, TDE builds a proper multipart/alternative
message: your raw Markdown as text/plain and the rendered version as
text/html, so it reads correctly in any client. Replies and forwards carry
the right In-Reply-To and References headers so threads hold together, and
Bcc recipients stay in the SMTP envelope rather than the visible headers.
Esc closes the preview if it is open; otherwise it returns to the mailbox and
auto-saves the draft when there is anything in it.
Calendar
Press c from the mailbox. The Calendar is backed by CalDAV over HTTPS
with iCalendar payloads, cached in a local SQLite database alongside your mail.
Add a calendar with a: server URL (must be https://), username, a display
name, and a password — again typically an app password. Then ← and → switch
between calendars, ↑ and ↓ move through events, s syncs, and Delete
removes the selected event.
| Key | Action |
|---|---|
Esc, m | Back to mail |
← / → | Previous / next calendar |
↑ / ↓ | Move through events |
a | Add a CalDAV account |
n | New event |
s | Sync the selected calendar |
Delete, Backspace | Delete the selected event |
From an agent
An agent can work your mail through four structured commands. They read the local store and write local drafts; they never touch SMTP.
ID=$(tde agent windows | awk -F '\t' '$2=="TDE Email"{print $1}')
tde agent email $ID accounts
tde agent email $ID list
tde agent email $ID read <message-id>
tde agent email $ID draft you@example.com | Status update | The build is green.accounts and list return tab-separated rows; read returns the headers and
the message body as Markdown; draft saves a draft and returns its id.
The full agent surface is documented in the agent API.