Watch for envelopes changes

$ himalaya envelope watch

Watches the current folder and executes hooks when changes occur on envelopes.

If synchronization is enabled, the command will watch local cached folders. To force the command to watch remote folders, you can either:

  1. Force the remote backend for the watch envelopes feature, for example:

    # ~/.config/himalaya/config.toml
    
    envelope.watch.backend = "imap"
    
  2. Disable the cache with the --disable-cache flag:

    $ himalaya envelope watch --disable-cache
    

See the advanced version for more details.

Examples

Get notified on new emails

To receive system notifications when new emails arrive in the INBOX:

# ~/.config/himalaya/config.toml

# Available placeholders:
# id, subject, sender, sender.name, sender.address, recipient, recipient.name, recipient.address.

envelope.watch.received.notify.summary = "📬 New message from {sender}"
envelope.watch.received.notify.body = "{subject}"
$ himalaya envelope watch

Synchronize account on new emails

To run commands when new emails arrive in the INBOX:

# ~/.config/himalaya/config.toml

envelope.watch.received.cmd = "himalaya account sync"
$ himalaya envelope watch