diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-26 03:22:39 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-26 03:22:39 +0900 |
| commit | 3dd247dfecb46356e25925e9c4e9fd2d7b40d1e7 (patch) | |
| tree | 5a2524ad9ef8fca79e79e0146d4976aaa06ff107 | |
| parent | d632784098ab7d03e287074f01a47495683e4444 (diff) | |
updates
| -rw-r--r-- | README.md | 1 | ||||
| -rwxr-xr-x | bin/mw | 22 | ||||
| -rw-r--r-- | completion/_mutt-wizard.zsh | 1 | ||||
| -rw-r--r-- | share/mbsync-temp | 2 | ||||
| -rw-r--r-- | share/mpop-temp | 2 | ||||
| -rw-r--r-- | share/msmtp-temp | 2 | ||||
| -rw-r--r-- | share/online-temp | 2 |
7 files changed, 18 insertions, 14 deletions
@@ -108,6 +108,7 @@ The mutt-wizard runs via the command `mw`. Once setup is complete, you'll use connecting online at all. - `-o` -- Configure mutt for an account, but do not keep mail offline. - `-p` -- Use POP protocol instead of IMAP (requires `mpop` installed). +- `-X` -- Delete an account's local email too when deleting with -d/-D. - `mailsync` gives visual messages of new mail by default. Or, set `MAILSYNC_MUTE=1` as an environmental variable if you prefer not having them. @@ -60,7 +60,7 @@ checkbasics() { command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" PASSWORD_STORE_DIR="${PASSWORD_STORE_DIR:-$HOME/.password-store}" [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] || { - echo "First run \`pass init mail/mutt/<yourgpgemail>\` to set up a password archive." + echo "First run \`pass init mail/<yourgpgemail>\` to set up a password archive." echo "(If you don't already have a GPG key pair, first run \`$GPG --full-generate-key\`.)" exit 1 } @@ -179,7 +179,7 @@ delete() { rm -f "$msmtprc"bu sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 2>/dev/null rm -f "$mpoprc"bu - pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1 + pass rm -f "mail/$passprefix$fulladdr" >/dev/null 2>&1 [ -n "${purge+x}" ] && safename="$(echo $fulladdr | sed 's/@/_/g')" && rm -rf "${cachedir:?}/${safename:?}" "${maildir:?}/${fulladdr:?}" } @@ -206,15 +206,15 @@ askinfo() { [ -z "$passprefix" ] && passprefix="" hostname="${fulladdr#*@}" login="${login:-$fulladdr}" - if [ -n "${password+x}" ] && [ ! -f "$PASSWORD_STORE_DIR/mail/mutt/$passprefix$fulladdr.gpg" ]; then + if [ -n "${password+x}" ] && [ ! -f "$PASSWORD_STORE_DIR/mail/$passprefix$fulladdr.gpg" ]; then insertpass - elif [ ! -f "$PASSWORD_STORE_DIR/mail/mutt/$passprefix$fulladdr.gpg" ]; then + elif [ ! -f "$PASSWORD_STORE_DIR/mail/$passprefix$fulladdr.gpg" ]; then getpass fi } insertpass() { - printf "%s" "$password" | pass insert -fe "$PASSWORD_STORE_DIR/mail/mutt/$passprefix$fulladdr" + printf "%s" "$password" | pass insert -fe "$PASSWORD_STORE_DIR/mail/$passprefix$fulladdr" } errorexit() { @@ -233,15 +233,15 @@ Please be sure you either enable third-party applications, or create an app-spec } getpass() { while :; do - pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1 - pass insert -f "$passprefix$fulladdr" && break + pass rm -f "mail/$passprefix$fulladdr" >/dev/null 2>&1 + pass insert -f "mail/$passprefix$fulladdr" && break done; } getboxes() { if [ -n "${force+x}" ]; then mailboxes="$(printf "Archive\\nINBOX\\nDrafts\\nSent\\nJunk\\nTrash")" else - info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")" + 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" @@ -334,12 +334,14 @@ Options allowed with -a: -s SMTP server address -S SMTP server port -x Password for account (recommended to be in double quotes) - -X Delete an account's local email too when deleting + +Options allowed with -d/-D: + -X Delete an account's local email too when deleting NOTE: Once at least one account is added, you can run \`mbsync -a\` to begin downloading mail. -To change an account's password, run \`pass edit '(pass prefix with -P option)'your@email.com\`. +To change an account's password, run \`pass edit 'mail/(pass prefix with -P option)'your@email.com\`. EOF } diff --git a/completion/_mutt-wizard.zsh b/completion/_mutt-wizard.zsh index 6038323..9b04c74 100644 --- a/completion/_mutt-wizard.zsh +++ b/completion/_mutt-wizard.zsh @@ -19,6 +19,7 @@ case "$state" in '-y:Sync mail for account by name' '-Y:Sync mail for all accounts' '-u:Show a registered email account information' + '-X:Delete an account"'"s local email too when deleting' ) _describe 'flags' opts ;; diff --git a/share/mbsync-temp b/share/mbsync-temp index 4e19bd8..8700a0a 100644 --- a/share/mbsync-temp +++ b/share/mbsync-temp @@ -2,7 +2,7 @@ IMAPStore $fulladdr-remote Host $imap Port $iport User $login -PassCmd "pass mail/mutt/$passprefix$fulladdr" +PassCmd "pass mail/$passprefix$fulladdr" AuthMechs LOGIN TLSType $imapssl CertificateFile $sslcert diff --git a/share/mpop-temp b/share/mpop-temp index 63210fb..7069c2e 100644 --- a/share/mpop-temp +++ b/share/mpop-temp @@ -5,4 +5,4 @@ host $imap port $iport timeout 10 delivery maildir $maildir/$fulladdr/INBOX -passwordeval pass mail/mutt/$passprefix$fulladdr +passwordeval pass mail/$passprefix$fulladdr diff --git a/share/msmtp-temp b/share/msmtp-temp index 81f4950..74173db 100644 --- a/share/msmtp-temp +++ b/share/msmtp-temp @@ -3,7 +3,7 @@ host $smtp port $sport from $fulladdr user $login -passwordeval "pass mail/mutt/$passprefix$fulladdr" +passwordeval "pass mail/$passprefix$fulladdr" auth on tls on tls_trust_file $sslcert diff --git a/share/online-temp b/share/online-temp index 5fd385c..c293b2a 100644 --- a/share/online-temp +++ b/share/online-temp @@ -1,4 +1,4 @@ set imap_user = "$login" -set imap_pass = "`pass $passprefix$fulladdr`" +set imap_pass = "`pass mail/$passprefix$fulladdr`" set ssl_starttls = yes set ssl_force_tls = yes |
