Skip to content

Commit

Permalink
Update my email post-new.sh with some sanity-preserving measures
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Mar 14, 2018
1 parent 4be6805 commit aef2a2c
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions packages/email/post-new.sh
@@ -1,6 +1,13 @@
#!/bin/sh

PATH="@path@"

if [ "$(echo "@path@" | rev)" != "@htap@" ]; then
# @path@ becomes a fully defined PATH by default.nix, which
# makes it hard to dev this script without doing full rebuilds,
# heh. so ... do the ol' rev-eroo to avoid the comparison being
# replaced too.
PATH="@path@"
fi

cleanup() {
pushd '/home/grahamc/.mail/grahamc/[Gmail]/.All Mail/cur'
Expand All @@ -25,13 +32,14 @@ set -o pipefail

cleanup

notmuch tag -inbox -- "from:codetriage.com or from:pinterest.com"
notmuch tag +ofborg -inbox -- "to:graham+ofborg@grahamc.com"
notmuch tag +gocd -inbox -- "tag:inbox and to:go-cd@googlegroups.com"
notmuch tag +nixpkgs -- "tag:inbox and (to:nix-dev@lists.science.uu.nl or to:nixpkgs@noreply.github.com or to:hydra@noreply.github.com)"
notmuch tag +security -inbox -- "(to:debian-security-announce@lists.debian.org or to:oss-security@lists.openwall.com)"
notmuch tag +draft 'path:[Gmail]/.Drafts/**'
notmuch tag +spam 'path:[Gmail]/.Spam/**'


# USAA Withdrawal or Available Messages
# if they're older than 1 day,
# or have been read
Expand All @@ -49,20 +57,16 @@ notmuch tag -inbox '
)
'

# All the following senders aren't spam, but I don't read them
# regularly
notmuch tag -inbox '
(
(from:nomadphp.com)
or (from:stackcommerce)
or (from:linkedin)
or (from:logentries.com)
or (from:nytimes.com)
or (from:lobste.rs)
or (from:matrix.org)
or (from:quora.com)
or (from:pnc.com)
or (from:mail.theguardian.com)
or (from:youtube.com)
or (from:avangate.com)
or (from:meetup.com)
Expand All @@ -81,6 +85,23 @@ notmuch tag -inbox '
or (from:fasten.com)
or (from:exprpt.com)
or (from:webpass.io)
or (from:moveon.org)
or (from:notifications@todoist.com)
or (from:pool.com subject:"Hotlist for ")
or (from:"Hydra Build Daemon")
or (from:"info@optiqueaustin.com")
or (to:your_activity@noreply.github.com)
or (to:nixpkgs@noreply.github.com and (not to:mention@noreply.github.com))
or (to:nix@noreply.github.com and (not to:mention@noreply.github.com))
)
'

# All the following senders aren't spam, but I don't read them
# regularly
notmuch tag -inbox '
(
(from:nytimes.com)
or (from:kickstarter.com)
)
and (
date:..1D
Expand Down

0 comments on commit aef2a2c

Please sign in to comment.