From 1d562af8927d932bc3329de3b06c94a966047238 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 30 Jan 2023 17:33:06 -0600 Subject: Add a bunch of stuff Forgot I had to `git add -f' these! --- notmuch/config | 103 ++++++++++++++++++++++++++++++++++++++ notmuch/default/hooks/post-insert | 14 ++++++ notmuch/default/hooks/post-new | 22 ++++++++ notmuch/default/hooks/pre-new | 15 ++++++ notmuch/post-new.tags | 34 +++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 notmuch/config create mode 100755 notmuch/default/hooks/post-insert create mode 100755 notmuch/default/hooks/post-new create mode 100755 notmuch/default/hooks/pre-new create mode 100644 notmuch/post-new.tags (limited to 'notmuch') diff --git a/notmuch/config b/notmuch/config new file mode 100644 index 0000000..be90ebc --- /dev/null +++ b/notmuch/config @@ -0,0 +1,103 @@ +# .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/case/var/mail +hook_dir=/home/case/etc/notmuch/default/hooks + +# 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=Case Duckworth +primary_email=case@acdw.net +other_email=acdw@fastmail.com;acdw@acdw.net;breadpunk@acdw.net;caseandrachel19@acdw.net;caseduckworth@acdw.net;comments@acdw.net;lists@acdw.net;me@acdw.net;pam@acdw.net;ring@acdw.net;sonn-it@acdw.net;webring@acdw.net;caseduckworth@fastmail.com;loosepoops@fea.st;case@clickheredigital.com;case@thebryc.org;case.duckworth@papertutors.co + +# 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. +# +[new] +tags=inbox;unread; +ignore=.mbsyncstate;.isyncuidmap.db;.uidvalidity;/.*[.](json|lock|bak|journal|new|drafts)$/; + +# 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;Spam;Trash;sent + +# Show configuration +[show] +extra_headers=List-Post; + +# 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/notmuch/default/hooks/post-insert b/notmuch/default/hooks/post-insert new file mode 100755 index 0000000..b983dfc --- /dev/null +++ b/notmuch/default/hooks/post-insert @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Notmuch post-insert hook + +# This hook is invoked by the insert command after the message has +# been delivered, added to the database, and initial tags have +# been applied. The hook will not be run if there have been any +# errors during the message delivery; what is regarded as success‐ +# ful delivery depends on the --keep option. + +# Typically this hook is used to perform additional query-based +# tagging on the delivered messages. + +# TODO: In notmuch v0.35, the location of this hook becomes configurable. +# When I have that installed, I want to move this to ~/.config/notmuch. diff --git a/notmuch/default/hooks/post-new b/notmuch/default/hooks/post-new new file mode 100755 index 0000000..744c334 --- /dev/null +++ b/notmuch/default/hooks/post-new @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Notmuch post-new hook + +# This hook is invoked by the new command after new messages have +# been imported into the database and initial tags have been ap‐ +# plied. The hook will not be run if there have been any errors +# during the scan or import. + +# Typically this hook is used to perform additional query-based +# tagging on the imported messages. + +# TODO: In notmuch v0.35, the location of this hook becomes configurable. +# When I have that installed, I want to move this to ~/.config/notmuch. + +# Update tags based on folders +for fdir in ~/var/mail/fastmail/* ; do + if [[ $(basename "$fdir") != "INBOX" ]]; then + notmuch tag +$(basename "$fdir") -inbox -- "folder:${fdir##$HOME/var/mail/}" + fi +done + +notmuch tag --batch --input="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch/post-new.tags" diff --git a/notmuch/default/hooks/pre-new b/notmuch/default/hooks/pre-new new file mode 100755 index 0000000..443e3f2 --- /dev/null +++ b/notmuch/default/hooks/pre-new @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Notmuch pre-new hook + +# This hook is invoked by the new command before scanning or im‐ +# porting new messages into the database. If this hook exits with +# a non-zero status, notmuch will abort further processing of the +# new command. + +# Typically this hook is used for fetching or delivering new mail +# to be imported into the database. + +# TODO: In notmuch v0.35, the location of this hook becomes configurable. +# When I have that installed, I want to move this to ~/.config/notmuch. + +/home/case/usr/scripts/syncmail diff --git a/notmuch/post-new.tags b/notmuch/post-new.tags new file mode 100644 index 0000000..e9dd2f7 --- /dev/null +++ b/notmuch/post-new.tags @@ -0,0 +1,34 @@ +# -*- mode: notmuch-tags -*- +# Notmuch post-new tags --- see + +# Account tags ++personal -- path:fastmail/** + ++clickhere +work -- path:clickhere/** +-inbox -unread -- tag:TaskIQ +-inbox -unread -- from:get@myreports.email or from:mail@semrush.com +-inbox -unread -- from:"/Semrush App Center Team/" +-inbox -- to:seo@clickheredigital.com + ++bryc +work -- path:bryc/* + ++paper +work -- path:paper/** +-inbox -unread -- path:paper/** and subject:"Shift Transfer Request" + +# Spam ++spam -new -- folder:/.*[Ss]pam.*/ or folder:/.*[Jj]unk.*/ + +# Auto-archive ++archive -new -inbox -- not tag:unread and date:..6M + +# Sent mail ++sent -new -unread -inbox -- tag:new from:/.*@acdw\.net/ or from:case@clickheredigital.com or from:case@thebryc.org + +# Calendar invites ++invite -- attachment:ics + +# Draft +-inbox -unread -- tag:draft or folder:draft + +# Etc, etc, etc. ++dracula -unread -- from:draculadaily@substack.com -- cgit 1.4.1-21-gabe81