WIP: [mail] feat: add filters
This commit is contained in:
parent
9e44d0ac41
commit
f706ab9586
27
.config/notmuch/default/hooks/pre-sync.sh
Executable file
27
.config/notmuch/default/hooks/pre-sync.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Archive files that are NOT tagged Inbox
|
||||
accounts="david.julien@univ-nantes.fr"
|
||||
|
||||
# Update paths & tags
|
||||
notmuch new --no-hooks
|
||||
|
||||
filter() {
|
||||
notmuch search --output=files --format=text0 $parameters and tag:new| xargs -0 --no-run-if-empty mv -t "$XDG_DATA_HOME/mail/$account/$tag/new/"
|
||||
notmuch search --output=files --format=text0 $parameters and not tag:new| xargs -0 --no-run-if-empty mv -t "$XDG_DATA_HOME/mail/$account/$tag/cur/"
|
||||
}
|
||||
|
||||
for account in $accounts
|
||||
do
|
||||
tags_location="$XDG_CONFIG_HOME/notmuch/tags/$account"
|
||||
tags="$(grep "+" "$tags_location" | sed -e 's/^.//' -e 's/ .*//')"
|
||||
for tag in $tags
|
||||
do
|
||||
[ "univ" = $tag ] && continue
|
||||
parameters="folder:$account/INBOX and tag:$tag"
|
||||
filter
|
||||
done
|
||||
done
|
||||
|
||||
# Update paths
|
||||
notmuch new --no-hooks
|
18
.config/notmuch/tags/david.julien@univ-nantes.fr
Normal file
18
.config/notmuch/tags/david.julien@univ-nantes.fr
Normal file
@ -0,0 +1,18 @@
|
||||
# vim: filetype=none
|
||||
|
||||
# !filters will be applied top to bottom
|
||||
|
||||
# mailbox
|
||||
+univ -- to:david.julien@univ-nantes.fr or to:david.julien@ls2n.fr
|
||||
|
||||
+teaching/X11I020 -- subject:x11i020
|
||||
+teaching/X11I040 -- subject:x11i040
|
||||
|
||||
+publications -- subject:[hal]
|
||||
+forge -- from:gitlab@univ-nantes.fr
|
||||
|
||||
+velo -- subject:[ls2n-velo]
|
||||
+login -- from:login@univ-nantes.fr
|
||||
|
||||
+admin -- from:virginie.dupont or from alexiane.brard or from emmanuelle.sale
|
||||
+thesis -- from:benoit.delahaye or from:guillaume.cantin or from:gilles.ardourel
|
Reference in New Issue
Block a user