mail sync
This commit is contained in:
parent
a2749b3cae
commit
0c05b94504
1 changed files with 28 additions and 0 deletions
28
.config/mail/mail-sync.sh##hostname.dbox
Executable file
28
.config/mail/mail-sync.sh##hostname.dbox
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
PIPE="/tmp/email_refresh_pipe"
|
||||||
|
|
||||||
|
# Create pipe if doesn't exist
|
||||||
|
[ -p "$PIPE" ] || mkfifo "$PIPE"
|
||||||
|
|
||||||
|
MBSYNC=$(pgrep mbsync)
|
||||||
|
NOTMUCH=$(pgrep notmuch)
|
||||||
|
|
||||||
|
if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
|
||||||
|
echo "Already running one instance of mbsync or notmuch. Exiting..."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# echo "Deleting messages tagged as *deleted*"
|
||||||
|
# notmuch search --format=text0 --output=files tag:deleted | xargs -0 --no-run-if-empty rm -v
|
||||||
|
|
||||||
|
# sync mailbox with external servers
|
||||||
|
mbsync -Va
|
||||||
|
# apply tag:new to new mail
|
||||||
|
notmuch new
|
||||||
|
# new mail tagging pipeline
|
||||||
|
afew --tag --new
|
||||||
|
# signal waybar indicator update
|
||||||
|
echo "refresh" > "$PIPE"
|
||||||
|
# generate new ranked addressbook
|
||||||
|
maildir-rank-addr
|
Loading…
Add table
Add a link
Reference in a new issue