diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-30 00:18:37 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-30 00:18:37 +0900 |
| commit | b747029e078f4295a795b39668a2ba1a437c99c5 (patch) | |
| tree | 64b44640402c673afe166a15df3b0e048634fa0e | |
| parent | 73191d1dcbb5574730e0f88e856470d32358126b (diff) | |
modified README.md, modified bin/mw, modified mw.1, modified share/mutt-wizard.muttrc
| -rw-r--r-- | README.md | 2 | ||||
| -rwxr-xr-x | bin/mw | 16 | ||||
| -rw-r--r-- | mw.1 | 2 | ||||
| -rw-r--r-- | share/mutt-wizard.muttrc | 9 |
4 files changed, 18 insertions, 11 deletions
@@ -129,7 +129,7 @@ To give you an example of the interface, here's an idea: - <kbd>l</kbd> - open mail, or attachment page or attachment - <kbd>m</kbd> - send mail (uses your default `$EDITOR` to write) - <kbd>M</kbd> and <kbd>C</kbd> - For <kbd>M</kbd>ove and <kbd>C</kbd>opy: follow them with one of the mailbox - letters above, i.e. <kbd>MS</kbd> means "move to Spam". + letters above, i.e. <kbd>Mp</kbd> means "move to Spam". - <kbd>p</kbd> - encrypt/sign your message (in compose view, before sending the email). - <kbd>r</kbd>/<kbd>R</kbd> - reply/reply all to highlighted mail - <kbd>s</kbd> - save selected mail or selected attachment @@ -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 @@ -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 <Tab> complete-query +macro index,pager ga "<change-folder>=Archive<enter>" "go to archive" +macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive" +macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive" macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox" macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox" macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox" macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts" macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts" macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts" +macro index,pager gp "<change-folder>=Spam<enter>" "go to spam" +macro index,pager Mp ";<save-message>=Spam<enter>" "move mail to spam" +macro index,pager Cp ";<copy-message>=Spam<enter>" "copy mail to spam" macro index,pager gj "<change-folder>=Junk<enter>" "go to junk" macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" @@ -88,9 +94,6 @@ macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash" macro index,pager gs "<change-folder>=Sent<enter>" "go to sent" macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent" macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent" -macro index,pager ga "<change-folder>=Archive<enter>" "go to archive" -macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive" -macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive" #set crypt_auto_sign = yes #set crypt_opportunistic_encrypt = yes |
