Synchronise IMAP with local maildir


browse log




Work-in-progress bi-directional synchronisation between an IMAP folder and a local maildir directory.

At the time of writing it can bi-directionally synchronise messages and the maildir flags of a single folder. Only a TLS connection to the IMAP server is supported with plain credential, usually this done on port 993.


The binary only supports one lone argument, which is required: a path to the configuration file:

imapsyncer config.yaml


Configured using YAML:

    server: ""
    port: 993
    user: ""
    password: "your-secret"
    folder: "INBOX"
    path: "~/.mail/inbox"

#Known issues

  • Sometimes parsing the IMAP server response gets stuck in an infinite loop. This usually happens only after a few thousands of messages have been downloaded.

  • There is currently no benefit whatsoever from using an async Rust stack.

  • Uploading new messages to the IMAP server does not yet immediately synchronise the flags. They will only be synchronised on the next run.


This is only to give a rough idea of the possible directions this might take.

  • IMAP IDLE support instead of only "oneshot" synchronisation.

  • Synchronise all IMAP flags, including custom flags. Local IMAP flag storage probably via an SQLite table which would need to be updated by whatever local software might want to manipulate those instead of the maildir flags.

  • Synchronise GMail tags. Likely by storing local tags in an SQLite table which would need to be updated

  • Avoid storing maildir flags on the filenames. This is strictly no longer maildir, but is a mode supported by notmuch and allows more efficient maildir manipulations.

  • Optional direct support for synhronising notmuch tags.