Last modified: 2023-03-29
aerc
aerc is a terminal-based e-mail client with Vim-style keybindings.
Let me just start by saying that sure, email is nice and all, but it is so obsolete technology.
And there are far too many "hotfixes" and additional layers of complexity just to keep it running these days in somewhat secure way. The protocol was simply not designed well, there is no security in mind, so many features were added on as afterthought and many things lack standardization.
I have underwent a process of creating my own email server and oh boy, that is a pain in the ass. So many loops and hoops you have to get though ...
aerc is a work in progress.
gmail does not work out of the box! You need 2FA (2 Factor Authentification) and special app password
, but thankfully both of these are rather easy to setup.
It used to be enought to Allow Less Secure Apps
in account settings, but that is no longer possible. See aerc mailing list: invalid credentials and Less secure apps & your Google Account
What I will describe here is setup of aerc
to work offline and with multiple accounts. Regarding email providers, I will try to get following to work:
- Google / Gmail
- Microsoft / Outlook
- Protonmail
- Tutanota
- My personal email server
And I will use the following software:
- aerc = the email client, will serve as interface to emails stored locally on disk
- khard = console address book
- mbsync/isync with goimapnotify = synchronize mailboxes
- I want to use
goimapnotify
to get push notifications (mostly to save bandwidth, but the immediate mail delivery is also nice)
- I want to use
- keepassxc = password manager (to avoid saving passwords in config files)
- msmtp = SMTP client for sending emails (you need this for offline use)
Sources I have used for inspiration:
- https://takashiidobe.com/gen/offline-email.html
- Drew DeVault's blog post: aerc, mbsync, and postfix for maximum comfy offline email
- Google / Sign in with App Passwords
The structure
- all emails will be stored in MailDir format for offline use
- the local
MailDir
will be synchronised with email server viambsync/isync
, triggered bygoimapnotify
using push notifications - outgoing emails will be handled by
msmtp
which will queue them until online aerc
will be acting as user interfacekhard
will be used as address bookkeepassxc
will store passwords for the email accounts
The MailDir can be anywhere, but I will use ~/.mail
, and each account will have it's subdirectory:
~/.mail
|-- account1
| |-- INBOX
| `-- ..
|-- account2
`-- ...
First issues
The first problem that I can see is that there is a lot of redundant configuration. The email accounts are defined in practically each of the used programs. If you have multiple accounts, it will be a lot of work.
Config files that need account details:
- aerc:
~/.config/aerc/accounts.conf
- mbsync/isync:
~/.mbsyncrc
(I will move this to~/.config/mbsyn/mbsyncrc.conf
- do this in sync script) - goimapnotify:
~/.config/imapnotify/<account>.conf
- msmtp:
~/.config/msmtp/config
I will start by configuring everything manually, one thing at the time, and slowly add on the layers. At the end, I will create a script for handling the configuration for me.