Synopsis
perch mail [OPTIONS] COMMAND
Description
The mail command group is a scriptable IMAP and SMTP client. list, search, and fetch talk IMAP; send talks SMTP; caps prints the SMTP EHLO extensions of a submission server.
Credentials and TLS flags are shared. IMAP flags are local to list/search/fetch; SMTP flags are local to send/caps.
Notes
- If –server or –smtp-server is omitted, the matching listener is taken from –config.
- Use –plaintext or –smtp-plaintext only for trusted loopback listeners.
- Password sources: –password-file, –password-stdin, PERCH_IMAP_PASSWORD, or an interactive prompt.
Options
| Option | Description |
|---|
--username, -u <value> | account username (env PERCH_IMAP_USER) |
--password <value> | account password (prefer PERCH_IMAP_PASSWORD or –password-file) |
--password-file <value> | read the account password from a file |
--password-stdin | read the account password from stdin |
--timeout <value> | connection timeout (default: 30s) |
--config <value> | configuration file (default: ~/.config/perch/perch.yaml) |
--help, -h | show help |
Commands
Examples
perch mail list --server imaps://mail.example.com --username you@example.com
perch mail search -q 'unseen from:alice' --json
perch mail fetch -q 'from:alice' --format mbox > alice.mbox
perch mail send --from you@example.com --to alice@example.com \
--subject Hello --body 'Hi Alice'
Environment
| Variable | Purpose |
|---|
PERCH_IMAP_USER | default account username |
PERCH_IMAP_PASSWORD | account password |
See also