summaryrefslogtreecommitdiffhomepage
path: root/email.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-06-12 00:27:18 +0100
committerjao <jao@gnu.org>2021-06-12 00:27:18 +0100
commitb07dfdd2c5b67ee28cbe967ea5d2ebcb5081e35a (patch)
tree7f19220907b838eaf3a4bedec928bce6d7341f5e /email.org
parent50d28f2ec1274feb43a5bc6dfb84ebbf140b619b (diff)
downloadelibs-b07dfdd2c5b67ee28cbe967ea5d2ebcb5081e35a.tar.gz
elibs-b07dfdd2c5b67ee28cbe967ea5d2ebcb5081e35a.tar.bz2
mail scripts
Diffstat (limited to 'email.org')
-rw-r--r--email.org19
1 files changed, 17 insertions, 2 deletions
diff --git a/email.org b/email.org
index 8b86842..2f62ca6 100644
--- a/email.org
+++ b/email.org
@@ -251,7 +251,7 @@
#+begin_src emacs-lisp
(defun jao-list-mailboxes (base)
(let ((dir (expand-file-name base "~/var/mail")))
- (seq-difference (directory-files dir) '("." ".." "sent" "trash"))))
+ (seq-difference (directory-files dir) '("." ".." "sent" "trash" "spam"))))
#+end_src
* consult narrowing
#+begin_src emacs-lisp
@@ -812,9 +812,23 @@
tag_list mailutils bug-mailutils -lists
tag_list feeds Lobsters +programming -lists
#+end_src
+*** move shell script
+ #+begin_src bash :shebang "#!/bin/bash" :tangle ./bin/notmuch-move.sh :tangle-mode (identity #o755)
+ # Move a message file while removing its UID-part
+ function safe_move { s=${1##*/}; s=${s%%,*}; mv -f $1 $2/$s; }
+ function move_spam {
+ for i in $(notmuch search --output=files \
+ tag:spam and tag:$1 AND NOT folder:$1/spam); do
+ safe_move $i ~/var/mail/$1/spam/cur
+ done
+ }
+
+ move_spam jao
+ move_spam bigml
+ notmuch new >/dev/null
+ #+end_src
*** expiry shell script
#+begin_src bash :shebang "#!/bin/bash" :tangle ./bin/notmuch-expire.sh :tangle-mode (identity #o755)
-
spared_tags="tag:\"/^(trove|new|flagged|unread|draft|gmane)$/\""
function tag_deleted {
@@ -826,6 +840,7 @@
tag_deleted "tag:bigml AND tag:support" 7d
tag_deleted "tag:jao and tag:\"/^(drivel|lists|books|think|local)$/\"" 3d
tag_deleted "tag:feeds" 3d
+ tag_deleted "tag:spam and folder:/spam/" 3d
notmuch new > $HOME/var/log/notmuch-expire.log 2>&1
notmuch compact >> $HOME/var/log/notmuch-expire.log 2>&1