isync (command: mbsync) is a tool for synchronizing IMAP mailboxes with local Maildir folders. Essential for offline email access with clients like aerc or mutt.

Installation

Arch Linux:

sudo pacman -S isync

ProtonMail Integration

ProtonMail requires the Proton Bridge app for IMAP access. See the Arch Wiki guide for details.

Setup with Proton Bridge

  1. Install and run Proton Bridge
  2. Get credentials from Bridge (it generates local IMAP/SMTP credentials)
  3. Configure mbsync as below

Configuration

~/.mbsyncrc:

# Global settings
Create Both
Remove Both
Expunge Both
SyncState *
 
# ProtonMail via Proton Bridge
IMAPAccount proton
Host 127.0.0.1
Port 1143
User your-email@proton.me
PassCmd "cat ~/.config/proton-bridge/password"
SSLType STARTTLS
CertificateFile ~/.config/proton-bridge/cert.pem
 
IMAPStore proton-remote
Account proton
 
MaildirStore proton-local
Path ~/.local/share/mail/proton/
Inbox ~/.local/share/mail/proton/INBOX
SubFolders Verbatim
 
Channel proton
Far :proton-remote:
Near :proton-local:
Patterns *

Usage

# Sync all configured channels
mbsync -a
 
# Sync specific channel
mbsync proton
 
# Verbose output
mbsync -V proton
 
# Dry run (show what would happen)
mbsync -n proton

Automation

systemd timer

~/.config/systemd/user/mbsync.timer:

[Unit]
Description=Sync mail periodically
 
[Timer]
OnBootSec=1m
OnUnitActiveSec=5m
 
[Install]
WantedBy=timers.target

~/.config/systemd/user/mbsync.service:

[Unit]
Description=Sync mail
 
[Service]
Type=oneshot
ExecStart=/usr/bin/mbsync -a

Enable:

systemctl --user enable --now mbsync.timer

Tips

  • Create the local maildir first: mkdir -p ~/.local/share/mail/proton
  • Use PassCmd to avoid storing passwords in config
  • The Patterns * line syncs all folders; use specific patterns to limit
  • Check sync status with mbsync -V for verbose output