-
-
Save aperezdc/3973087 to your computer and use it in GitHub Desktop.
Notmuch misc config files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'notmuch) | |
(require 'notmuch-address) | |
(notmuch-address-message-insinuate) | |
(setq notmuch-address-command "/home/aperez/.local/bin/notmuch-addrlookup") | |
(setq message-kill-buffer-on-exit t) | |
(setq mail-specify-envelope-from t) | |
(setq message-sendmail-envelope-from 'header) | |
(setq mail-envelope-from 'header) | |
(add-hook 'message-setup-hook | |
'mml-secure-message-sign-pgpmime) | |
;;(add-hook 'message-setup-hook | |
;; '(lambda () (footnote-mode t))) | |
(define-key notmuch-search-mode-map "d" | |
(lambda () | |
"toggle deleted tag for thread" | |
(interactive) | |
(if (member "deleted" (notmuch-search-get-tags)) | |
(notmuch-search-tag "-deleted") | |
(notmuch-search-tag '("+deleted" "-inbox" "-unread"))))) | |
(define-key notmuch-show-mode-map "d" | |
(lambda () | |
"toggle deleted tag for message" | |
(interactive) | |
(if (member "deleted" (notmuch-show-get-tags)) | |
(notmuch-show-tag "-deleted") | |
(notmuch-show-tag '("+deleted" "-inbox" "-unread"))))) | |
(define-key notmuch-search-mode-map "j" | |
(lambda () | |
"toggle the spam (junk) tag for thread" | |
(interactive) | |
(if (member "spam" (notmuch-search-get-tags)) | |
(notmuch-search-tag "-spam") | |
(notmuch-search-tag '("+spam" "-ham" "-inbox" "-unread"))))) | |
(define-key notmuch-show-mode-map "j" | |
(lambda () | |
"toggle the spam (junk) tag for message" | |
(interactive) | |
(if (member "spam" (notmuch-show-get-tags)) | |
(notmuch-show-tag "-spam") | |
(notmuch-show-tag '("+spam" "-ham" "-inbox" "-unread"))))) | |
(define-key notmuch-search-mode-map "H" | |
(lambda () | |
"toggle the ham tag for thread" | |
(interactive) | |
(if (member "ham" (notmuch-search-get-tags)) | |
(notmuch-search-tag "-ham") | |
(notmuch-search-tag '("+ham" "-spam"))))) | |
(define-key notmuch-show-mode-map "H" | |
(lambda () | |
"toggle the ham tag for message" | |
(interactive) | |
(if (member "ham" (notmuch-show-get-tags)) | |
(notmuch-show-tag "-ham") | |
(notmuch-show-tag '("+ham" "-ham"))))) | |
(define-key notmuch-search-mode-map "F" | |
(lambda () | |
"toggle the flagged tag for thread" | |
(interactive) | |
(if (member "flagged" (notmuch-search-get-tags)) | |
(notmuch-search-tag "-flagged") | |
(notmuch-search-tag "+flagged")))) | |
(define-key notmuch-show-mode-map "F" | |
(lambda () | |
"toggle the flagged tag for message" | |
(interactive) | |
(if (member "flagged" (notmuch-show-get-tags)) | |
(notmuch-show-tag "-flagged") | |
(notmuch-show-tag "+flagged")))) | |
(define-key notmuch-search-mode-map "i" | |
(lambda () | |
"toggle the ignore tag for thread" | |
(interactive) | |
(if (member "ignore" (notmuch-search-get-tags)) | |
(notmuch-search-tag "-ignore") | |
(notmuch-search-tag '("+ignore" "-inbox" "-unread"))))) | |
(define-key notmuch-show-mode-map "i" | |
(lambda () | |
"toggle the ignore tag for message" | |
(interactive) | |
(if (member "ignore" (notmuch-show-get-tags)) | |
(notmuch-show-tag "-ignore") | |
(notmuch-show-tag '("+ignore" "-inbox" "-unread"))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -e | |
# Delete old Spam/ReSpam/ReHam messages | |
find ~/.mail/Spam.ReSpam/cur -type f -delete | |
find ~/.mail/Spam.ReHam/cur -type f -delete | |
notmuch new | |
# Keep ignored threads, er... ignored | |
notmuch search --output=threads \( tag:killed or tag:ignore \) \ | |
| xargs -r notmuch tag +killed -unread -inbox -- | |
# Now do some tagging | |
notmuch tag +notify -- tag:inbox and from:noreply@ or from:no-reply@ | |
notmuch tag +fax -- tag:inbox and from:hylafax@ | |
notmuch tag +log -inbox -- tag:inbox and from:logcheck@ | |
notmuch tag +qsparql -- tag:inbox and to:[email protected] | |
notmuch tag +gnome +ddl -- tag:inbox and to:[email protected] | |
notmuch tag +lknewbies -- tag:inbox and to:[email protected] | |
notmuch tag +anaconda -- tag:inbox and to:[email protected] | |
notmuch tag +gnome +ostree -- tag:inbox and to:[email protected] | |
notmuch tag +gnome +os -- tag:inbox and to:[email protected] | |
notmuch tag +notmuch -- tag:inbox and to:[email protected] | |
notmuch tag +lua -- tag:inbox and to:[email protected] | |
notmuch tag +webkit -- tag:inbox and to:[email protected] | |
notmuch tag +nginx -- tag:inbox and \( to:[email protected] or to:[email protected] \) | |
# Completely get rid of the Nginx SVN commit logs in the mailing list | |
notmuch tag +deleted -inbox -unread \ | |
-- tag:inbox and tag:nginx and 'subject:"[nginx] svn commit:"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -e | |
# Move Spam messages to re-train spam directory | |
while read -r filename ; do | |
[[ -r ${filename} ]] || continue | |
safecat ~/.mail/Spam.ReSpam/{tmp,cur} < "${filename}" | |
rm "${filename}" | |
done < <( notmuch search --output=files tag:spam ) | |
# Same, for ham | |
while read r filename ; do | |
[[ -r ${filename} ]] || continue | |
safecat ~/.mail/Spam.ReHam/{tmp,cur} < "${filename}" | |
rm "${filename}" | |
done < <( notmuch search --output=files tag:ham ) | |
notmuch new | |
# Delete "deleted" files | |
notmuch search --output=files tag:deleted | xargs -r rm -f | |
# Update database with info of moved files | |
notmuch new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment