{"id":50335688,"url":"https://github.com/mwmdev/slashmail","last_synced_at":"2026-05-29T13:30:39.616Z","repository":{"id":338414208,"uuid":"1154648154","full_name":"mwmdev/slashmail","owner":"mwmdev","description":"CLI for reading, searching, managing, and bulk-operating on emails via IMAP.","archived":false,"fork":false,"pushed_at":"2026-05-04T15:19:50.000Z","size":203,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-04T17:23:17.209Z","etag":null,"topics":["bulk-operation","cli","command-line-tool","email","imap","rust","search"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwmdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-10T16:17:20.000Z","updated_at":"2026-05-04T15:20:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mwmdev/slashmail","commit_stats":null,"previous_names":["mwmdev/slashmail"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mwmdev/slashmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwmdev%2Fslashmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwmdev%2Fslashmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwmdev%2Fslashmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwmdev%2Fslashmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwmdev","download_url":"https://codeload.github.com/mwmdev/slashmail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwmdev%2Fslashmail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33655440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bulk-operation","cli","command-line-tool","email","imap","rust","search"],"created_at":"2026-05-29T13:30:38.808Z","updated_at":"2026-05-29T13:30:39.609Z","avatar_url":"https://github.com/mwmdev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slashmail\n\n[![CI](https://github.com/mwmdev/slashmail/actions/workflows/ci.yml/badge.svg)](https://github.com/mwmdev/slashmail/actions/workflows/ci.yml)\n[![Crates.io](https://img.shields.io/crates/v/slashmail)](https://crates.io/crates/slashmail)\n[![License](https://img.shields.io/crates/l/slashmail)](LICENSE-MIT)\n\nCLI for searching, managing, and bulk-operating on emails via IMAP.\n\n## Install\n\n### From crates.io\n\n```bash\ncargo install slashmail\n```\n\n### From GitHub Releases\n\nDownload a prebuilt binary from [Releases](https://github.com/mwmdev/slashmail/releases/latest), extract it, and place it on your `PATH`.\n\n### From source\n\nRequires [Rust](https://rustup.rs/) and a C compiler (for OpenSSL bindings).\n\n```bash\ngit clone https://github.com/mwmdev/slashmail.git\ncd slashmail\ncargo build --release\ncp target/release/slashmail ~/.local/bin/   # or anywhere on your PATH\n```\n\n#### Platform notes\n\n| OS | Prerequisites |\n|---|---|\n| **macOS** | Xcode Command Line Tools (`xcode-select --install`) |\n| **Debian/Ubuntu** | `apt install build-essential pkg-config libssl-dev` |\n| **Fedora/RHEL** | `dnf install gcc pkg-config openssl-devel` |\n| **Arch** | `pacman -S base-devel openssl` |\n| **NixOS** | `nix-shell` (uses included `shell.nix`) |\n| **Windows** | Install Rust via [rustup](https://rustup.rs/), uses vendored OpenSSL |\n\n## Usage\n\n```\nslashmail [OPTIONS] \u003cCOMMAND\u003e\n\nCommands:\n  search   Search messages by criteria\n  read     Display the content of matching messages\n  delete   Search + delete matching messages (move to Trash)\n  move     Search + move matching messages to a folder\n  export   Search + export matching messages as .eml files\n  mark     Search + set/unset flags on matching messages\n  count    Count matching messages (no FETCH)\n  quota    Show mailbox quota usage\n  status   Show per-folder message statistics\n```\n\n### Connection options\n\n```\n--host \u003cHOST\u003e      IMAP host [default: 127.0.0.1]\n--port \u003cPORT\u003e      IMAP port [default: 1143 plain, 993 TLS]\n--tls              Use TLS (required for remote IMAP servers)\n-u, --user \u003cUSER\u003e  IMAP username (or SLASHMAIL_USER env)\n```\n\nPassword is read from `SLASHMAIL_PASS` env var or prompted interactively.\n\nConnection options are global and can appear before or after the subcommand.\n\n### Config file\n\nSettings can be stored in a config file to avoid repeating connection options:\n\n| OS | Path |\n|---|---|\n| **Linux** | `~/.config/slashmail/config.toml` |\n| **macOS** | `~/Library/Application Support/slashmail/config.toml` |\n| **Windows** | `%APPDATA%\\slashmail\\config.toml` |\n\nExample `config.toml`:\n\n```toml\nhost = \"imap.gmail.com\"\nport = 993\ntls = true\nuser = \"user@gmail.com\"\ntrash_folder = \"[Gmail]/Trash\"\ndefault_folder = \"INBOX\"\n```\n\nAll fields are optional. CLI arguments and environment variables take precedence over config values.\n\nUse `--config \u003cPATH\u003e` to specify an alternative config file location.\n\n### Filter options\n\nAll commands that operate on messages share the same filter options:\n\n```\n-f, --folder \u003cFOLDER\u003e    Folder to search [default: INBOX]\n    --all-folders        Search across all folders (excludes Trash, Spam)\n    --subject \u003cTEXT\u003e     Subject contains\n    --from \u003cTEXT\u003e        From address contains\n    --to \u003cTEXT\u003e          To address contains\n    --cc \u003cTEXT\u003e          CC address contains\n    --body \u003cTEXT\u003e        Message body contains\n    --text \u003cTEXT\u003e        Headers or body contains\n    --seen               Only read messages\n    --unseen             Only unread messages\n    --since \u003cDATE\u003e       Messages since date (YYYY-MM-DD or 7d, 2w, 3m, 1y)\n    --before \u003cDATE\u003e      Messages before date (YYYY-MM-DD or 7d, 2w, 3m, 1y)\n    --larger \u003cSIZE\u003e      Messages larger than N bytes (supports K/M suffix)\n    --smaller \u003cSIZE\u003e     Messages smaller than N bytes (supports K/M suffix)\n    --flagged            Only flagged/starred messages\n    --unflagged          Only unflagged messages\n    --answered           Only replied-to messages\n    --draft              Only draft messages\n-n, --limit \u003cN\u003e          Limit number of results\n```\n\nAll filter criteria are AND'd together. Omitting all criteria matches all messages.\n\n### Action options\n\nCommands that modify messages (`delete`, `move`, `mark`) support:\n\n```\n--yes       Skip confirmation prompt\n--dry-run   Show what would happen without acting\n```\n\n`delete` also supports `--trash-folder \u003cNAME\u003e` (default: `Trash`) for servers that use a different name (e.g. `Deleted Items`, `[Gmail]/Trash`).\n\n`export` supports `--yes`, `--force` (overwrite existing files), and `-o, --output-dir`.\n\n`mark` takes one or more flags: `--read`, `--unread`, `--flagged`, `--unflagged`.\n\n## Examples\n\n```bash\n# Search INBOX (all messages, newest first)\nslashmail search -u user@example.com\n\n# Search with filters\nslashmail search -u user@example.com --from \"newsletter\" --since 2025-01-01\nslashmail search -u user@example.com --subject \"invoice\" --larger 1M\n\n# Relative dates: last 7 days, 2 weeks, 3 months, 1 year\nslashmail search -u user@example.com --since 7d\nslashmail search -u user@example.com --since 3m --before 1m\n\n# Show only the 10 most recent matches\nslashmail search -u user@example.com --from \"alerts\" -n 10\n\n# Filter by recipient or CC\nslashmail search -u user@example.com --to \"team@company.com\"\nslashmail search -u user@example.com --cc \"me@example.com\"\n\n# Show only unread messages\nslashmail search -u user@example.com --unseen --since 7d\n\n# Search message body content\nslashmail search -u user@example.com --body \"invoice attached\"\n\n# Search everywhere (headers + body)\nslashmail search -u user@example.com --text \"quarterly report\"\n\n# JSON output for scripting (search and count only)\nslashmail search -u user@example.com --from \"alerts\" --json | jq '.[].subject'\nslashmail count -u user@example.com --json\n\n# Search across all folders\nslashmail search -u user@example.com --all-folders --from \"noreply\"\n\n# Delete with interactive confirmation\nslashmail delete -u user@example.com --from \"spam@example.com\"\n\n# Batch delete (no prompt)\nslashmail delete -u user@example.com --subject \"unsubscribe\" --yes\n\n# Preview what would be deleted\nslashmail delete -u user@example.com --from \"old-list\" --dry-run\n\n# Move messages to a folder\nslashmail move -u user@example.com --from \"receipts\" --to Archive\n\n# Export messages as .eml files\nslashmail export -u user@example.com --subject \"contract\" -o ./backup\n\n# Mark messages as read\nslashmail mark -u user@example.com --from \"notifications\" --read\n\n# Flag important messages\nslashmail mark -u user@example.com --subject \"urgent\" --flagged\n\n# Count matching messages (fast, no FETCH)\nslashmail count -u user@example.com --from \"newsletter\"\n\n# Show folder statistics\nslashmail status -u user@example.com\n\n# Show mailbox quota\nslashmail quota -u user@example.com\n\n# Use with a remote IMAP server (Gmail, Fastmail, etc.)\nslashmail search --tls --host imap.gmail.com -u user@gmail.com\n\n# Use env vars to avoid typing credentials\nexport SLASHMAIL_USER=user@example.com\nexport SLASHMAIL_PASS=app-password\nslashmail status\n```\n\n### Shell completions\n\n```bash\n# Bash\nslashmail completions bash \u003e ~/.local/share/bash-completion/completions/slashmail\n\n# Zsh\nslashmail completions zsh \u003e ~/.zfunc/_slashmail\n\n# Fish\nslashmail completions fish \u003e ~/.config/fish/completions/slashmail.fish\n```\n\n## AI Agent Skill\n\nslashmail includes a skill file (`skills/slashmail/SKILL.md`) that teaches AI agents how to manage your email through natural language.\n\n**Claude Code** — copy the skill into your skills directory:\n\n```bash\nmkdir -p ~/.claude/skills/slashmail\ncp skills/slashmail/SKILL.md ~/.claude/skills/slashmail/\n```\n\n**Other agents** — paste the contents of `skills/slashmail/SKILL.md` into your agent's system prompt or tool definitions.\n\nOnce installed, prompts like these just work:\n\n```\n\u003e Check my latest emails\n\u003e Read the last email from Sarah\n\u003e Find emails about the quarterly report\n\u003e How many unread messages do I have?\n\u003e Show me large emails over 5MB from the last month\n\u003e Delete all newsletters from noreply@example.com older than 3 months\n\u003e Move flagged emails from last week to the Archive folder\n\u003e Export all invoices from 2025 to a backup folder\n\u003e Search my sent folder for emails to the finance team\n```\n\nDestructive operations always dry-run first and ask for confirmation.\n\n## Tested with\n\n- Gmail (via `--tls --host imap.gmail.com`)\n- Fastmail (via `--tls --host imap.fastmail.com`)\n- Dovecot\n- Any standard IMAP4rev1 server\n\n## How it works\n\n- All filtering runs server-side via IMAP SEARCH\n- Uses IMAP SORT extension (RFC 5256) when available; falls back to client-side sort\n- With SORT, `--limit` truncates results before fetching (fewer bytes over the wire)\n- `search`, `delete`, `move`, `mark`, `count` only fetch headers and size -- never full messages\n- `export` fetches full message bodies via `BODY.PEEK[]`\n- Uses `BODY.PEEK` to avoid marking messages as read\n- UID sets are compressed into ranges and chunked to stay within IMAP command length limits\n- Passwords are securely zeroed from memory after login\n\n## Exit codes\n\n- `0` — Success\n- `1` — Error (connection failure, invalid credentials, bad arguments, etc.)\n\nAll errors print to stderr. Combine `--yes` with cron or scripts for unattended operation.\n\n## Troubleshooting\n\n### Connection refused\n\n- Verify host and port: ProtonMail Bridge uses `127.0.0.1:1143`, Gmail uses `imap.gmail.com:993 --tls`\n- Check that the IMAP server is running and the port is not blocked by a firewall\n\n### Login failed\n\n- Gmail and Outlook require [App Passwords](https://support.google.com/accounts/answer/185833), not your account password\n- ProtonMail Bridge: use the bridge-generated password, not your ProtonMail account password\n- Fastmail: use an app-specific password from Settings → Privacy \u0026 Security\n\n### Folder not found\n\n- Run `slashmail status` to list all available folders and their names\n- Folder names are case-sensitive on most IMAP servers\n- Gmail uses `[Gmail]/Trash`, `[Gmail]/All Mail`, etc. — use `--trash-folder` with `delete` if needed\n- Exchange/Outlook uses `Deleted Items` instead of `Trash`\n\n### TLS errors\n\n- Use `--tls` for all remote (non-localhost) IMAP servers\n- If you get certificate errors, ensure your system CA certificates are up to date\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwmdev%2Fslashmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwmdev%2Fslashmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwmdev%2Fslashmail/lists"}