github pimalaya/himalaya v1.0.0-beta

latest releases: v1.0.0-beta.4, latest, v1.0.0-beta.3...
10 months ago

The new API of the configuration file contains breaking changes, see config.sample.toml for a documented example of this new API.

You can even test it:

# save the sample config locally
curl https://raw.githubusercontent.com/soywod/himalaya/master/config.sample.toml > config.sample.toml

# spawn a testing IMAP/SMTP server using docker
docker run -it --rm -p 3025:3025 -p 3110:3110 -p 3143:3143 -p 3465:3465 -p 3993:3993 -p 3995:3995 -e GREENMAIL_OPTS='-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose' greenmail/standalone:latest

# test the CLI using the sample config
himalaya -c ./config.sample.toml envelope list

Few major concepts changed:

  • The concept of Backend and Sender changed. The Sender does not exist anymore (it is now a backend feature). A Backend is now a set of features like add folders, list envelopes or send raw message. The backend of every single feature can be customized in the configuration file, which gives users more flexibility. Here the list of backend features that can be customized:
    • backend (required): the backend used by default by all backend features (maildir, imap or notmuch)
    • folder.add.backend: override the backend used for creating folders (maildir, imap or notmuch)
    • folder.list.backend: override the backend used for listing folders (maildir, imap or notmuch)
    • folder.expunge.backend: override the backend used for expunging folders (maildir, imap or notmuch)
    • folder.purge.backend: override the backend used for purging folders (maildir, imap or notmuch)
    • folder.delete.backend: override the backend used for deleting folders (maildir, imap or notmuch)
    • envelope.list.backend: override the backend used for listing envelopes (maildir, imap or notmuch)
    • envelope.get.backend: override the backend used for getting envelopes (maildir, imap or notmuch)
    • envelope.watch.backend: override the backend used for watching envelopes (maildir, imap or notmuch)
    • flag.add.backend: override the backend used for adding flags (maildir, imap or notmuch)
    • flag.set.backend: override the backend used for setting flags (maildir, imap or notmuch)
    • flag.remove.backend: override the backend used for removing flags (maildir, imap or notmuch)
    • message.send.backend (required): override the backend used for sending messages (sendmail or smtp)
    • message.read.backend: override the backend used for reading messages (maildir, imap or notmuch)
    • message.write.backend: override the backend used for adding flags (maildir, imap or notmuch)
    • message.copy.backend: override the backend used for copying messages (maildir, imap or notmuch)
    • message.move.backend: override the backend used for moving messages (maildir, imap or notmuch)
  • The CLI API changed: every command is now prefixed by its domain following the format himalaya <domain> <action>. List of domain available by running himalaya -h and list of actions for a domain by running himalaya <domain> -h.
  • TOML configuration file options use now the dot notation rather than the dash notation. For example, folder-listing-page-size became folder.list.page-size. See the changed section below for more details.

Added

  • Added cargo feature maildir (not plugged yet).
  • Added cargo feature sendmail (not plugged yet).
  • Added watch hooks envelope.watch.received (when a new envelope is received) and envelope.watch.any (for any other event related to envelopes). A watch hook can be:
    • A shell command: envelope.watch.any.cmd = "mbsync -a"

    • A system notification:

      • envelope.watch.received.notify.summary = "📬 New message from {sender}": customize the notification summary (title)
      • envelope.watch.received.notify.body = "{subject}": customize the notification body (content)

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

  • Added watch support for Maildir backend features.

Changed

  • Renamed cargo feature imap-backendimap.
  • Renamed cargo feature notmuch-backendnotmuch.
  • Renamed cargo feature smtp-sendersmtp.
  • Changed the goal of the config option backend: it is now the default backend used for all backend features. Valid backends: imap, maildir, notmuch.
  • Moved folder-aliases config option to folder.alias(es).
  • Moved folder-listing-page-size config option to folder.list.page-size.
  • Moved email-listing-page-size config option to envelope.list.page-size.
  • Moved email-listing-datetime-fmt config option to envelope.list.datetime-fmt.
  • Moved email-listing-datetime-local-tz config option to envelope.list.datetime-local-tz.
  • Moved email-reading-headers config option to message.read.headers.
  • Moved email-reading-format config option to message.read.format.
  • Moved email-writing-headers config option to message.write.headers.
  • Move email-sending-save-copy config option to message.send.save-copy.
  • Move email-hooks.pre-send config option to message.send.pre-hook.
  • Moved sync config option to sync.enable.
  • Moved sync-dir config option to sync.dir.
  • Moved sync-folders-strategy config option to sync.strategy.
  • Moved maildir-* config options to maildir.*.
  • Moved imap-* config options to imap.*.
  • Moved notmuch-* config options to notmuch.*.
  • Moved sendmail-* config options to sendmail.*.
  • Moved smtp-* config options to smtp.*.
  • Replaced options imap-ssl, imap-starttls and imap-insecure by imap.encryption:
    • imap.encryption = "tls" | true: use required encryption (SSL/TLS)
    • imap.encryption = "start-tls": use opportunistic encryption (StartTLS)
    • imap.encryption = "none" | false: do not use any encryption
  • Replaced options smtp-ssl, smtp-starttls and smtp-insecure by smtp.encryption:
    • smtp.encryption = "tls" | true: use required encryption (SSL/TLS)
    • smtp.encryption = "start-tls": use opportunistic encryption (StartTLS)
    • smtp.encryption = "none" | false: do not use any encryption

Removed

  • Disabled temporarily the notmuch backend because it needs to be refactored using the backend features system (it should be reimplemented soon).
  • Disabled temporarily the search and sort command because they need to be refactored, see #39.
  • Removed the notify command (replaced by the new watch command).
  • Removed all global options except for display-name, signature, signature-delim and downloads-dir.

See config.sample.toml for a documented configuration example with the new API.

Don't miss a new himalaya release

NewReleases is sending notifications on new releases.