Kevin Thomas Development

Navigation

Using mutt, ProtonMail Bridge, and isync for email on Linux

February 13, 2021

Recently, offlineimap was removed from many Linux distros due to it relying on Python 2, and I found myself needing a new solution for using mutt (my email client of choice) and ProtonMail Bridge. I was able to use the program isync as a substitute. My initial setup for mail with offlineimap was based off this excelent post: https://spaceandtim.es/code/protonmail_mutt so you can refer to it for a lot of the reasoning behind this configuration. I'm personally using Gentoo, but this should work on most distros.

isync

Install isync. Once installed, you can configure isync by creating a file named .mbsyncrc in your home directory. Here is what mine looks like for getting it working with ProtonMail Bridge:
SyncState *
Sync Pull All Push All
    
IMAPAccount [Put email here]
Host 127.0.0.1
Port 1143
User [Put email here]
Pass [Put ProtonMail Bridge password here]
SSLType None
AuthMechs LOGIN
    
IMAPStore kevin-remote
Account [Put email here]
UseNamespace yes
    
MaildirStore kevin-local
SubFolders Verbatim
Inbox ~/Mail/kevin/INBOX
Path ~/Mail/kevin/
Flatten .
    
Channel kevin
Master :kevin-remote:
Slave :kevin-local:
Patterns *
Create Both
Expunge Both

mutt

Here are the relevant parts of my .muttrc file in my home directory:
set mbox_type=Maildir
set folder=~/Mail/kevin
set mail_check=2 # seconds

# smtp
set my_user=[Put email here]
set my_pass=[Put ProtonMail Bridge password here]
set smtp_url=smtp://[Put email here]:[Put ProtonMail Bridge password here]@127.0.0.1:1025
set ssl_starttls
set spoolfile = "+INBOX"
mailboxes +INBOX +Archive +Sent +Trash +Spam

mbsync

You can run mbsync [channel name] to sync your mail, for example: mbsync kevin. So I have setup a cron job to sync my mail every five minutes:
*/5 * * * * /usr/bin/mbsync kevin

Conclusion

With ProtonMail Bridge running in the background (I personally use protonmail-bridge-cli) and a configured isync running periodically, I can now use mutt with ProtonMail Bridge comfortably. Hope this helps!