summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2021-09-23 13:19:39 -0400
committerGitHub <noreply@github.com>2021-09-23 13:19:39 -0400
commita1a6b60217fcc0ac02421453df9953d149d95068 (patch)
treee02beaf05132d4bdfda6380920bf914bce5eb625 /bin
parente8458ace20a1e553df1c6249b9ef27234dd2aafd (diff)
parent4e92252dc2e8d67e759d0a67f069035b5355d855 (diff)
Merge pull request #719 from epsilon-0/master
allow dynamically loading available mailboxes
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mw5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/mw b/bin/mw
index 2b9a41a..544d511 100755
--- a/bin/mw
+++ b/bin/mw
@@ -224,11 +224,12 @@ getboxes() { if [ -n "${force+x}" ] ; then
else
info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")"
[ -z "$info" ] && echo "Log-on not successful." && return 1
- mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d ' ')"
+ mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '
+')"
fi
[ "$type" = "pop" ] && mailboxes="INBOX"
getaccounts; for x in $(seq 1 9); do echo "$accounts" | grep -q "^$x:" || { export idnum="$x"; break ;}; done
- toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' - )"
+ toappend="mailboxes \`mdir=$maildir/$fulladdr/; find \$mdir -mindepth 1 -type d -name cur | sed -e 's:/cur\$:\":' -e \"s:\$mdir:\\\"=:\" | sort | tr '\\\n' ' '\`"
IFS='
'
for x in $mailboxes; do