clarity's wiki

Email

I'm trying out handling my email in the terminal, though I still use a graphical client for some tasks.

Reflections on using a plaintext email client

Aerc

I'm using Aerc as my email client right now.

Aerc

Aerc settings live in ~Library/Preferences/aerc/

Usage with maildirs

To use a maildir, set the source in accounts.conf as

source = maildir://Users/myself/Mail/

Aerc wants your maildirs to be lumped together into a common folder. Here's how I configured this in postfix:

sudo postconf -e "home_mailbox = Mail/Inbox/"

The path is relative to your home directory. The trailing slash ensures that it's a maildir and not an mbox.


Handling html

Html emails can be formatted with w3m (available on Homebrew)

text/html=w3m -T text/html -cols $(($(tput cols) > 80 ? 80 : $(tput cols))) -dump -o display_image=false -o   display_link_number=true

Using Fetchmail to store local copies of emails

Aerc has no caching. If you want your emails to be stored locally, you can set up a service to pull your remote emails into a local maildir.

Fetchmail

First, make sure postfix is running

sudo postfix start

Set up a .fetchmailrc in your home directory.

poll imap.gmail.com proto IMAP auth password
    # map the email address to the machine username
    user "me@clarity.com" is myself here
    password 'secret'
    # keep: don't delete emails from the server
    # idle: keep the connection alive. note that this won't work if
    # you need to check multiple inboxes or accounts.
    keep, ssl, sslcertck, idle
    # in order to use `idle` we need to pick which folder is being
    # watched
    folder "Inbox"

For logging add a line like this to the start of the config:

set logfile "Users/myself/log/fetchmail"

It can't create the log, so make sure it already exists.

mkdir ~/log
touch ~/log/fetchmail
set logfile "/Users/me/log/fetchmail"