summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--home.nix4
-rwxr-xr-xmutt/notmuch-hook.sh18
-rw-r--r--muttrc29
-rw-r--r--notmuch104
-rw-r--r--packages.nix2
5 files changed, 155 insertions, 2 deletions
diff --git a/home.nix b/home.nix
index fdcbb61..a5adf08 100644
--- a/home.nix
+++ b/home.nix
@@ -54,6 +54,10 @@ in
source = ./msmtprc;
target = ".msmtprc";
};
+ notmuch = {
+ source = ./notmuch;
+ target = ".notmuch-config";
+ };
tmux = {
source = ./tmux;
target = ".tmux.conf";
diff --git a/mutt/notmuch-hook.sh b/mutt/notmuch-hook.sh
new file mode 100755
index 0000000..436f8e1
--- /dev/null
+++ b/mutt/notmuch-hook.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env sh
+
+notmuch new
+
+# retag all "new" messages "inbox" and "unread"
+notmuch tag +inbox +unread -new -- tag:new
+
+# tag all messages from "me" as sent and rmeove tags inbox and unread
+notmuch tag -new -inbox +sent -- from:ben@bsima.me or from:bsima@me.com
+
+# tag some newsletters, but don't show them in inbox
+notmuch tag +newsletters -new -inbox -- \
+ from:the-morning-paper@onelanday.co.uk or \
+ from:newsletter@fightaging.org or \
+ subject:'The Reading List Email*'
+
+# tag logwatch emails & remove from inbox
+notmuch tag +logwatch -new -inbox -- subject:'Logwatch*'
diff --git a/muttrc b/muttrc
index f6ddfdb..304a51f 100644
--- a/muttrc
+++ b/muttrc
@@ -21,8 +21,6 @@ source $alias_file
set move = no
set include
set auto_tag = yes
-alternative_order text/plain text/html *
-auto_view text/x-vcard text/html text/enriched
bind editor ^T complete
set pager_index_lines = 10
set implicit_autoview = yes
@@ -60,6 +58,33 @@ set use_envelope_from = yes
set envelope_from = yes
set text_flowed = yes
+# View multimedia emails
+
+alternative_order text/plain text/html *
+auto_view text/x-vcard text/html text/enriched
+macro index,pager \cb "<pipe-message> urlscan<Enter>" "Extract URLs"
+macro attach,compose \cb "<pipe-entry> urlscan<Enter>" "Extract URLs"
+
+# Searching/tagging with notmuch
+#
+# - https://neomutt.org/feature/notmuch
+# - https://wiki.archlinux.org/index.php/Notmuch#Integrating_with_NeoMutt
+
+set virtual_spoolfile=yes
+
+set nm_default_uri = "notmuch:///home/ben/Mail"
+virtual-mailboxes "inbox" "notmuch://?query=tag:inbox"
+virtual-mailboxes "archive" "notmuch://?query=tag:archive"
+virtual-mailboxes "sent" "notmuch://?query=tag:sent"
+
+macro index S "<vfolder-from-query>" "search mailbox"
+macro index,pager A "<modify-labels>+archive -unread -inbox\n" "archive message"
+macro index c "<change-vfolder>?" "change to vfolder overview"
+
+bind index,pager y modify-labels
+bind index,pager + entire-thread
+bind index,pager X change-vfolder
+
## Accounts
set my_pw = "`pass bnet/helium/mail/ben`"
diff --git a/notmuch b/notmuch
new file mode 100644
index 0000000..a26c613
--- /dev/null
+++ b/notmuch
@@ -0,0 +1,104 @@
+# .notmuch-config - Configuration file for the notmuch mail system
+#
+# For more information about notmuch, see https://notmuchmail.org
+
+# Database configuration
+#
+# The only value supported here is 'path' which should be the top-level
+# directory where your mail currently exists and to where mail will be
+# delivered in the future. Files should be individual email messages.
+# Notmuch will store its database within a sub-directory of the path
+# configured here named ".notmuch".
+#
+
+[database]
+path=/home/ben/Mail
+
+# User configuration
+#
+# Here is where you can let notmuch know how you would like to be
+# addressed. Valid settings are
+#
+# name Your full name.
+# primary_email Your primary email address.
+# other_email A list (separated by ';') of other email addresses
+# at which you receive email.
+#
+# Notmuch will use the various email addresses configured here when
+# formatting replies. It will avoid including your own addresses in the
+# recipient list of replies, and will set the From address based on the
+# address to which the original email was addressed.
+#
+
+[user]
+name=Ben Sima
+primary_email=ben@bsima.me
+
+# Configuration for "notmuch new"
+#
+# The following options are supported here:
+#
+# tags A list (separated by ';') of the tags that will be
+# added to all messages incorporated by "notmuch new".
+#
+# ignore A list (separated by ';') of file and directory names
+# that will not be searched for messages by "notmuch new".
+#
+# NOTE: *Every* file/directory that goes by one of those
+# names will be ignored, independent of its depth/location
+# in the mail store.
+#
+other_email=bsima@me.com;bensima@gmail.com;bsima@icloud.com;
+
+[new]
+tags=new
+ignore=
+
+# Search configuration
+#
+# The following option is supported here:
+#
+# exclude_tags
+# A ;-separated list of tags that will be excluded from
+# search results by default. Using an excluded tag in a
+# query will override that exclusion.
+#
+
+[search]
+exclude_tags=deleted;spam;
+
+# Maildir compatibility configuration
+#
+# The following option is supported here:
+#
+# synchronize_flags Valid values are true and false.
+#
+# If true, then the following maildir flags (in message filenames)
+# will be synchronized with the corresponding notmuch tags:
+#
+# Flag Tag
+# ---- -------
+# D draft
+# F flagged
+# P passed
+# R replied
+# S unread (added when 'S' flag is not present)
+#
+# The "notmuch new" command will notice flag changes in filenames
+# and update tags, while the "notmuch tag" and "notmuch restore"
+# commands will notice tag changes and update flags in filenames
+#
+
+[maildir]
+synchronize_flags=true
+
+# Cryptography related configuration
+#
+# The following option is supported here:
+#
+# gpg_path
+# binary name or full path to invoke gpg.
+#
+
+[crypto]
+gpg_path=gpg
diff --git a/packages.nix b/packages.nix
index 5234cf4..866f620 100644
--- a/packages.nix
+++ b/packages.nix
@@ -35,6 +35,7 @@ pkgs.msmtp
pkgs.neomutt
pkgs.networkmanager_vpnc
pkgs.nix-prefetch-scripts
+pkgs.notmuch
pkgs.offlineimap
pkgs.pass
pkgs.pavucontrol
@@ -52,6 +53,7 @@ pkgs.tdesktop
pkgs.tmux
pkgs.transmission-gtk
pkgs.tree
+pkgs.urlscan
pkgs.unrar
pkgs.vlc
pkgs.vpnc