From 294c756468d6fe37ed9fae29eab0d9d1785686e1 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Wed, 17 Mar 2021 09:59:47 +0100 Subject: [PATCH] don't sync drafts & ignore Koen's internals --- services/mailsync/run | 9 +++++---- services/sfeed/run | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/services/mailsync/run b/services/mailsync/run index afd944f..7c6f196 100755 --- a/services/mailsync/run +++ b/services/mailsync/run @@ -6,9 +6,9 @@ export DISPLAY=":0" set -e # Split outbox emails -mlist /data/mail/outbox | mpick -t 'from =~~ "posteo"' | mflag -F | mrefile /data/mail/posteo/Sent -mlist /data/mail/outbox | mpick -t 'from =~~ "ugent"' | mflag -F | mrefile /data/mail/ugent/Sent -mlist /data/mail/outbox | mpick -t 'from =~~ "gmail"' | mflag -F | mrefile /data/mail/gmail/Sent +mlist -d /data/mail/outbox | mpick -t 'from =~~ "posteo"' | mflag -F | mrefile /data/mail/posteo/Sent +mlist -d /data/mail/outbox | mpick -t 'from =~~ "ugent"' | mflag -F | mrefile /data/mail/ugent/Sent +mlist -d /data/mail/outbox | mpick -t 'from =~~ "gmail"' | mflag -F | mrefile /data/mail/gmail/Sent # check for internet connection ip route ls | grep -q '.' @@ -26,6 +26,7 @@ fi # Incorporate new mails and store them in the temp sequence s="$(mktemp)" +trap "rm '$s'" EXIT KILL minc $(mdirs /data/mail) > "$s" { @@ -40,7 +41,7 @@ minc $(mdirs /data/mail) > "$s" mpick -t 'to =~ "dodona@ugent.be" && subject =~ "internal error"' < "$s" \ | xargs grep -E -l 'course_id: (284|317|335|339|346|349|355|359|374|375|376|380|384|414)' mpick -t 'to =~ "dodona@ugent.be" && subject =~ "internal error"' < "$s" \ - | xargs grep -E -l 'user_id: 3' + | xargs grep -E -l 'user_id: (3|7078)' mpick -t 'subject =~ "\[hackers\] \[slstatus\]"' < "$s" mpick -t 'from =~ "dependabot-preview"' < "$s" diff --git a/services/sfeed/run b/services/sfeed/run index 1bae06f..00cf5df 100755 --- a/services/sfeed/run +++ b/services/sfeed/run @@ -13,11 +13,12 @@ pgrep gpg-agent > /dev/null # Find new messages in feeds d="$(mktemp -d)" +trap "rm -rf '$d'" EXIT KILL mmkdir "$d" sfeed_update > /dev/null 2>&1 sfeed_mbox ~/.sfeed/feeds/* | mdeliver -M -v "$d" | while read mail; do if ! mlist /data/mail/feeds | magrep -q message-id:"$(mshow -qh message-id "$mail" | cut -d' ' -f2)"; then - mdeliver -X F /data/mail/feeds < "$mail" > /dev/null + mdeliver /data/mail/feeds < "$mail" > /dev/null fi done rm -rf "$d"