Skip to content
STIRUP

TECHNOLOGY INTELLIGENCE

Understand what's next.

Qmail: A Cross-Platform Mail Client with CLI Tool for AI and Scripts

Qmail is a fast, Gmail-style mail client for Windows, macOS, and Linux, featuring a command-line tool that allows reading, searching, and sending mail without API keys or costs.

Share
AI-generated conceptual illustration accompanying: Qmail: A Cross-Platform Mail Client with CLI Tool for AI and Scripts
AI-generated editorial illustration of the article topic; not a photograph, product screenshot or measured result.

Qmail's Features and Capabilities

Qmail is a fast, Gmail-style mail client for Windows, with new macOS and Linux builds, that includes a command-line tool (qmail) designed for use by AI agents and scripts. The tool allows users to read, search, and send mail across all their mailboxes without requiring API keys or incurring costs per call. Commands such as qmail list --unread --json and qmail search "from:stripe has:attachment newer_than:30d" --json demonstrate its ability to handle complex queries and return structured data. The tool supports actions like moving emails, applying rules, and downloading attachments, all while maintaining compatibility with the same local mail store used by the Qmail application. Its agent-friendly design includes JSON output, error handling with non-zero exit codes, and comprehensive documentation via qmail --help.

Installation and Setup on Different Platforms

Installation and setup of Qmail vary by platform. On Windows, it installs for your user only, without requiring administrator privileges, and adds Start menu and desktop shortcuts (Hacker News Show). For Linux (x64), users on Debian or Ubuntu can download the package Qmail-x.y.z-linux-amd64.deb and install it using sudo apt install ./Qmail-*.deb (Hacker News Show). Qmail automatically guesses server settings based on your email address, though users are advised to consult their mail provider's help pages for accurate values such as 'IMAP server' and 'SMTP server' (Hacker News Show).

Authentication and Security Considerations

Authentication and security are critical when configuring Qmail for use with external services like Google. According to Hacker News Show, Google requires every mail app to identify itself uniquely, and does not provide a shared identity for open-source applications. This means that developers must register their own client credentials for Qmail. To store these credentials securely, users can run the command qmail accounts google-client <client-id> <client-secret> in the terminal, as noted in Hacker News Show. These credentials are then saved in the system's credential store, such as Windows Credential Manager, macOS Keychain, or the Linux keyring. As highlighted in Hacker News Show, users should only share these values with trusted individuals, as anyone with access can impersonate the app under the user's name.

Managing Mailboxes and Rules

Managing mailboxes and rules in Qmail involves a series of CLI commands that allow users to organize their inbox efficiently. To begin, users can retrieve message IDs with `qmail list -a you@gmail.com --oldest -n 5000 --json` and process them in batches of 200 using commands like `qmail move - --to "Folder" --create`, `qmail archive -`, or `qmail trash -` (with IDs provided via standard input). For rule creation, users can use `qmail rules add --from "" --move ""` to automate sorting, and include `--read` to hide messages that do not require attention. Before applying rules, users should test them with `qmail rules run --rule --dry-run` and then execute them on existing mail with `qmail rules run`. To handle unwanted mail, users can extract unsubscribe links via `qmail read --json` and use `qmail trash -` to remove old messages from senders they no longer wish to receive emails from.

Data Storage and Privacy

Qmail stores user data locally in an SQLite database and raw message files, typically located in the .quickmail directory within the user's home folder, which can be customized via the QUICKMAIL_HOME environment variable. Passwords and sign-in tokens are stored in the operating system's credential manager (Windows Credential Manager, macOS Keychain, or Linux desktop keyring) under the quickMail entry. According to the developers, no data is uploaded to external servers. When a mailbox is removed, only the local copy is deleted, leaving the mailbox intact on the remote mail server. Users can add and manage mailboxes via the CLI, such as with the command qmail accounts add you@gmail.com --google, which connects to Gmail without requiring Google Cloud services. For users who prefer not to set up app passwords, they can enable 2-Step Verification on their Google account, generate an app password, and then add the mailbox as a standard IMAP mailbox using that password.

Sources and reporting notes

Based on published source material. No independent hands-on testing is claimed.

Read more