fix: Support mbsync options passed to mailsync (#414)
This commit is contained in:
parent
7c980ec6fb
commit
2698a4358c
@ -28,7 +28,7 @@ fi
|
|||||||
# Check account for new mail. Notify if there is new content.
|
# Check account for new mail. Notify if there is new content.
|
||||||
syncandnotify() {
|
syncandnotify() {
|
||||||
acc="$(echo "$account" | sed "s/.*\///")"
|
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)
|
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)
|
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
|
||||||
if [ "$newcount" -gt "0" ]; then
|
if [ "$newcount" -gt "0" ]; then
|
||||||
@ -46,6 +46,9 @@ syncandnotify() {
|
|||||||
if [ "$#" -eq "0" ]; then
|
if [ "$#" -eq "0" ]; then
|
||||||
accounts="$(awk '/^Channel/ {print $2}' "$HOME/.mbsyncrc")"
|
accounts="$(awk '/^Channel/ {print $2}' "$HOME/.mbsyncrc")"
|
||||||
else
|
else
|
||||||
|
for arg in "$@"; do
|
||||||
|
[ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1
|
||||||
|
done
|
||||||
accounts=$*
|
accounts=$*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user