mutt-wizard

fork of Luke Smiths mutt-wizard
git clone git://git.jakekoroman.com/mutt-wizard
Log | Files | Refs | README | LICENSE

commit 6e44eb50566004f654eacb53e748bb3ff753e31a
parent d890e0ea21d3617601a1e87bf3e95858c47e0cff
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Mon, 13 Feb 2023 18:15:45 -0500

stupid fix and cli feedback

Diffstat:
Mbin/mailsync | 8+++++---
Mbin/mw | 2+-
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/mailsync b/bin/mailsync @@ -63,9 +63,11 @@ syncandnotify() { "$HOME/.local/share/mail/$2/"[Ii][Nn][Bb][Oo][Xx]/cur/ \ -type f -newer "$lastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) - [ -z "$MAILSYNC_MUTE" ] && case 1 in - $((newcount > 0)) ) notify "$2" "$newcount" ;; - esac + case "$newcount" in + 0) echo "No new mail for $2." ;; + *) echo "$newcount new mail for $2." + [ -z "$MAILSYNC_MUTE" ] && notify "$2" "$newcount" ;; +esac } allaccounts="$(grep -hs "^\(Channel\|account\)" "$MBSYNCRC" "$MPOPRC")" diff --git a/bin/mw b/bin/mw @@ -21,7 +21,6 @@ notmuchtemp="$muttshare/notmuch-temp" # With the use of templates, it's impossible to use parameter substitution. # Therefore, some default variables that might be otherwise overwritten are set # here. -folder="$maildir/$fulladdr" iport="993" sport="465" imapssl="IMAPS" @@ -135,6 +134,7 @@ askinfo() { \ echo "$fulladdr is not a valid email address. Please retype the address:" read -r fulladdr done + folder="$maildir/$fulladdr" getaccounts; echo "$accounts" | grep -q "\s$fulladdr$" 2>/dev/null && { echo "$fulladdr has already been added" && exit 1 ;} { [ -z "$imap" ] || [ -z "$smtp" ] ;} && parsedomains