mail: add tag

This commit is contained in:
Pavel Korytov 2024-06-10 01:11:56 +03:00
parent a86c7a79e5
commit e22e2cb416
4 changed files with 18 additions and 13 deletions

View file

@ -1,27 +1,28 @@
# [[file:Mail.org::*Config][Config:1]] # [[file:Mail.org::*Config][Config:2]]
[database] [database]
path=/home/pavel/Mail path=/home/pavel/Mail
# Config:1 ends here # Config:2 ends here
# [[file:Mail.org::*Config][Config:2]] # [[file:Mail.org::*Config][Config:3]]
[user] [user]
name=Pavel Korytov name=Pavel Korytov
primary_email=thexcloud@gmail.com primary_email=thexcloud@gmail.com
other_email=progin6304@gmail.com;pvkorytov@etu.ru other_email=progin6304@gmail.com;pvkorytov@etu.ru
# Config:2 ends here
# [[file:Mail.org::*Config][Config:3]]
[new]
tags=new;
ignore=.osync_workdir;.mbsyncstate;.uidvalidity;.lock;/.*gmailieer\.json.*/
# Config:3 ends here # Config:3 ends here
# [[file:Mail.org::*Config][Config:4]] # [[file:Mail.org::*Config][Config:4]]
[search] [new]
exclude_tags=trash;spam; tags=new;
# ignore=.osync_workdir;.mbsyncstate;.uidvalidity;.lock;/.*gmailieer\.json.*/
ignore=/.*[.](json|lock|bak|osync_workdir|mbsyncstate|uidvalidity)$/
# Config:4 ends here # Config:4 ends here
# [[file:Mail.org::*Config][Config:5]] # [[file:Mail.org::*Config][Config:5]]
[search]
exclude_tags=trash;spam;
# Config:5 ends here
# [[file:Mail.org::*Config][Config:6]]
[maildir] [maildir]
synchronize_flags=true synchronize_flags=true
# Config:5 ends here # Config:6 ends here

View file

@ -192,6 +192,7 @@ So, here are the rules which match tags & folders:
| job.digital.testers | Job_Digital.Testers | | job.digital.testers | Job_Digital.Testers |
| job.moevm | Job_Moevm | | job.moevm | Job_Moevm |
| etu | Etu | | etu | Etu |
| etu.grad-school | Etu.Grad_School |
And below is a noweb function, which generates the following commands for notmuch to execute: And below is a noweb function, which generates the following commands for notmuch to execute:
- /before/ sync: - /before/ sync:

View file

@ -29,6 +29,8 @@ notmuch tag +job.moevm "path:pvkorytov_etu/Job_Moevm/cur/** AND NOT tag:job.moev
notmuch tag -job.moevm "NOT path:pvkorytov_etu/Job_Moevm/cur/** AND tag:job.moevm AND tag:pvkorytov" notmuch tag -job.moevm "NOT path:pvkorytov_etu/Job_Moevm/cur/** AND tag:job.moevm AND tag:pvkorytov"
notmuch tag +etu "path:pvkorytov_etu/Etu/cur/** AND NOT tag:etu" notmuch tag +etu "path:pvkorytov_etu/Etu/cur/** AND NOT tag:etu"
notmuch tag -etu "NOT path:pvkorytov_etu/Etu/cur/** AND tag:etu AND tag:pvkorytov" notmuch tag -etu "NOT path:pvkorytov_etu/Etu/cur/** AND tag:etu AND tag:pvkorytov"
notmuch tag +etu.grad-school "path:pvkorytov_etu/Etu.Grad_School/cur/** AND NOT tag:etu.grad-school"
notmuch tag -etu.grad-school "NOT path:pvkorytov_etu/Etu.Grad_School/cur/** AND tag:etu.grad-school AND tag:pvkorytov"
echo "Post-new filters done" echo "Post-new filters done"
notmuch tag -new "tag:new" notmuch tag -new "tag:new"
# =post_new=:2 ends here # =post_new=:2 ends here

View file

@ -16,7 +16,8 @@ notmuch search --output=files "NOT path:pvkorytov_etu/Job_Digital.Applicants/cur
notmuch search --output=files "NOT path:pvkorytov_etu/Job_Digital.Testers/cur/** AND tag:job.digital.testers AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Job_Digital.Testers/cur/ notmuch search --output=files "NOT path:pvkorytov_etu/Job_Digital.Testers/cur/** AND tag:job.digital.testers AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Job_Digital.Testers/cur/
notmuch search --output=files "NOT path:pvkorytov_etu/Job_Moevm/cur/** AND tag:job.moevm AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Job_Moevm/cur/ notmuch search --output=files "NOT path:pvkorytov_etu/Job_Moevm/cur/** AND tag:job.moevm AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Job_Moevm/cur/
notmuch search --output=files "NOT path:pvkorytov_etu/Etu/cur/** AND tag:etu AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Etu/cur/ notmuch search --output=files "NOT path:pvkorytov_etu/Etu/cur/** AND tag:etu AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Etu/cur/
notmuch search --output=files "NOT path:pvkorytov_etu/Archive/cur/** AND NOT tag:inbox AND NOT tag:sent AND NOT tag:spam AND NOT tag:trash AND NOT tag:job.digital AND NOT tag:job.digital.docs AND NOT tag:job.digital.support AND NOT tag:job.digital.superservice AND NOT tag:job.digital.applicants AND NOT tag:job.digital.testers AND NOT tag:job.moevm AND NOT tag:etu AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Archive/cur/ notmuch search --output=files "NOT path:pvkorytov_etu/Etu.Grad_School/cur/** AND tag:etu.grad-school AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Etu.Grad_School/cur/
notmuch search --output=files "NOT path:pvkorytov_etu/Archive/cur/** AND NOT tag:inbox AND NOT tag:sent AND NOT tag:spam AND NOT tag:trash AND NOT tag:job.digital AND NOT tag:job.digital.docs AND NOT tag:job.digital.support AND NOT tag:job.digital.superservice AND NOT tag:job.digital.applicants AND NOT tag:job.digital.testers AND NOT tag:job.moevm AND NOT tag:etu AND NOT tag:etu.grad-school AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu/Archive/cur/
echo "Pre-new filters done" echo "Pre-new filters done"
parallel --link -j0 "(cd /home/pavel/Mail/{1}/ && {2} {3})" ::: thexcloud progin6304 pvkorytov_etu ::: "$GMI" "$GMI" "offlineimap" ::: sync sync "" parallel --link -j0 "(cd /home/pavel/Mail/{1}/ && {2} {3})" ::: thexcloud progin6304 pvkorytov_etu ::: "$GMI" "$GMI" "offlineimap" ::: sync sync ""