diff options
author | Luke Smith <luke@lukesmith.xyz> | 2020-04-18 10:47:45 -0400 |
---|---|---|
committer | Luke Smith <luke@lukesmith.xyz> | 2020-04-18 10:47:45 -0400 |
commit | 86ffbe9b90a90bd06a09b66be6eb26778f4c459e (patch) | |
tree | 88d64bde40af632f31c19cecb09ae99e333e583f /bin/mailsync | |
parent | 946abe8f5fc97524cb58b8049bf2b37e71f55901 (diff) | |
parent | 2698a4358c4747033b9c4dde3142d898e8c2004f (diff) |
Merge branch 'master' of github.com:LukeSmithxyz/mutt-wizard
Diffstat (limited to 'bin/mailsync')
-rwxr-xr-x | bin/mailsync | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/mailsync b/bin/mailsync index fc35ede..3104c65 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -30,7 +30,7 @@ fi # Check account for new mail. Notify if there is new content. syncandnotify() { acc="$(echo "$account" | sed "s/.*\///")" - mbsync "$acc" + mbsync $opts "$acc" 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 "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) if [ "$newcount" -gt "0" ]; then @@ -48,6 +48,9 @@ syncandnotify() { if [ "$#" -eq "0" ]; then accounts="$(awk '/^Channel/ {print $2}' "$HOME/.mbsyncrc")" else + for arg in "$@"; do + [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 + done accounts=$* fi |