From 1239f26e8a771b4040e8ebd557de0738b4d7d24a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 6 Jun 2018 16:26:24 +0200 Subject: feat(mail): Import email configuration into Nix This moves my email configuration into NixOS, including the following features: 1. Replaced the NixOS-builtin offlineimap user service with a custom one that runs notmuch-indexing as part of the systemd unit instead of a postsynchook, which is significantly more reliable. 2. Adds configuration for notmuch and its tagging. 3. Adds configuration for OfflineIMAP & MSMTP. Relevant emacs configuration has also been added to my emacs.d repository. --- dotfiles/msmtprc | 24 +++++++++++++++++++ dotfiles/notmuch-config | 21 +++++++++++++++++ dotfiles/offlineimaprc | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 dotfiles/msmtprc create mode 100644 dotfiles/notmuch-config create mode 100644 dotfiles/offlineimaprc (limited to 'dotfiles') diff --git a/dotfiles/msmtprc b/dotfiles/msmtprc new file mode 100644 index 000000000000..c6a9a7426a6e --- /dev/null +++ b/dotfiles/msmtprc @@ -0,0 +1,24 @@ +defaults + +port 587 +tls on +tls_trust_file /etc/ssl/certs/ca-certificates.crt + +# Aprila mail +account aprila +from vincent@aprila.no +host smtp.office365.com +auth on +user vincent@aprila.no +passwordeval pass show aprila/office365-mail + +# Runbox mail +account runbox +from mail@tazj.in +host mail.runbox.com +auth on +user mail@tazj.in +passwordeval pass show general/runbox-tazjin + +# Use Runbox as default +account default : runbox diff --git a/dotfiles/notmuch-config b/dotfiles/notmuch-config new file mode 100644 index 000000000000..083be6d8ca19 --- /dev/null +++ b/dotfiles/notmuch-config @@ -0,0 +1,21 @@ +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see https://notmuchmail.org + +[database] +path=/home/vincent/mail + +[user] +name=Vincent Ambo +primary_email=mail@tazj.in +other_email=vincent@aprila.no;tazjin@gmail.com; + +[new] +tags=unread;inbox; +ignore= + +[search] +exclude_tags=deleted;spam; + +[maildir] +synchronize_flags=true diff --git a/dotfiles/offlineimaprc b/dotfiles/offlineimaprc new file mode 100644 index 000000000000..56840c99d113 --- /dev/null +++ b/dotfiles/offlineimaprc @@ -0,0 +1,61 @@ +[general] +accounts = aprila, tazjin, gmail + +[DEFAULT] +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt + +# Main work account: +[Account aprila] +localrepository = aprila-local +remoterepository = aprila-remote + +[Repository aprila-local] +type = Maildir +localfolders = ~/mail/aprila + +[Repository aprila-remote] +type = IMAP +remotehost = outlook.office365.com +remoteuser = vincent@aprila.no +remotepassfile = ~/.config/mail/aprila-pass +# Office365 is a naughty boy when it comes to IMAP. Even worse, they +# also seem to have decided that they should change IMAP folder names +# based on the UI language. +# +# I can't be bothered to implement the entire (relatively long) +# blacklist, so I'll instead whitelist relevant folders: +folderfilter = lambda folder: folder in ['INBOX', 'Arkiv', 'Sende element'] + +# Private GMail account (old): +[Account gmail] +# maxage = 30 # otherwise the volume is too high ... +localrepository = gmail-local +remoterepository = gmail-remote +synclabels = yes + +[Repository gmail-local] +type = GmailMaildir +localfolders = ~/mail/gmail + +[Repository gmail-remote] +type = Gmail +remoteuser = tazjin@gmail.com +remotepassfile = ~/.config/mail/gmail-pass +folderfilter = lambda folder: folder == 'INBOX' + +# Main private account: +[Account tazjin] +localrepository = tazjin-local +remoterepository = tazjin-remote + +[Repository tazjin-local] +type = Maildir +localfolders = ~/mail/tazjin + +[Repository tazjin-remote] +type = IMAP +remotehost = mail.runbox.com +remoteuser = mail@tazj.in +remotepassfile = ~/.config/mail/tazjin-pass +auth_mechanisms = LOGIN -- cgit 1.4.1