summaryrefslogtreecommitdiffhomepage
path: root/email.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-19 03:55:22 +0100
committerjao <jao@gnu.org>2021-04-19 03:55:22 +0100
commit02c12827e4dc38579ee6a1d895fecca14fbfb37e (patch)
tree7b7dcaf96ba2de6c2a4bdf2c044b8143119c7dd5 /email.org
parentd8ab09343f5eee14f9e0f104d809273c6d1eea18 (diff)
downloadelibs-02c12827e4dc38579ee6a1d895fecca14fbfb37e.tar.gz
elibs-02c12827e4dc38579ee6a1d895fecca14fbfb37e.tar.bz2
simpler and faster notmuch tagging scripts
Diffstat (limited to 'email.org')
-rw-r--r--email.org48
1 files changed, 22 insertions, 26 deletions
diff --git a/email.org b/email.org
index 60900d2..757073c 100644
--- a/email.org
+++ b/email.org
@@ -383,41 +383,37 @@
#+begin_src bash :tangle ./bin/notmuch-tags.sh :tangle-mode (identity #o755)
notmuch new > $HOME/var/log/notmuch.log 2>&1
- function tag_deleted {
- notmuch tag -inbox +deleted -- folder:$1 AND date:..3d AND NOT tag:flagged
+ function tag_expired {
+ notmuch tag +expired -- \
+ "'folder:\"$1\"'" \
+ AND date:..${2:-3d} AND NOT "tag:/flagged|unread|new/"
}
- for f in drivel lists reports deploys; do
- notmuch tag +bigml +$f -- tag:new AND folder:bigml/$f
- tag_deleted bigm/$f
- done;
-
- for f in inbox support; do
- notmuch tag +bigml +$f -- tag:new AND folder:bigml/$f
- done;
-
- for f in ~/var/mail/feeds/*; do
- f=$(basename $f)
- notmuch tag +feeds +$f -- tag:new AND folder:feeds/$f
- done
- tag_deleted "/feeds.+/"
-
- notmuch tag +jao -- tag:new AND folder:/jao.+/
+ function tag_folder {
+ notmuch tag +$1 +$2 -- tag:new AND folder:$1/$2
+ }
- for f in drivel lists books think; do
- notmuch tag +$f -- tag:new AND folder:jao/$f
- tag_deleted jao/$f
- done
+ function tag_directory {
+ for f in ~/var/mail/$1/*; do
+ tag_folder $1 $(basename $f);
+ done
+ }
- notmuch search --output=files --format=text0 tag:deleted | xargs -r0 rm
+ tag_directory bigml
+ tag_directory jao
+ tag_directory feeds
- notmuch new >> $HOME/var/log/notmuch.log 2>&1
- notmuch compact >> $HOME/var/log/notmuch.log 2>&1
+ tag_expired "/bigml.(drivel|lists|deploys|bugs)/" 3d
+ tag_expired "/bigml.reports/" 1d
+ tag_expired "/jao.(drivel|lists|books|think)/" 3d
+ tag_expired "/feeds.+/" 3d
+ tag_expired "/bigml.inbox$/" 1y
#+end_src
*** expire shell script
#+begin_src bash :tangle ./bin/notmuch-expire.sh :tangle-mode (identity #o755)
- notmuch search --output=files --format=text0 tag:deleted | xargs -r0 rm
+ notmuch search --output=files --format=text0 tag:expired | xargs -r0 rm
notmuch new > $HOME/var/log/notmuch-expire.log 2>&1
+ notmuch compact >> $HOME/var/log/notmuch-expire.log 2>&1
#+end_src
* gnus
*** notmuch -> gnus