summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/mailsync21
-rwxr-xr-xbin/mw1
-rw-r--r--share/domains.csv1
3 files changed, 12 insertions, 11 deletions
diff --git a/bin/mailsync b/bin/mailsync
index ece503e..fab980a 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -14,7 +14,7 @@
# Run only if user logged in (prevent cron errors)
pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;}
# Run only if not already running in other instance
-pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;}
+pidof -s mbsync >/dev/null && { echo "mbsync is already running." ; exit ;}
# First, we have to get the right variables for the mbsync file, the pass
# archive, notmuch and the GPG home. This is done by searching common profile
@@ -59,15 +59,16 @@ syncandnotify() {
if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi
new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null)
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
- if [ "$newcount" -gt "0" ]; then
- notify "$acc" "$newcount" &
- for file in $new; do
- # Extract subject and sender from mail.
- from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//')
- subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n')
- messageinfo &
- done
- fi
+ case 1 in
+ $((newcount > 5)) ) notify "$acc" "$newcount" ;;
+ $((newcount > 0)) ) notify "$acc" "$newcount"
+ for file in $new; do
+ # Extract subject and sender from mail.
+ from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//')
+ subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n')
+ messageinfo &
+ done ;;
+ esac
}
# Sync accounts passed as argument or all.
diff --git a/bin/mw b/bin/mw
index 2b5563f..b29e347 100755
--- a/bin/mw
+++ b/bin/mw
@@ -101,7 +101,6 @@ bind index gg first-entry
unmailboxes *
unalternates *
unset signature
-unmacro index o
$synccmd
" > "$accdir/$idnum-$fulladdr.muttrc"
diff --git a/share/domains.csv b/share/domains.csv
index 75c7763..622abcf 100644
--- a/share/domains.csv
+++ b/share/domains.csv
@@ -286,6 +286,7 @@ utas.edu.au,outlook.office365.com,993,smtp.office365.com,587
utdallas.edu,outlook.office365.com,993,smtp.office365.com,587
uw.edu,imap.gmail.com,993,smtp.gmail.com,465
uwcad.it,imap.gmail.com,993,smtp.gmail.com,465
+ux.uis.no,imap.ux.uis.no,993,broremann.ux.uis.no,25
uymail.com,imap.mail.com,993,smtp.mail.com,587
vip.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465
vivaldi.net,imap.vivaldi.net,993,smtp.vivaldi.net,587