dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | Submodules | README

commit a03289502f048f3c6374d9e454564edb75f6031b (patch)
parent f187231e5bbce4e2447fd7a2bedbfe77a0b648ff
Author: Alex Karle <alex@karle.co>
Date:   Sat,  6 Jul 2019 23:40:01 -0400

[mutt] adding bare-bones mutt config

I was using Luke Smith's mutt-wizard for a while, which was great, but I
reached the point where I wanted to really understand what was going on
in the tool.

So I scrapped it all and started from scratch, reading the manual and
tailoring the level of complexity to my not so intense needs.

Colors are lacking, but otherwise this is a pretty functional little
mail client!

Diffstat:
M.dotfiler.json | 1+
Amutt/.gitignore | 6++++++
Amutt/README.md | 27+++++++++++++++++++++++++++
Amutt/accounts/karleco.muttrc | 17+++++++++++++++++
Amutt/mailcap | 3+++
Amutt/muttrc | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 105 insertions(+), 0 deletions(-)

diff --git a/.dotfiler.json b/.dotfiler.json @@ -11,6 +11,7 @@ ], "XDG_DOTS": [ "alacritty", + "mutt", "nvim" ], "SKIP_FILES": [ diff --git a/mutt/.gitignore b/mutt/.gitignore @@ -0,0 +1,6 @@ +# Not worth checking in encrypted passwords, as FastMail requires a different +# password for each client anyways... +*.gpg + +# Don't check in those emails ;) +cache diff --git a/mutt/README.md b/mutt/README.md @@ -0,0 +1,27 @@ +# mutt + +Trying `mutt` in pursuit of an email client that sucks less. + +## Installation + +This folder should be symlinked to the `$XDG_CONFIG_HOME`. But other than that +it is necessary to generate an encrypted password file. + +Given that I am using FastMail, they insist on having a one-client one-time +password for each mail client that isn't theirs. So, in this order: + +1. Go to FastMail's web client +2. Under Settings create a password +3. Create a GPG key if you don't already have one: + +``` +gpg --gen-key +``` + +4. Use that key's public key to encrypt the password (and putt it in a file): + +``` +echo -n "PASSWORD" | gpg --encrypt -r EMAIL > accounts/karleco.gpg +``` + +Now, everything should work! diff --git a/mutt/accounts/karleco.muttrc b/mutt/accounts/karleco.muttrc @@ -0,0 +1,17 @@ +# Account setup for my personal email +# Checked into git as a template for other accounts + +set from="alex@karle.co" +set realname="Alex Karle" + +# Use the baked in IMAP (For the most part, I only check email on a network) +set imap_user=$from +set imap_pass=`gpg --batch --quiet --decrypt ~/.config/mutt/accounts/karleco.gpg` +set folder="imaps://imap.fastmail.com" +set spoolfile="=INBOX" +set record="=Sent" +set postponed="=Drafts" + +# Never had an issue with the mutt SMTP. I'm all for the UNIX philosophy +# but since it's already there... may as well use it? +set smtp_url="smtps://$imap_user:$imap_pass@smtp.fastmail.com:465" diff --git a/mutt/mailcap b/mutt/mailcap @@ -0,0 +1,3 @@ +text/html; firefox '%s' &; test=test -n "$DISPLAY"; needsterminal; +text/html; w3m -I %{charset} -T text/html; copiousoutput; +application/pdf; xdg-open '%s' &; test=test -n "$DISPLAY"; needsterminal; diff --git a/mutt/muttrc b/mutt/muttrc @@ -0,0 +1,51 @@ +# muttrc +# In pursuit of an email client that sucks less + +################################################################################ +# General +source ~/.config/mutt/accounts/karleco.muttrc + +# Appearance +# TODO: maybe one day a color scheme... +set sort=threads +set sort_aux=reverse-date + +# Attachments +set mailcap_path=~/.config/mutt/mailcap +auto_view text/html # tell mutt to load HTML via mailcap +alternative_order text/plain text/enriched text/html # prefer plaintext + +# Fetching Mail +set mail_check=90 # From the manual, over IMAP, 90 reasonable value +set timeout=15 # mutt blocks mail check if no user input + +# Caching (speeds up IMAP considerably to not redownload every time) +set header_cache="~/.config/mutt/cache" +set message_cachedir="~/.config/mutt/cache" + + +################################################################################ +# Bindings +# I've chosen to customize-as-I-go on these. Some general guiding rules: +# 1. Vi-like +# - Obvious reasons +# 2. Non-destructive +# - Especially as a newby, its **the worst** to have CTRL-D +# which I spam in Vim for half-down to delete 5-10 messages +# in the pager before I've realized what I've done. +bind pager j next-line +bind pager k previous-line +bind index G last-entry +bind pager G bottom +bind index,pager g noop # good practice, as gg prevents g from binding +bind index gg first-entry +bind pager gg top +bind index,pager h help +bind index,pager ? search-reverse +bind index N search-opposite +bind index,pager \CD half-down +bind index,pager \CU half-up +bind index,pager d half-down +bind index,browser u half-up + +bind attach <return> view-mailcap