mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 21:29:24 +08:00
add idle mode
This commit is contained in:
@@ -18,6 +18,7 @@ Minimalist CLI email client, written in Rust.
|
||||
* [Write a new message](#write-a-new-message)
|
||||
* [Reply to a message](#reply-to-a-message)
|
||||
* [Forward a message](#forward-a-message)
|
||||
* [Listen to new messages](#listen-to-new-messages)
|
||||
* [License](https://github.com/soywod/himalaya/blob/master/LICENSE)
|
||||
* [Changelog](https://github.com/soywod/himalaya/blob/master/CHANGELOG.md)
|
||||
* [Credits](#credits)
|
||||
@@ -39,8 +40,8 @@ more flexibility.
|
||||
curl -sSL https://raw.githubusercontent.com/soywod/himalaya/master/install.sh | bash
|
||||
```
|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Installation) for
|
||||
more information.*
|
||||
*See the [wiki section](https://github.com/soywod/himalaya/wiki/Installation)
|
||||
for other installation methods.*
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -50,8 +51,6 @@ more information.*
|
||||
name = "Your full name"
|
||||
downloads-dir = "/abs/path/to/downloads"
|
||||
|
||||
# Himalaya supports the multi-account
|
||||
# Each account should be inside a TOML section
|
||||
[gmail]
|
||||
default = true
|
||||
email = "my.email@gmail.com"
|
||||
@@ -59,34 +58,16 @@ email = "my.email@gmail.com"
|
||||
imap-host = "imap.gmail.com"
|
||||
imap-port = 993
|
||||
imap-login = "test@gmail.com"
|
||||
imap-passwd_cmd = "pass show gmail"
|
||||
imap-passwd-cmd = "pass show gmail"
|
||||
|
||||
smtp-host = "smtp.gmail.com"
|
||||
smtp-port = 487
|
||||
smtp-login = "test@gmail.com"
|
||||
smtp-passwd_cmd = "pass show gmail"
|
||||
|
||||
[posteo]
|
||||
name = "Your overriden full name"
|
||||
downloads-dir = "/abs/path/to/overriden/downloads"
|
||||
email = "test@posteo.net"
|
||||
|
||||
imap-host = "posteo.de"
|
||||
imap-port = 993
|
||||
imap-login = "test@posteo.net"
|
||||
imap-passwd_cmd = "security find-internet-password -gs posteo -w"
|
||||
|
||||
smtp-host = "posteo.de"
|
||||
smtp-port = 487
|
||||
smtp-login = "test@posteo.net"
|
||||
smtp-passwd_cmd = "security find-internet-password -gs posteo -w"
|
||||
|
||||
# [other accounts]
|
||||
# ...
|
||||
smtp-passwd-cmd = "security find-internet-password -gs posteo -w"
|
||||
```
|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Configuration) for
|
||||
more information.*
|
||||
*See the [wiki section](https://github.com/soywod/himalaya/wiki/Configuration)
|
||||
for all the options.*
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -104,12 +85,13 @@ FLAGS:
|
||||
|
||||
OPTIONS:
|
||||
-a, --account <STRING> Name of the account to use
|
||||
-o, --output <STRING> Format of the output to print [default: text] [possible values: text, json]
|
||||
-o, --output <STRING> Format of the output to print [possible values: text, json]
|
||||
|
||||
SUBCOMMANDS:
|
||||
attachments Downloads all attachments from an email
|
||||
forward Forwards an email
|
||||
help Prints this message or the help of the given subcommand(s)
|
||||
idle Starts the idle mode
|
||||
list Lists emails sorted by arrival date
|
||||
mailboxes Lists all available mailboxes
|
||||
read Reads text bodies of an email
|
||||
@@ -121,89 +103,98 @@ SUBCOMMANDS:
|
||||
write Writes a new email
|
||||
```
|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage) for more
|
||||
information.*
|
||||
*See the [wiki section](https://github.com/soywod/himalaya/wiki/Usage) for more
|
||||
information about commands.*
|
||||
|
||||
### List mailboxes
|
||||
|
||||
Shows mailboxes in a basic table.
|
||||
|
||||

|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage:list-mailboxes)
|
||||
for more information.*
|
||||
Shows mailboxes in a basic table.
|
||||
|
||||
### List messages
|
||||
|
||||
Shows messages in a basic table.
|
||||
|
||||

|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage:list-messages) for
|
||||
more information.*
|
||||
Shows messages in a basic table.
|
||||
|
||||
### Search messages
|
||||
|
||||

|
||||
|
||||
Shows filtered messages in a basic table. The query should follow the
|
||||
[RFC-3501](https://tools.ietf.org/html/rfc3501#section-6.4.4).
|
||||
|
||||

|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage:search-messages) for
|
||||
more information.*
|
||||
|
||||
### Download attachments
|
||||
|
||||
Downloads all attachments directly to the [`downloads-dir`](#configuration).
|
||||
|
||||

|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage:download-attachments)
|
||||
for more information.*
|
||||
Downloads all attachments from a message directly to the
|
||||
[`downloads-dir`](https://github.com/soywod/himalaya/wiki/Configuration).
|
||||
|
||||
### Read a message
|
||||
|
||||
Shows the text content of a message (`text/plain` if exists, otherwise
|
||||
`text/html`). Can be overriden by the `--mime-type` option.
|
||||
|
||||

|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage:read-a-message) for
|
||||
more information.*
|
||||
Shows the text content of a message (`text/plain` if exists, otherwise
|
||||
`text/html`).
|
||||
|
||||
### Write a new message
|
||||
|
||||
Opens your default editor (from the `$EDITOR` environment variable) to compose
|
||||
a new message.
|
||||
|
||||
```bash
|
||||
himalaya write
|
||||
```
|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage:write-a-new-message) for
|
||||
more information.*
|
||||
Opens your default editor (from the `$EDITOR` environment variable) to compose
|
||||
a new message.
|
||||
|
||||
### Reply to a message
|
||||
|
||||
Opens your default editor to reply to a message.
|
||||
|
||||
```bash
|
||||
himalaya reply --all 5123
|
||||
```
|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage:reply-to-a-message) for
|
||||
more information.*
|
||||
Opens your default editor to reply to a message.
|
||||
|
||||
### Forward a message
|
||||
|
||||
Opens your default editor to forward a message.
|
||||
|
||||
```bash
|
||||
himalaya forward 5123
|
||||
```
|
||||
|
||||
*See [wiki section](https://github.com/soywod/himalaya/wiki/Usage:forward-a-message) for
|
||||
more information.*
|
||||
Opens your default editor to forward a message.
|
||||
|
||||
### Listen to new messages
|
||||
|
||||
```bash
|
||||
himalaya idle
|
||||
```
|
||||
|
||||
Starts a session in idle mode (blocking). When a new message arrives, it runs
|
||||
the command `notification-cmd` defined in the [config
|
||||
file](https://github.com/soywod/himalaya/wiki/Configuration).
|
||||
|
||||
Here a use case with [`systemd`](https://en.wikipedia.org/wiki/Systemd):
|
||||
|
||||
```ini
|
||||
# ~/.config/systemd/user/himalaya.service
|
||||
|
||||
[Unit]
|
||||
Description=Himalaya new messages notifier
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/himalaya idle
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
```bash
|
||||
systemctl --user enable himalaya.service
|
||||
systemctl --user start himalaya.service
|
||||
```
|
||||
|
||||
## Credits
|
||||
|
||||
|
||||
Reference in New Issue
Block a user