don't sync drafts & ignore Koen's internals

This commit is contained in:
Felix Van der Jeugt 2021-03-17 09:59:47 +01:00
parent 1f4788fb03
commit 294c756468
No known key found for this signature in database
GPG Key ID: 58B209295023754D
2 changed files with 7 additions and 5 deletions

View File

@ -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"

View File

@ -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"