No description
Find a file
Ade Attwood f7e9b84d95 refactor: move log messages to after the sync
Summary:
When interacting with external programs there is not a lot you can do if the
log messages is before the sync. By having the message after the sync this will
allow you to update mail indexes when new messages come in.

This is used right now with the emacs mu4e plugin. Its used to watch messages
then update mu when new messages arrive in a mailbox.

Test Plan:
This has been used locally for some time now. Its not a functional change
anyway.

Reviewers: AdeAttwood

Reviewed By: AdeAttwood

Differential Revision: https://ph.baln.co.uk/D4
2024-07-23 22:04:33 +01:00
assets docs: add the readme 2024-06-22 11:05:00 +01:00
src refactor: move log messages to after the sync 2024-07-23 22:04:33 +01:00
.gitignore chore: initial commit 2024-06-21 11:19:36 +01:00
Cargo.lock chore: initial commit 2024-06-21 11:19:36 +01:00
Cargo.toml chore: initial commit 2024-06-21 11:19:36 +01:00
README.md docs: add the readme 2024-06-22 11:05:00 +01:00

mbwatch

mbwatch is a CLI tool designed to monitor mailboxes and automatically invoke mbsync when changes occur in the remote mailbox. mbsync is a highly regarded tool for synchronizing remote email accounts with local maildir, but it requires manual execution to update changes. Typically, this is managed through periodic polling using a tool like cron, which can result in delayed message synchronization.

mbwatch addresses this issue by leveraging the IMAP IDLE feature to continuously monitor the mailbox for changes. When a change is detected, mbwatch automatically triggers mbsync to sync the new messages, ensuring your local maildir is always up-to-date without manual intervention.

Prerequisites

  • The remote IMAP server must support IDEL
  • The rust toolchain for building
  • mbsync installed and configured

Installation

Right now there are no prebuilt binary, you can install from git using cargo.

cargo install --git https://github.com/AdeAttwood/MbWatch

Configuration

This tool will use the mbsync Groups config from your existing .mbsyncrc. You will need to define a group called mbwatch, it will then watch all the mailboxes defined in the Channels prop. This should be a comma separated list of channel:mailbox like you define on the mbsync cli.

This is an example config, it assumes you have two channels called work and personal each remote store has a mailbox called INBOX and the work mailbox has one called Archive.

Group mbwatch
Channels work:INBOX, work:Archive, personal:INBOX

For more details on the .mbsyncrc you can view the upstream mbsync docs