diff options
author | Amin Bandali <bandali@gnu.org> | 2018-11-26 00:03:39 -0500 |
---|---|---|
committer | Amin Bandali <bandali@gnu.org> | 2018-11-26 00:03:39 -0500 |
commit | 541ddfdfc3beb1345d75aaabd638c830ef4ed0e7 (patch) | |
tree | c4efbb1b92b3904af5ecfd7309a0e4215f4714ac | |
parent | 051074d65dac4696a91124dd08a47120a1cb1251 (diff) | |
download | configs-541ddfdfc3beb1345d75aaabd638c830ef4ed0e7.tar.gz configs-541ddfdfc3beb1345d75aaabd638c830ef4ed0e7.tar.xz configs-541ddfdfc3beb1345d75aaabd638c830ef4ed0e7.zip |
[rc/pigeonhole] update and slightly simplify the sieve rules a bit
-rw-r--r-- | rc.org | 74 |
1 files changed, 42 insertions, 32 deletions
@@ -2523,18 +2523,19 @@ prime_gpg_agent() #+end_src ** pigeonhole -*** gnu.sieve +*** amin.sieve :PROPERTIES: -:header-args+: :tangle ~/sieve/gnu.sieve :comments none +:header-args+: :tangle ~/mail/aminb.org/amin/sieve/amin.sieve :comments none :END: #+begin_src conf -require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ]; +require ["regex", "variables", "fileinto", "envelope", + "mailbox", "imap4flags", "include"]; +# webmasters if anyof ( - address :is "from" "webmasters@gnu.org", - address :is "from" "webmasters-comment@gnu.org") { - fileinto :create "webmasters"; + address :is "from" ["webmasters@gnu.org", "webmasters-comment@gnu.org"]) { + fileinto :create "gnu.webmasters"; stop; } @@ -2543,44 +2544,53 @@ include :personal "lists"; *** lists.sieve :PROPERTIES: -:header-args+: :tangle ~/sieve/lists.sieve :comments none +:header-args+: :tangle ~/mail/aminb.org/amin/sieve/lists.sieve :comments none :END: #+begin_src conf -require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", - "include" ]; +require ["regex", "variables", "fileinto", "envelope", + "mailbox", "imap4flags", "include"]; +# mailing lists if anyof ( - header :contains "list-id" "<emacs-devel.gnu.org>", - header :contains "list-id" "<emacs-orgmode.gnu.org>", - header :contains "list-id" "<emacsconf-discuss.gnu.org>", - header :contains "list-id" "<fencepost-users.gnu.org>", - header :contains "list-id" "<guix-devel.gnu.org>", - header :contains "list-id" "<guile-devel.gnu.org>", - header :contains "list-id" "<help-gnu-emacs.gnu.org>", - header :contains "list-id" "<info-gnu-emacs.gnu.org>", - header :contains "list-id" "<www-commits.gnu.org>", - header :contains "list-id" "<www-discuss.gnu.org>", - header :contains "list-id" "<deepspec.lists.cs.princeton.edu>", - header :contains "list-id" "<haskell-cafe.haskell.org>", - header :contains "list-id" "<haskell-art.we.lurk.org>", - header :contains "list-id" "<notmuch.notmuchmail.org>") { + header :contains "list-id" + [ "<emacs-devel.gnu.org>" + , "<emacs-orgmode.gnu.org>" + , "<emacsconf-discuss.gnu.org>" + , "<fencepost-users.gnu.org>" + , "<guix-devel.gnu.org>" + , "<guile-devel.gnu.org>" + , "<help-gnu-emacs.gnu.org>" + , "<info-gnu-emacs.gnu.org>" + , "<info-guix.gnu.org>" + , "<www-commits.gnu.org>" + , "<www-discuss.gnu.org>" + , "<deepspec.lists.cs.princeton.edu>" + , "<haskell-cafe.haskell.org>" + , "<haskell-art.we.lurk.org>" + , "<notmuch.notmuchmail.org>" + ] ) { if header :regex "list-id" "<([a-z_0-9-]+)[.@]" { set :lower "listname" "${1}"; - fileinto :create "l/${listname}"; + fileinto :create "gnu.${listname}"; + stop; } } +# sr.ht lists, with dots ('.') omitted if anyof ( - header :contains "list-id" "<~aminb/test-priv@lists.sr.ht>", - header :contains "list-id" "<~sircmpwn/sr.ht-admins@lists.sr.ht>", - header :contains "list-id" "<~sircmpwn/sr.ht-announce@lists.sr.ht>", - header :contains "list-id" "<~sircmpwn/sr.ht-dev@lists.sr.ht>", - header :contains "list-id" "<~sircmpwn/sr.ht-discuss@lists.sr.ht>") { - if header :regex "list-id" "(~[a-z_0-9-]+)/([a-z_0-9.-]+)@" { + header :contains "list-id" + [ "<~bandali/public-inbox@lists.sr.ht>" + , "<~sircmpwn/sr.ht-admins@lists.sr.ht>" + , "<~sircmpwn/sr.ht-announce@lists.sr.ht>" + , "<~sircmpwn/sr.ht-dev@lists.sr.ht>" + , "<~sircmpwn/sr.ht-discuss@lists.sr.ht>" + ] ) { + if header :regex "list-id" "(~[a-z_0-9-]+)/([^.]*)\\.?([^.]*)\\.?([^.]*)\\.?([^.]*)\\.?([^.]*)\\.?([^.]*)@" { set :lower "username" "${1}"; - set :lower "listname" "${2}"; - fileinto :create "l/${username}/${listname}"; + set :lower "listname" "${2}${3}${4}${5}${6}${7}"; + fileinto :create "gnu.${username}.${listname}"; + stop; } } #+end_src |