summaryrefslogtreecommitdiff
path: root/bin/readmail
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2025-11-27 17:35:42 -0500
committerSam Nystrom <sam@samnystrom.dev>2025-11-27 17:35:42 -0500
commit77b295b8b0f9b73ecbda809e7843812c5f4c3737 (patch)
treebd4dffb07ab4a55e40bd6d6a06e3d0e27dede598 /bin/readmail
parentb83a4973d6979c6c05d2a0af2c806d786f346545 (diff)
update
Diffstat (limited to 'bin/readmail')
-rwxr-xr-xbin/readmail24
1 files changed, 21 insertions, 3 deletions
diff --git a/bin/readmail b/bin/readmail
index 1643706..5466088 100755
--- a/bin/readmail
+++ b/bin/readmail
@@ -5,15 +5,33 @@ dir=~/mail/"${1:-INBOX}"
while true; do
mlist "$dir" | msort -dr | mseq -S | MBLAZE_PAGER=cat mscan
read -r addr cmd || break
+ if [ -z "$cmd" ]; then
+ cmd="$addr"
+ addr=.
+ fi
case "$cmd" in
- g) mbsync primary >/dev/null 2>&1 && minc ~/mail/* >/dev/null ;;
- c) mseq -C "$addr" ;;
+ g) mbsync primary && minc ~/mail/* >/dev/null ;;
+ C) mseq -C "$addr" ;;
+ c*) dir=~/mail/"${cmd#c}" ;;
s) mshow "$addr" && mflag -S "$addr" >/dev/null ;;
a) mrefile "$addr" ~/mail/Archive ;;
m*) mrefile "$addr" ~/mail/"${cmd#m}" ;;
f*) mflag -"${cmd#f}" "$addr" >/dev/null ;;
+ h)
+ echo 'Commands:'
+ echo 'g - fetch mail'
+ echo 'C - set the sequence to messages'
+ echo 'cFOLDER - cd to FOLDER'
+ echo 's - show messages'
+ echo 'a - archive messages'
+ echo 'mFOLDER - move messages to FOLDER'
+ echo 'fFLAGS - set FLAGS on messages. Uppercase sets, lowercase unsets.'
+ echo ' d=draft, f=flagged, p=passed, r=replied, s=seen, t=trashed.'
+ echo 'h - print this message'
+ echo
+ ;;
q) break ;;
esac
done
echo 'Syncing changes...'
-mbsync primary >/dev/null 2>&1
+mbsync primary