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"