From b747029e078f4295a795b39668a2ba1a437c99c5 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 30 Jan 2025 00:18:37 +0900 Subject: modified README.md, modified bin/mw, modified mw.1, modified share/mutt-wizard.muttrc --- README.md | 2 +- bin/mw | 16 ++++++++++------ mw.1 | 2 +- share/mutt-wizard.muttrc | 9 ++++++--- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 492ba1e..16c9439 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ To give you an example of the interface, here's an idea: - l - open mail, or attachment page or attachment - m - send mail (uses your default `$EDITOR` to write) - M and C - For Move and Copy: follow them with one of the mailbox - letters above, i.e. MS means "move to Spam". + letters above, i.e. Mp means "move to Spam". - p - encrypt/sign your message (in compose view, before sending the email). - r/R - reply/reply all to highlighted mail - s - save selected mail or selected attachment diff --git a/bin/mw b/bin/mw index f7adda5..73ee64b 100755 --- a/bin/mw +++ b/bin/mw @@ -48,11 +48,15 @@ for x in "/etc/ssl/certs/ca-certificates.crt" \ done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1; } basicdir() { - mailboxes="$(printf "Archive\\nINBOX\\nDrafts\\nSent\\nJunk\\nTrash")" - maildirs="$(echo "$mailboxes" | sed "s/^/{/;s/$/}/" | paste -sd ',' -)" + mailboxes="$(printf "Archive\\nINBOX\\nDrafts\\nSent\\nSpam\\nJunk\\nTrash")" + maildirs="$(echo "$mailboxes" | sed "s/ /,/g")" contents="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/;s/'/\\\'/g" | paste -sd ' ' -)" - for file in "$accdir/"*.muttrc; do - [ -f "$file" ] && grep -q "mailboxes" "$file" && sed -i "s/mailboxes.*/$contents/g" "$file" 2>/dev/null && mkdir -p "$maildir/${file##*/}/$maildirs" + for mailacc in "$accdir/"*.muttrc; do + acc="${mailacc##*/}" + [ -f "$acc" ] && grep -q "mailboxes" "$acc" && sed -i "s/mailboxes.*/$contents/g" "$mailacc" 2>/dev/null && + for dir in $maildirs; do + mkdir -p "$maildir/${acc%.*}/$dir" + done done } @@ -239,12 +243,12 @@ done; } getboxes() { if [ -n "${force+x}" ]; then - mailboxes="$(printf "Archive\\nINBOX\\nDrafts\\nSent\\nJunk\\nTrash")" + mailboxes="$(printf "Archive\\nINBOX\\nDrafts\\nSent\\nSpam\\nJunk\\nTrash")" else info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "mail/$passprefix$fulladdr" | head -1)" --url "${protocol:-imaps}://$imap:${iport:-993}")" [ -z "$info" ] && errorexit unsorted_mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')" - desired_order="Archive INBOX Drafts Sent Junk Trash" + desired_order="Archive INBOX Drafts Sent Spam Junk Trash" mailboxes="" for desired in $desired_order; do if echo "$unsorted_mailboxes" | grep -qx "$desired"; then diff --git a/mw.1 b/mw.1 index aaf63ea..06cd2df 100644 --- a/mw.1 +++ b/mw.1 @@ -269,7 +269,7 @@ to find contacts matching your input. Although abook is often used with mutt, it .B Switching and moving mail between mailboxes The .I g -key can be paired with several other keys to automatically move to another mailbox: gi: Inbox; gs: Sent; gd: Drafts; ga: Archive; gS: Spam; gj: Junk; gt: Trash. These bindings will only be present for accounts that have the boxes in question. Instead of +key can be paired with several other keys to automatically move to another mailbox: gi: Inbox; gs: Sent; gd: Drafts; ga: Archive; gp: Spam; gj: Junk; gt: Trash. These bindings will only be present for accounts that have the boxes in question. Instead of .I g, you can also press .I C diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 19dfcc7..c145614 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -73,12 +73,18 @@ bind pager \031 previous-line # Mouse wheel bind pager \005 next-line # Mouse wheel bind editor complete-query +macro index,pager ga "=Archive" "go to archive" +macro index,pager Ma ";=Archive" "move mail to archive" +macro index,pager Ca ";=Archive" "copy mail to archive" macro index,pager gi "=INBOX" "go to inbox" macro index,pager Mi ";=INBOX" "move mail to inbox" macro index,pager Ci ";=INBOX" "copy mail to inbox" macro index,pager gd "=Drafts" "go to drafts" macro index,pager Md ";=Drafts" "move mail to drafts" macro index,pager Cd ";=Drafts" "copy mail to drafts" +macro index,pager gp "=Spam" "go to spam" +macro index,pager Mp ";=Spam" "move mail to spam" +macro index,pager Cp ";=Spam" "copy mail to spam" macro index,pager gj "=Junk" "go to junk" macro index,pager Mj ";=Junk" "move mail to junk" macro index,pager Cj ";=Junk" "copy mail to junk" @@ -88,9 +94,6 @@ macro index,pager Ct ";=Trash" "copy mail to trash" macro index,pager gs "=Sent" "go to sent" macro index,pager Ms ";=Sent" "move mail to sent" macro index,pager Cs ";=Sent" "copy mail to sent" -macro index,pager ga "=Archive" "go to archive" -macro index,pager Ma ";=Archive" "move mail to archive" -macro index,pager Ca ";=Archive" "copy mail to archive" #set crypt_auto_sign = yes #set crypt_opportunistic_encrypt = yes -- cgit v1.2.3