Skip to content

arnisoph/postisto

Repository files navigation

poŝtisto

Apache-2.0-licensed GitHub release Join Gitter Chat GitHub Workflow Status (branch) Go Docs GitHub go.mod Go version codecov badge Go Report Card codebeat badge

General

poŝtisto is the successor of Tabellarius, an IMAP client that sorts your mailboxes based on an extensive configuration language. Unlike other mail filters it uses the same IMAP connection accross multiple IMAP commands and simple markup language instead of a complex scripting language though it isn't that feature-rich as the well-known Sieve standard.

It became necessary because of missing features in the ManageSieve protocol and service providers that don't even provide a ManageSieve service or any more advanced filter techniques.

What it actually does is to parse your YAML config files, sets up an IMAP connection pool to one or more IMAP servers, checks whether new e-mails match to your rule sets and then move it to your desired folder (or flags them). It usually doesn't download the full e-mail and _never_ changes the contents of an e-mail.

Demo

Basic Demo

Contributing

Bug reports and pull requests are welcome!

In general:

  1. Fork this repo on Github
  2. Add changes, add test, update docs
  3. Submit your pull request (PR) on Github, wait for feedback

But it’s better to file an issue with your idea first.

Installing

Download from Github

You can download pre-built binaries and Docker images from the Github project page.

Install from Source

You want to patch the source code and use your self-built binary? Easy!

Installing from source

Testing

You need a running Docker daemon with Internet connection. The container image that is beeing downloaded contains Dovecot and Redis.

Start the tests:

make test

Configuring

Supported Protocols

IMAP over Plain Text Transport (don't use it!):

accounts:
  myaccount:
    enable: true
    connection:
        server: imap.server.de
        username: imap@account.de
        password: mypassword
        port: 143
        starttls: false
        imaps: false

IMAP via STARTTLS (usually port 143):

accounts:
  myaccount:
    enable: true
    connection:
        server: imap.server.de
        username: imap@account.de
        password: mypassword
        port: 143
        starttls: true
        imaps: false

IMAP via Force-TLS/SSL (usually port 993):

accounts:
  myaccount:
    enable: true
    connection:
        server: imap.server.de
        username: imap@account.de
        password: mypassword
        port: 993
        starttls: false
        imaps: true

Authentication

Plain text in configuration file (don't use it!):

accounts:
  myaccount:
    enable: true
    connection:
        server: imap.server.de
        username: imap@account.de
        password: mypassword
        port: 993
        starttls: false
        imaps: true

Read plain text password from filesystem:

$ ls -l config/
total 8
-rw-r--r--  1 ab  staff  15 Jan 20 22:37 config.yml
$ cat config.yml
accounts:
  myaccount:
    server: imap.server.de
    username: imap@account.de
    port: 993
    starttls: false
    imaps: true

$ echo -n "MyP@ssw0rd42" > config/.postisto.myaccount.pwd
$ ls -lA config
total 16
-rw-r--r--  1 ab  staff  12 Jan 20 13:37 .postisto.myaccount.pwd
-rw-r--r--  1 ab  staff  15 Jan 20 13:37 config.yml
$ postisto -c config/

The pwd file must match .postisto.<YOUR-ACCOUNT-NAME-FROM-CONFIG-FILE>.pwd.

Filters/ Rule Sets

The config/ directory in the source code repository contains some useful examples. You can also find more advanced examples in the tests.