# simplemailclient
A small terminal mail client written in Rust. It sends mail over SMTP, fetches
over IMAP, and gives you a split-pane TUI for reading, replying, and composing.
The installed binary is named `mail`.
## Features
- **TUI inbox** — folders (Inbox / Sent / Starred / Trash), a message list, and
a reading pane, navigable with `Tab` / arrow keys and `j` / `k`.
- **Compose & reply** in-app: To / Attach / Body fields, `Ctrl+S` to send,
`Esc` to cancel.
- **Text attachments** under 10 MB (validated as UTF-8 text).
- **Auto-sync** every 10 seconds while idle, plus on-demand sync with `S`.
- **Contacts** auto-collected from mail you send and receive, referenced by a
stable numeric ID.
## Install
```sh
cargo install simplemailclient
```
## Configuration
On first run a starter config is written to your config directory
(`~/.config/mail-rs/config.toml` on Linux/macOS,
`%APPDATA%\mail-rs\config.toml` on Windows). Fill in your SMTP/IMAP details:
```toml
identity = "you@gmail.com"
display_name = "Your Name"
domain = "gmail.com"
[smtp]
host = "smtp.gmail.com"
port = 587
username = "you@gmail.com"
password = "your-app-password" # use an App Password, not your login password
tls = true
[imap]
host = "imap.gmail.com"
port = 993
username = "you@gmail.com"
password = "your-app-password"
tls = true
inbox_folder = "INBOX"
```
## Usage
```sh
mail # launch the interactive TUI
mail read <index> # read a message by index
mail sync # fetch new mail via IMAP
```
### TUI keys
| `Tab` / `←→` | Move focus between panes |
| `↑↓` / `j` `k` | Navigate within a pane |
| `Enter` | Open selected message |
| `c` | Compose |
| `r` | Reply to the open message |
| `s` | Star / unstar |
| `d` | Move to trash |
| `S` | Sync now |
| `?` | Toggle contacts panel |
| `q` | Quit |
In the compose modal, `Tab` cycles To → Attach → Body, `Ctrl+S` sends, and `Esc`
cancels. In the Attach field, type a file path and press `Enter` to queue it.
## Data
Mail and contacts are stored in a local JSON file
(`~/.local/share/mail-rs/mailbox.json`, or `%LOCALAPPDATA%\mail-rs\mailbox.json`
on Windows).
## License
[MIT](LICENSE)