From 946abe8f5fc97524cb58b8049bf2b37e71f55901 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 17 Apr 2020 10:21:59 -0400 Subject: [PATCH 01/58] new mail info for macos --- bin/mailsync | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index 32c0825..fc35ede 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -21,8 +21,10 @@ export DISPLAY=:0.0 # Settings are different for MacOS (Darwin) systems. if [ "$(uname)" = "Darwin" ]; then notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} + messageinfo() { osascript "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} else notify() { notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;} + messageinfo() { notify-send --app-name="mutt-wizard" "📧$from:" "$subject" ;} fi # Check account for new mail. Notify if there is new content. @@ -37,7 +39,7 @@ syncandnotify() { # Extract subject and sender from mail. from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n-1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') - notify-send --app-name="mutt-wizard" "📧$from:" "$subject" & + messageinfo & done fi } From 2698a4358c4747033b9c4dde3142d898e8c2004f Mon Sep 17 00:00:00 2001 From: Jackson Law <178053+jlaw@users.noreply.github.com> Date: Sat, 18 Apr 2020 07:47:32 -0700 Subject: [PATCH 02/58] fix: Support mbsync options passed to mailsync (#414) --- bin/mailsync | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index 32c0825..e6f2673 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -28,7 +28,7 @@ fi # Check account for new mail. Notify if there is new content. syncandnotify() { acc="$(echo "$account" | sed "s/.*\///")" - mbsync "$acc" + mbsync $opts "$acc" new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) if [ "$newcount" -gt "0" ]; then @@ -46,6 +46,9 @@ syncandnotify() { if [ "$#" -eq "0" ]; then accounts="$(awk '/^Channel/ {print $2}' "$HOME/.mbsyncrc")" else + for arg in "$@"; do + [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 + done accounts=$* fi From 15151c8b442f2345cc621d43f498276137718f30 Mon Sep 17 00:00:00 2001 From: Jackson Law <178053+jlaw@users.noreply.github.com> Date: Sat, 18 Apr 2020 07:49:29 -0700 Subject: [PATCH 03/58] Remove AuthMech misspelled option (#415) According to man page of mbsync, AuthMechs is the correct spelling of the option. --- bin/mw | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/mw b/bin/mw index 862f937..97b0172 100755 --- a/bin/mw +++ b/bin/mw @@ -50,12 +50,11 @@ $starttlsoff " mbsync_profile="IMAPStore $title-remote Host $imap -Port $iport +Port $iport User $login PassCmd \"pass mutt-wizard-$title\" AuthMechs LOGIN SSLType $ssltype -AuthMech LOGIN CertificateFile $sslcert MaildirStore $title-local From 3ee9cb73a0636aa2bae0c0417e1e8be52a8cbe5e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 23 Apr 2020 15:21:40 -0400 Subject: [PATCH 04/58] notmuch ignores mbsync files by default --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 97b0172..ab941a8 100755 --- a/bin/mw +++ b/bin/mw @@ -321,7 +321,7 @@ name=$realname primary_email=$fulladdr [new] tags=unread;inbox; -ignore= +ignore=.mbsyncstate;.uidvalidity [search] exclude_tags=deleted;spam; [maildir] From d4613d3b192c325d661100a3a33cff08767be29e Mon Sep 17 00:00:00 2001 From: Alexander Bocken <32177905+AlexBocken@users.noreply.github.com> Date: Sat, 25 Apr 2020 21:56:13 +0200 Subject: [PATCH 05/58] added 2 domains (#421) --- share/domains.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/domains.csv b/share/domains.csv index 33217be..1563d6a 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -304,3 +304,5 @@ zoho.com,imap.zoho.com,993,smtp.zoho.com,465 zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 +ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 +bocken.org,imap.gmail.com,993,smtp.gmail.com,465 From 00ed237cf81c68e366c6d7c4f6b2dc652c2a1db2 Mon Sep 17 00:00:00 2001 From: Thalia Wright <46098109+halcyonseeker@users.noreply.github.com> Date: Mon, 27 Apr 2020 11:08:39 -0700 Subject: [PATCH 06/58] Improved protonmail advice (#423) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e603745..9e0a331 100644 --- a/README.md +++ b/README.md @@ -105,8 +105,8 @@ mutt-wizard is free/libre software, licensed under the GPLv3. ## Watch out for these things: - Gmail accounts can now create 'App Password' to use with """less secure""" applications. This password is single use (ie. for setup) and will be stored and encrypted locally. Enabling third-party applications requires turning off two-factor authentication and this will circumvent that. You might also need to manually "Enable IMAP" in the settings. -- Protonmail accounts will require you to set up "Protonmail Bridge" to access PM's IMAP and SMTP servers. Configure that before running mutt-wizard. -- Protonmail bridge is prone to timing out. Watch out for this while adding an account. If the bridge times out, try again. +- Protonmail accounts will require you to set up "Protonmail Bridge" to access PM's IMAP and SMTP servers. Configure that before running mutt-wizard. Note that when mutt-wizard asks for a password, you should put in your [bridge password](https://protonmail.com/bridge/thunderbird#3), not your account password. +- Protonmail bridge is prone to timing out. Watch out for this while adding an account. If the bridge times out, try again. It might help to [increase the timeout](https://protonmail.com/support/knowledge-base/thunderbird-connection-server-timed-error/) in your `mbsyncrc`. - If you have a university email, or enterprise-hosted email for work, there might be other hurdles or two-factor authentication you have to jump through. Some, for example, will want you to create a separate IMAP password, etc. - `isync` is not fully UTF-8 compatible, so non-Latin characters may be garbled (although sync should succeed). `mw` will also not autocreate mailbox shortcuts since it is looking for English mailbox names. I strongly recommend you to set your email language to English on your mail server to avoid these problems. From 069910c13ec1c89421372b8e54b40cd2ae783303 Mon Sep 17 00:00:00 2001 From: Francesco <55460785+BachoSeven@users.noreply.github.com> Date: Thu, 30 Apr 2020 17:05:57 +0200 Subject: [PATCH 07/58] corrected studenti.unipi.it imap port (#425) --- share/domains.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index 1563d6a..f01e0a5 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -245,7 +245,7 @@ stud.uis.no,outlook.office365.com,993,smtp.office365.com,587 stud.uni-bamberg.de,outlook.office365.com,993,smtp.office365.com,587 student.rmit.edu.au,outlook.office365.com,993,smtp.office365.com,587 student.tuwien.ac.at,mail.student.tuwien.ac.at,993,mail.student.tuwien.ac.at,587 -studenti.unipi.it,outlook.office365.com,995,smtp.office365.com,587 +studenti.unipi.it,outlook.office365.com,993,smtp.office365.com,587 students.southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587 studio.unibo.it,outlook.office365.com,993,smtp.office365.com,587 studio.unibo.it,outlook.office365.com,993,smtp.office365.com,587 From 6fe26400957d9163a75f60fa0c18f266f25fbc85 Mon Sep 17 00:00:00 2001 From: Nai <52871629+nai666@users.noreply.github.com> Date: Thu, 30 Apr 2020 21:07:30 -0400 Subject: [PATCH 08/58] Update domains.csv (#426) imap and smtp for suny occ email --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index f01e0a5..0c8f815 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -45,6 +45,7 @@ chef.net,imap.mail.com,993,smtp.mail.com,587 chemist.com,imap.mail.com,993,smtp.mail.com,587 chrissx.ga,chrissx.ga,993,chrissx.ga,25 clarkson.edu,imap.gmail.com,993,smtp.gmail.com,587 +clasnet.sunyocc.edu,outlook.office365.com,993,smtp.office365.com,587 clerk.com,imap.mail.com,993,smtp.mail.com,587 clubmember.org,imap.mail.com,993,smtp.mail.com,587 cmail.carleton.ca,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 From 943cfd2a9ef57430482b5b766cab98447f9c932e Mon Sep 17 00:00:00 2001 From: g-w1 <58830309+g-w1@users.noreply.github.com> Date: Wed, 6 May 2020 13:40:37 -0400 Subject: [PATCH 09/58] Change "syncthing" to "syncing". Typo. (#429) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e0a331..fc0b51a 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ There's a chance of errors if you use a slow-release distro like Ubuntu, Debian - `lynx` - view HTML email in neomutt. - `notmuch` - index and search mail. Install it and run `notmuch setup`, tell it that your mail is in `~/.local/share/mail/` (although `mw` will do this automatically if you haven't set notmuch up before). You can run it in mutt with `ctrl-f`. Run `notmuch new` to process new mail, although the included `mailsync` script does this for you. -- `libnotify`/`libnotify-bin` - allows notifications when syncthing mail with `mailsync` +- `libnotify`/`libnotify-bin` - allows notifications when syncing mail with `mailsync` - `abook` - a terminal-based address book. Pressing tab while typing an address to send mail to will suggest contacts that are in your abook. - A cron manager - if you want to enable the auto-sync feature. - `pam-gnupg` - this is a more general program that I use. It automatically logs you into your GPG key on login so you will never need to input your password once logged on to your system. Check the repo and directions out [here](https://github.com/cruegge/pam-gnupg). From 8753a8bc3bbcf00107ee47477b2dd9112a9e54b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sat, 16 May 2020 22:43:16 +0200 Subject: [PATCH 10/58] Added st.amu.edu.pl (my collage) settings. (#437) Signed-off-by: Marcin Wozniak --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 0c8f815..758ab0b 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -239,6 +239,7 @@ sapo.pt,imap.sapo.pt,993,smtp.sapo.pt,587 smail.inf.h-brs.de,imap.inf.h-brs.de,993,smtp.inf.h-brs.de,587 southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587 spoko.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 +st.amu.edu.pl,outlook.office365.com,993,smtp.office365.com,587 stevens.edu,imap.outlook.com,993,smtp.outlook.com,587 stronzi.org,mail.autistici.org,993,smtp.autistici.org,465 stud.tu-darmstadt.de,imap.stud.tu-darmstadt.de,993,smtp.tu-darmstadt.de,465 From 5fbb19e74a730771bd245fb7b5f73ff3741da4e2 Mon Sep 17 00:00:00 2001 From: qorg11 Date: Sun, 24 May 2020 21:17:41 +0200 Subject: [PATCH 11/58] Added vxempire.xyz to domains.cvs (#440) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 758ab0b..04926d5 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -308,3 +308,4 @@ ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 bocken.org,imap.gmail.com,993,smtp.gmail.com,465 +vxempire.xyz,vxempire.xyz,993,vxempire.xyz,587 From aaeb0a73dc0904f9258743683e96e2439f88ba56 Mon Sep 17 00:00:00 2001 From: qorg11 Date: Mon, 25 May 2020 12:38:07 +0200 Subject: [PATCH 12/58] Fix set_folder for vxempire.xyz (#441) * Added vxempire.xyz to domains.cvs * Fixed set_folder for vxempire.xyz --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index ab941a8..981f3d2 100755 --- a/bin/mw +++ b/bin/mw @@ -102,7 +102,7 @@ set realname = \"$realname\" set from = \"$fulladdr\" set sendmail = \"msmtp -a $title\" alias me $realname <$fulladdr> -set folder = \"imaps://$fulladdr@$imap:$iport\" +set folder = \"imaps://$login@$imap:$iport\" set imap_user = \"$login\" set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies From 3bf2023dd5a82ed1b3e53aad4d24d537e68105fc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 25 May 2020 21:01:52 -0400 Subject: [PATCH 13/58] don't use extra icon file use kill instead of pkill for speed --- bin/mailsync | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 3104c65..6ee7f51 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -54,8 +54,7 @@ else accounts=$* fi -echo " 🔃" > /tmp/imapsyncicon_"$USER" -( pkill -RTMIN+12 "${STATUSBAR:-blocks}" >/dev/null 2>&1 ) 2>/dev/null +( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null # Parallelize multiple accounts for account in $accounts @@ -64,8 +63,7 @@ do done wait -rm -f /tmp/imapsyncicon_"$USER" -( pkill -RTMIN+12 "${STATUSBAR:-blocks}" >/dev/null 2>&1 ) 2>/dev/null +( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null notmuch new 2>/dev/null From 55f810ef6939d5aecd3bfb8a10b62c21ee484d23 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 25 May 2020 21:02:53 -0400 Subject: [PATCH 14/58] minor tweaks --- bin/openfile | 2 +- share/mailcap | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/openfile b/bin/openfile index c0e2e9c..f6668dc 100755 --- a/bin/openfile +++ b/bin/openfile @@ -1,7 +1,7 @@ #!/bin/sh # Helps open a file with xdg-open from mutt in a external program without weird side effects. -[ $(uname) = "Darwin" ] && opener="open" || opener="setsid xdg-open" +[ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid xdg-open" mkdir -p "/tmp/$USER-mutt-tmp" file="/tmp/$USER-mutt-tmp/$(basename "$1")" rm -f "$file" diff --git a/share/mailcap b/share/mailcap index f7a7541..5bd2471 100644 --- a/share/mailcap +++ b/share/mailcap @@ -5,3 +5,4 @@ image/*; openfile %s ; video/*; setsid mpv --quiet %s &; copiousoutput application/pdf; openfile %s ; application/pgp-encrypted; gpg -d '%s'; copiousoutput; +application/pgp-keys; gpg --import '%s'; copiousoutput; From e69a7ad311e94c29a1e4b7e593a8630b09573ea2 Mon Sep 17 00:00:00 2001 From: alps2006 Date: Wed, 27 May 2020 10:02:20 +0800 Subject: [PATCH 15/58] Fix head: illegal line count -- -1 (#443) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix head: illegal line count -- -1 * Fix `osascript: display notification with title "📧 xxxx" subtitle "xxxx" : No such file or directory` --- bin/mailsync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 3104c65..6aeb946 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -21,7 +21,7 @@ export DISPLAY=:0.0 # Settings are different for MacOS (Darwin) systems. if [ "$(uname)" = "Darwin" ]; then notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} - messageinfo() { osascript "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} + messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} else notify() { notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;} messageinfo() { notify-send --app-name="mutt-wizard" "📧$from:" "$subject" ;} @@ -38,7 +38,7 @@ syncandnotify() { for file in $new; do # Extract subject and sender from mail. from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') - subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n-1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') + subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') messageinfo & done fi From 12e37fce3c07edfbfb8b3d3049f4710b3bb6a13c Mon Sep 17 00:00:00 2001 From: qorg11 Date: Sun, 31 May 2020 12:22:00 +0200 Subject: [PATCH 16/58] Added pgp (gpg) support by default (#447) * mutt-wizard works on FreeBSD, also changed mbsync with isync (actual package name) * Added pgp support --- README.md | 2 +- bin/mw | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fc0b51a..0123fba 100644 --- a/README.md +++ b/README.md @@ -112,5 +112,5 @@ mutt-wizard is free/libre software, licensed under the GPLv3. ## To-do -- Add ~~Mac OS~~/BSD compatibility (the script is confired to work for Mac OS now) +- Add ~~Mac OS~~/~~BSD~~ compatibility (the script is confired to work for Mac OS and FreeBSD now) - ~~Out-of-the-box compatibility with Protonmail Bridge~~ (I believe this is done, but more bug-testing is welcome since I don't have PM) diff --git a/bin/mw b/bin/mw index 981f3d2..e62be2a 100755 --- a/bin/mw +++ b/bin/mw @@ -7,7 +7,7 @@ command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" printf "\`pass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`pass init \`.\\nIf you don't have a GPG public private key pair, run \`%s --full-gen-key\` first.\\n" "$GPG" exit } -! command -v mbsync >/dev/null && printf "\`mbsync\` must be installed to run mutt-wizard.\\n" && exit +! command -v mbsync >/dev/null && printf "\`mbsync (isync package)\` must be installed to run mutt-wizard.\\n" && exit prefix="/usr/local" muttdir="$HOME/.config/mutt" # Main mutt config location @@ -86,6 +86,9 @@ set folder = \"$maildir/$title\" set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies set mbox_type = Maildir +set crypt_opportunistic_encrypt = yes +set pgp_self_encrypt = yes +set pgp_default_key = $keyid bind index,pager gg noop bind index,pager g noop @@ -108,6 +111,11 @@ set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies set imap_pass = \"\`pass mutt-wizard-$title\`\" +set crypt_opportunistic_encrypt = yes +set pgp_self_encrypt = yes +set pgp_default_key = $keyid + + set mbox_type = Maildir set ssl_starttls = yes set ssl_force_tls = yes @@ -126,6 +134,7 @@ fi askinfo() { \ printf "Insert the \033[31memail address\033[0m that you want to autoconfigure for mutt/mbsync\\n\tEmail: \033[36m" read -r fulladdr + keyid=$( gpg --list-keys --with-colons $fulladdr | awk -F: '/^pub:/ { print $5 }') printf "\033[0m" while ! echo "$fulladdr" | grep "$emailre" >/dev/null; do printf "That is not a valid \033[31memail address\033[0m, please retype the desired email.\\n\\nEmail: \033[36m\t" From 7c41c5e1e65d4f90bf2cdfebd51235d747807b5b Mon Sep 17 00:00:00 2001 From: JameyBear Date: Sun, 31 May 2020 07:16:56 -0400 Subject: [PATCH 17/58] Simple Fixes (#448) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0123fba..8681f8d 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ Get this great stuff without effort: - A full-featured and autoconfigured email client on the terminal with neomutt -- Mail stored offline so you can view and write email while away from internet and keep backups +- Mail stored offline so you can view and write email while you're away from internet and keep backups Specifically, this wizard: - Determines your email server's IMAP and SMTP servers and ports - Creates dotfiles for `neomutt`, `isync`, and `msmtp` appropriate for your email address -- Encrypts and stores locally your password for easy remote access, accessible only by your GPG key +- Encrypts and locally stores your password for easy remote access, accessible only by your GPG key - Handles as many as nine separate email accounts automatically - Auto-creates bindings to switch between accounts or between mailboxes - Can automatically set mail updates as often as you want to sync your mail and update you when new mail arrives @@ -112,5 +112,5 @@ mutt-wizard is free/libre software, licensed under the GPLv3. ## To-do -- Add ~~Mac OS~~/~~BSD~~ compatibility (the script is confired to work for Mac OS and FreeBSD now) +- Add ~~Mac OS~~/~~BSD~~ compatibility (the script is confirmed to work for Mac OS and FreeBSD now) - ~~Out-of-the-box compatibility with Protonmail Bridge~~ (I believe this is done, but more bug-testing is welcome since I don't have PM) From bb72cf5a71418a3d8eaa3cc731a2b8a8627e9c1c Mon Sep 17 00:00:00 2001 From: JameyBear Date: Sun, 31 May 2020 12:10:35 -0400 Subject: [PATCH 18/58] Cleanup (#450) * Simple Fixes * Tweak wording * Update openfile * ShellChecked * Little Fixes --- bin/mailsync | 4 ++-- bin/mw | 8 ++++---- bin/openfile | 2 +- mw.1 | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 6aeb946..6128f41 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -12,7 +12,7 @@ ping -q -c 1 1.1.1.1 > /dev/null || { echo "No internet connection detected."; e command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotify-send\` should be installed for pop-up mail notifications with this script." # Required to display notifications if run as a cronjob: -DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus export DISPLAY=:0.0 # For individual configurations: @@ -30,7 +30,7 @@ fi # Check account for new mail. Notify if there is new content. syncandnotify() { acc="$(echo "$account" | sed "s/.*\///")" - mbsync $opts "$acc" + mbsync "$opts" "$acc" new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) if [ "$newcount" -gt "0" ]; then diff --git a/bin/mw b/bin/mw index e62be2a..0862f30 100755 --- a/bin/mw +++ b/bin/mw @@ -3,7 +3,7 @@ command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" [ -z ${PASSWORD_STORE_DIR+x} ] && PASSWORD_STORE_DIR="$HOME/.password-store" [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] && - "$GPG" --list-secret-keys $(cat "$PASSWORD_STORE_DIR/.gpg-id") >/dev/null 2>&1 || { + "$GPG" --list-secret-keys "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" >/dev/null 2>&1 || { printf "\`pass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`pass init \`.\\nIf you don't have a GPG public private key pair, run \`%s --full-gen-key\` first.\\n" "$GPG" exit } @@ -134,7 +134,7 @@ fi askinfo() { \ printf "Insert the \033[31memail address\033[0m that you want to autoconfigure for mutt/mbsync\\n\tEmail: \033[36m" read -r fulladdr - keyid=$( gpg --list-keys --with-colons $fulladdr | awk -F: '/^pub:/ { print $5 }') + keyid=$( gpg --list-keys --with-colons "$fulladdr" | awk -F: '/^pub:/ { print $5 }') printf "\033[0m" while ! echo "$fulladdr" | grep "$emailre" >/dev/null; do printf "That is not a valid \033[31memail address\033[0m, please retype the desired email.\\n\\nEmail: \033[36m\t" @@ -145,7 +145,7 @@ askinfo() { \ search_query=$domain case "$domain" in protonmail.com|protonmail.ch|pm.me) - search_query='protonmail.com' && break;; + search_query='protonmail.com' && return 1;; *) while : ; do printf "\nIs your email hosted with Protonmail? [yes/no] " @@ -339,7 +339,7 @@ synchronize_flags=true gpg_path=$GPG" echo "$nmbasic" > "$NOTMUCH_CONFIG" ;} -trap 'echo -e "\033[0m\n"; exit' STOP INT ABRT KILL +trap 'echo -e "\033[0m\n"; exit' INT ABRT case "$1" in ls) list ;; diff --git a/bin/openfile b/bin/openfile index c0e2e9c..f6668dc 100755 --- a/bin/openfile +++ b/bin/openfile @@ -1,7 +1,7 @@ #!/bin/sh # Helps open a file with xdg-open from mutt in a external program without weird side effects. -[ $(uname) = "Darwin" ] && opener="open" || opener="setsid xdg-open" +[ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid xdg-open" mkdir -p "/tmp/$USER-mutt-tmp" file="/tmp/$USER-mutt-tmp/$(basename "$1")" rm -f "$file" diff --git a/mw.1 b/mw.1 index c866c83..217ae2b 100644 --- a/mw.1 +++ b/mw.1 @@ -6,7 +6,7 @@ mw \- mutt-wizard \- autoconfigure email accounts for neomutt and isync .SH DESCRIPTION .B mw -takes a user email account and sets up a terminal-based email interface with it for +takes a user email account and sets up a terminal-based email interface for it with .B neomutt. This can include offline email with .B isync/mbsync From 591145b653dbbe1effa2eb8cf4e4e53a8e51e880 Mon Sep 17 00:00:00 2001 From: qorg11 Date: Mon, 1 Jun 2020 13:45:20 +0200 Subject: [PATCH 19/58] Auto sign emails using pgp (#451) --- bin/mw | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/mw b/bin/mw index 0862f30..ed4f278 100755 --- a/bin/mw +++ b/bin/mw @@ -86,6 +86,8 @@ set folder = \"$maildir/$title\" set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies set mbox_type = Maildir + +set crypt_autosign = yes set crypt_opportunistic_encrypt = yes set pgp_self_encrypt = yes set pgp_default_key = $keyid @@ -111,6 +113,7 @@ set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies set imap_pass = \"\`pass mutt-wizard-$title\`\" +set crypt_autosign = yes set crypt_opportunistic_encrypt = yes set pgp_self_encrypt = yes set pgp_default_key = $keyid From 5b278c94a8122c7c576f48c6f3a80eab0928a395 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 2 Jun 2020 15:24:37 -0400 Subject: [PATCH 20/58] funding file for github sponsors --- FUNDING.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 FUNDING.yml diff --git a/FUNDING.yml b/FUNDING.yml new file mode 100644 index 0000000..5b856dc --- /dev/null +++ b/FUNDING.yml @@ -0,0 +1,5 @@ +github: lukesmithxyz +custom: "https://lukesmith.xyz/donate" +custom: "https://paypal.me/lukemsmith" +patreon: lukesmith +custom: "https://lukesmith.xyz/crypto" From bc3ea20a0605c38a076d129702a80e1892c99145 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 2 Jun 2020 15:41:16 -0400 Subject: [PATCH 21/58] ui fix --- FUNDING.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/FUNDING.yml b/FUNDING.yml index 5b856dc..f8e6076 100644 --- a/FUNDING.yml +++ b/FUNDING.yml @@ -1,5 +1,3 @@ github: lukesmithxyz -custom: "https://lukesmith.xyz/donate" -custom: "https://paypal.me/lukemsmith" +custom: ["https://lukesmith.xyz/donate", "https://paypal.me/lukemsmith", "https://lukesmith.xyz/crypto"] patreon: lukesmith -custom: "https://lukesmith.xyz/crypto" From d90b668d4e2d37295022ddcbaa9536a4bbbfe16d Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 4 Jun 2020 18:47:13 -0400 Subject: [PATCH 22/58] fix #452 --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index ed4f278..1d7ed07 100755 --- a/bin/mw +++ b/bin/mw @@ -137,7 +137,7 @@ fi askinfo() { \ printf "Insert the \033[31memail address\033[0m that you want to autoconfigure for mutt/mbsync\\n\tEmail: \033[36m" read -r fulladdr - keyid=$( gpg --list-keys --with-colons "$fulladdr" | awk -F: '/^pub:/ { print $5 }') + keyid=$("$GPG" --list-keys --with-colons "$fulladdr" | awk -F: '/^pub:/ { print $5 }') printf "\033[0m" while ! echo "$fulladdr" | grep "$emailre" >/dev/null; do printf "That is not a valid \033[31memail address\033[0m, please retype the desired email.\\n\\nEmail: \033[36m\t" From 86b2d78f0b3386ca15a21ef3931a69fac09e5b20 Mon Sep 17 00:00:00 2001 From: alps2006 Date: Sun, 7 Jun 2020 04:50:40 +0800 Subject: [PATCH 23/58] Improved key mapping that can quickly selected item with in query mode (abook) (#446) --- share/mutt-wizard.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 3dd2f6c..aafb3d5 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -46,7 +46,7 @@ bind index U undelete-message bind index L limit bind index h noop bind index l display-message -bind index tag-entry +bind index,query tag-entry #bind browser h goto-parent macro browser h '..' "Go to parent folder" bind index,pager H view-raw-message From c25bac2cf9c70a25a3ff3182f6a0f0bd11bf2276 Mon Sep 17 00:00:00 2001 From: Petrus Date: Sun, 7 Jun 2020 04:51:49 +0800 Subject: [PATCH 24/58] make crontab quite (#416) Let's make crontab a little quiet here, unless for those who set up mail for crontab error handling will be disturbed every few minutes. --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 1d7ed07..5293c5d 100755 --- a/bin/mw +++ b/bin/mw @@ -303,7 +303,7 @@ choosecron() { ! pgrep cron >/dev/null && echo "No cron manager running. Install read -r minnum printf "\033[0m" done - (crontab -l; echo "*/$minnum * * * * $(type mailsync | cut -d' ' -f3)") | crontab - && + (crontab -l; echo "*/$minnum * * * * $(type mailsync | cut -d' ' -f3)") >/dev/null | crontab - && echo "Cronjob added. Mail will sync every $minnum minutes. Be sure you have your cron manager running." fi ;} From 14d73009953c22d66e2cdf0dbc0ba33351206568 Mon Sep 17 00:00:00 2001 From: Luke Bubar <43391582+lukerb52@users.noreply.github.com> Date: Sat, 6 Jun 2020 16:54:35 -0400 Subject: [PATCH 25/58] Update domains.csv (#400) Co-authored-by: Luke Smith --- share/domains.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index 04926d5..3f0eb21 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -89,6 +89,7 @@ forthnet.gr,mail.forthnet.gr,993,smtp-auth.forthnet.gr,465 fsmpi.rwth-aachen.de,mail.fsmpi.rwth-aachen.de,993,mail.fsmpi.rwth-aachen.de,465 fsu-jena,exchange.uni-jena.de,993,smtp.uni-jena.de,587 getbackinthe.kitchen,mail.cock.li,993,mail.cock.li,587 +gcc.edu,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 gmail.com,imap.gmail.com,993,smtp.gmail.com,587 gmx.at,imap.gmx.net,993,mail.gmx.net,587 gmx.com,imap.gmx.net,993,mail.gmx.net,587 @@ -308,4 +309,4 @@ ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 bocken.org,imap.gmail.com,993,smtp.gmail.com,465 -vxempire.xyz,vxempire.xyz,993,vxempire.xyz,587 +vxempire.xyz,vxempire.xyz,993,vxempire.xyz,587 \ No newline at end of file From 9ec2a49af03cf542c7db82bc0dd0ccdde81922d4 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 6 Jun 2020 16:56:13 -0400 Subject: [PATCH 26/58] i wish people would do this themselves in prs --- share/domains.csv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/share/domains.csv b/share/domains.csv index 3f0eb21..a1d4d3c 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -33,6 +33,7 @@ bikerider.com,imap.mail.com,993,smtp.mail.com,587 billycarlyle.uk,mail.muny.us,993,mail.muny.us,465 birdlover.com,imap.mail.com,993,smtp.mail.com,587 bjoernguthphotography.de,wp300.webpack.hosteurope.de,993,wp300.webpack.hosteurope.de,587 +bocken.org,imap.gmail.com,993,smtp.gmail.com,465 brew-meister.com,imap.mail.com,993,smtp.mail.com,587 bruttocarattere.org,mail.autistici.org,993,smtp.autistici.org,465 canaglie.net,mail.autistici.org,993,smtp.autistici.org,465 @@ -79,6 +80,7 @@ eneco.com,outlook.office365.com,993,smtp.office365.com,587 engineer.com,imap.mail.com,993,smtp.mail.com,587 erciyes.edu.tr,posta.erciyes.edu.tr,993,smtp.erciyes.edu.tr,587 ethancoe.com,mail.privateemail.com,993,mail.privateemail.com,465 +ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 etu.upmc.fr,courriel.upmc.fr,993,smtps.upmc.fr,587 europe.com,imap.mail.com,993,smtp.mail.com,587 fastmail.com,imap.fastmail.com,993,smtp.fastmail.com,465 @@ -88,8 +90,8 @@ forpsi.com,imap.forpsi.com,993,smtp.forpsi.com,465 forthnet.gr,mail.forthnet.gr,993,smtp-auth.forthnet.gr,465 fsmpi.rwth-aachen.de,mail.fsmpi.rwth-aachen.de,993,mail.fsmpi.rwth-aachen.de,465 fsu-jena,exchange.uni-jena.de,993,smtp.uni-jena.de,587 -getbackinthe.kitchen,mail.cock.li,993,mail.cock.li,587 gcc.edu,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +getbackinthe.kitchen,mail.cock.li,993,mail.cock.li,587 gmail.com,imap.gmail.com,993,smtp.gmail.com,587 gmx.at,imap.gmx.net,993,mail.gmx.net,587 gmx.com,imap.gmx.net,993,mail.gmx.net,587 @@ -271,6 +273,7 @@ ua.pt,outlook.office365.com,993,mail.ua.pt,25 uach.mx,imap.gmail.com,993,smtp.gmail.com,587 ucdavis.edu,imap.gmail.com,993,smtp.gmail.com,587 uni-duesseldorf.de,mail.hhu.de,993,mail.hhu.de,465 +unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 unitybox.de,mail.unity-mail.de,993,mail.unity-mail.de,587 uoregon.edu,imap.uoregon.edu,993,smtp.uoregon.edu,587 uqtr.ca,outlook.office365.com,993,smtp.office365.com,587 @@ -284,6 +287,7 @@ vip.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 vivaldi.net,imap.vivaldi.net,993,smtp.vivaldi.net,587 vp.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 vt.edu,imap.gmail.com,993,smtp.gmail.com,587 +vxempire.xyz,vxempire.xyz,993,vxempire.xyz,587 waifu.club,mail.cock.li,993,mail.cock.li,587 wanadoo.fr,imap.orange.fr,993,smtp.orange.fr,465 wants.dicksinhisan.us,mail.cock.li,993,mail.cock.li,587 @@ -302,11 +306,7 @@ yandex.kz,imap.yandex.com,993,smtp.yandex.com,587 yandex.net,imap.yandex.com,993,smtp.yandex.com,587 yandex.ru,imap.yandex.com,993,smtp.yandex.com,587 yandex.ua,imap.yandex.com,993,smtp.yandex.com,587 +ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 zaclys.net,mail.zaclys.net,993,mail.zaclys.net,465 zoho.com,imap.zoho.com,993,smtp.zoho.com,465 zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 -ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 -unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 -ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 -bocken.org,imap.gmail.com,993,smtp.gmail.com,465 -vxempire.xyz,vxempire.xyz,993,vxempire.xyz,587 \ No newline at end of file From 97708ce11eff2c145c551d391cbf4d5ee3f85c10 Mon Sep 17 00:00:00 2001 From: Rob Date: Mon, 8 Jun 2020 12:16:20 +0100 Subject: [PATCH 27/58] fix blank opt flag (#454) If no options are passed but the accounts are specified then the blank opt flag causes a (harmless) error message from mbsync about an empy channel. Co-authored-by: rjl6789 --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index a90c6c9..4050eba 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -30,7 +30,7 @@ fi # Check account for new mail. Notify if there is new content. syncandnotify() { acc="$(echo "$account" | sed "s/.*\///")" - mbsync "$opts" "$acc" + if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) if [ "$newcount" -gt "0" ]; then From 76417d7b071b4a82338eb81ff835de2c070ea104 Mon Sep 17 00:00:00 2001 From: Rob Date: Tue, 9 Jun 2020 13:41:38 +0100 Subject: [PATCH 28/58] fix crontab set (#457) I think a recent change tried to send output from crontab to dev/null to avoid messages appearing a) when setting the crontab, b) whenever mailsync is run. However the redirection was for the string concatenation meaning a null string was piped to cron obliterating the crontab (thank goodness for backups). I have put the redirection in the correct location (similar to a few lines above when removing the mailsync line). I have also redirected all output of the mailsync (both errors and normal messages) to dev null. Co-authored-by: rjl6789 --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 5293c5d..1d986d1 100755 --- a/bin/mw +++ b/bin/mw @@ -303,7 +303,7 @@ choosecron() { ! pgrep cron >/dev/null && echo "No cron manager running. Install read -r minnum printf "\033[0m" done - (crontab -l; echo "*/$minnum * * * * $(type mailsync | cut -d' ' -f3)") >/dev/null | crontab - && + (crontab -l; echo "*/$minnum * * * * $(type mailsync | cut -d' ' -f3) >/dev/null 2>&1") | crontab - >/dev/null && echo "Cronjob added. Mail will sync every $minnum minutes. Be sure you have your cron manager running." fi ;} From cbf2f14d0d8a328188a3811cca749d381a80e2a6 Mon Sep 17 00:00:00 2001 From: Elijah Gregg Date: Wed, 10 Jun 2020 19:48:16 +0000 Subject: [PATCH 29/58] Update domains.csv (#461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update domains.csv * Update domains.csv * Update domains.csv Forgot to alphabetize, whoops🙄 --- share/domains.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/domains.csv b/share/domains.csv index a1d4d3c..b34f3ae 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -236,6 +236,7 @@ rape.lol,mail.cock.li,993,mail.cock.li,587 redchan.it,mail.cock.li,993,mail.cock.li,587 resch.pw,mail.resch.pw,993,mail.resch.pw,587 riseup.net,mail.riseup.net,993,mail.riseup.net,465 +rmcacs.org,imap.gmail.com,993,smtp.gmail.com,587 runbox.com,mail.runbox.com,993,mail.runbox.com,587 rwth-aachen.de,mail.rwth-aachen.de,993,mail.rwth-aachen.de,587 sapo.pt,imap.sapo.pt,993,smtp.sapo.pt,587 @@ -251,6 +252,7 @@ stud.uni-bamberg.de,outlook.office365.com,993,smtp.office365.com,587 student.rmit.edu.au,outlook.office365.com,993,smtp.office365.com,587 student.tuwien.ac.at,mail.student.tuwien.ac.at,993,mail.student.tuwien.ac.at,587 studenti.unipi.it,outlook.office365.com,993,smtp.office365.com,587 +students.rmcacs.org,imap.gmail.com,993,smtp.gmail.com,587 students.southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587 studio.unibo.it,outlook.office365.com,993,smtp.office365.com,587 studio.unibo.it,outlook.office365.com,993,smtp.office365.com,587 From ca5c623855133903521dedb1dca08373ba762948 Mon Sep 17 00:00:00 2001 From: Rob Date: Fri, 12 Jun 2020 11:43:26 +0100 Subject: [PATCH 30/58] fix premature return from askinfo (#463) I believe this addresses issue #456 where if you add a protonmail account you get an error. This is caused by prematurely returning from the case statement that queries whether you have a protonmail account or not. Co-authored-by: rjl6789 --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 1d986d1..c7a5c62 100755 --- a/bin/mw +++ b/bin/mw @@ -148,7 +148,7 @@ askinfo() { \ search_query=$domain case "$domain" in protonmail.com|protonmail.ch|pm.me) - search_query='protonmail.com' && return 1;; + search_query='protonmail.com' ;; *) while : ; do printf "\nIs your email hosted with Protonmail? [yes/no] " From 5d5e61295305e03f60e81ddf87931da8da14cd8b Mon Sep 17 00:00:00 2001 From: Neil <41444780+Neveon@users.noreply.github.com> Date: Sat, 13 Jun 2020 07:55:19 -0400 Subject: [PATCH 31/58] Update domains.csv (#464) Added my schools server info --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index b34f3ae..2c0c3e7 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -167,6 +167,7 @@ interia.pl,poczta.interia.pl,993,poczta.interia.pl,465 inventati.org,mail.autistici.org,993,smtp.autistici.org,465 ionos.de,imap.ionos.de,993,smtp.ionos.de,587 itu.dk,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +kean.edu,imap.gmail.com,993,smtp.gmail.com,587 kipras.org,mail.kipras.org,993,mail.kipras.org,587 krutt.org,mail.autistici.org,993,smtp.autistici.org,465 kth.se,webmail.kth.se,993,smtp.kth.se,587 From 040bcedbc5dc063957833d9940ffead11f32da29 Mon Sep 17 00:00:00 2001 From: Carlos de la Torre <48769508+c-torre@users.noreply.github.com> Date: Sat, 13 Jun 2020 14:28:54 +0000 Subject: [PATCH 32/58] added university of helsinki (#465) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 2c0c3e7..86bb5e8 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -108,6 +108,7 @@ grrlz.net,mail.autistici.org,993,smtp.autistici.org,465 hacari.com,mail.autistici.org,993,smtp.autistici.org,465 hacari.net,mail.autistici.org,993,smtp.autistici.org,465 hacari.org,mail.autistici.org,993,smtp.autistici.org,465 +helsinki.fi,outlook.office365.com,993,smtp.helsinki.fi,587 hhu.de,mail.hhu.de,993,mail.hhu.de,465 hitler.rocks,mail.cock.li,993,mail.cock.li,587 horsefucker.org,mail.cock.li,993,mail.cock.li,587 From 5e2aa207a029783de72e692b4fb55a1576677ead Mon Sep 17 00:00:00 2001 From: AAP <46041660+null2264@users.noreply.github.com> Date: Sun, 14 Jun 2020 19:48:41 +0700 Subject: [PATCH 33/58] + Added binadarma (Universitas Binadarma) (#466) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 86bb5e8..5ba77b0 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -251,6 +251,7 @@ stronzi.org,mail.autistici.org,993,smtp.autistici.org,465 stud.tu-darmstadt.de,imap.stud.tu-darmstadt.de,993,smtp.tu-darmstadt.de,465 stud.uis.no,outlook.office365.com,993,smtp.office365.com,587 stud.uni-bamberg.de,outlook.office365.com,993,smtp.office365.com,587 +student.binadarma.ac.id,imap.gmail.com,993,smtp.gmail.com,587 student.rmit.edu.au,outlook.office365.com,993,smtp.office365.com,587 student.tuwien.ac.at,mail.student.tuwien.ac.at,993,mail.student.tuwien.ac.at,587 studenti.unipi.it,outlook.office365.com,993,smtp.office365.com,587 From 44ea78692908d7aa54d2e1ed20314343c8db198a Mon Sep 17 00:00:00 2001 From: Michel Boaventura Date: Tue, 16 Jun 2020 16:07:28 -0300 Subject: [PATCH 34/58] Update Makefile (#458) Fix uninstall command --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6633b7b..70f780d 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ install: uninstall: for script in bin/*; do \ - rm -f $(DESTDIR)$(PREFIX)/$$script; \ + rm -f $(DESTDIR)$(PREFIX)/bin/$$script; \ done rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1 From e2203ed34f5f74b1d7b4651f35feaa86426bd087 Mon Sep 17 00:00:00 2001 From: CosmosAtlas Date: Wed, 17 Jun 2020 03:10:35 +0800 Subject: [PATCH 35/58] changed ping address to a more friendly location (#399) * changed ping address to a more friendly location `1.1.1.1` is not a friendly address for users from some parts of the world (e.g., China). Changed to `example.org` which should be more friendly to access. * changed internet check by fallback This is probably better since for most people it does the same thing and the first back up is Cloudfare's other DNS address which surprisingly can be accessed in more places (e.g., China) now. And changed the finall fallback as example.org. --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index 4050eba..93ec35d 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -8,7 +8,7 @@ pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync wil pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;} # Checks for internet connection and set notification script. -ping -q -c 1 1.1.1.1 > /dev/null || { echo "No internet connection detected."; exit ;} +ping -q -c 1 1.1.1.1 > /dev/null || ping -q -c 1 1.0.0.1 > /dev/null || ping -q -c 1 example.org || { echo "No internet connection detected."; exit ;} command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotify-send\` should be installed for pop-up mail notifications with this script." # Required to display notifications if run as a cronjob: From 497839b1ee804d86f9dac453108c7bbf071060ee Mon Sep 17 00:00:00 2001 From: Fraser Li <55525214+fraserli@users.noreply.github.com> Date: Mon, 22 Jun 2020 21:41:07 +1000 Subject: [PATCH 36/58] Added support for multiple gpg keys with pass (#472) --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index c7a5c62..9bf00c3 100755 --- a/bin/mw +++ b/bin/mw @@ -3,7 +3,7 @@ command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" [ -z ${PASSWORD_STORE_DIR+x} ] && PASSWORD_STORE_DIR="$HOME/.password-store" [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] && - "$GPG" --list-secret-keys "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" >/dev/null 2>&1 || { + "$GPG" --list-secret-keys $(cat "$PASSWORD_STORE_DIR/.gpg-id") >/dev/null 2>&1 || { printf "\`pass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`pass init \`.\\nIf you don't have a GPG public private key pair, run \`%s --full-gen-key\` first.\\n" "$GPG" exit } From 5edde7ef8ee45905d5afba0067eb8dc8a6f95cd9 Mon Sep 17 00:00:00 2001 From: Ashley Glenday Date: Tue, 30 Jun 2020 21:27:49 +1000 Subject: [PATCH 37/58] Update domains.csv (#478) Added Australian ISP Bigpond. --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 5ba77b0..18775ef 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -29,6 +29,7 @@ autoproduzioni.net,mail.autistici.org,993,smtp.autistici.org,465 bartender.net,imap.mail.com,993,smtp.mail.com,587 bastardi.net,mail.autistici.org,993,smtp.autistici.org,465 bguth.de,wp300.webpack.hosteurope.de,993,wp300.webpack.hosteurope.de,587 +bigpond.com,imap.telstra.com,143,smtp.telstra.com,587 bikerider.com,imap.mail.com,993,smtp.mail.com,587 billycarlyle.uk,mail.muny.us,993,mail.muny.us,465 birdlover.com,imap.mail.com,993,smtp.mail.com,587 From c4144ffb7c479830acf579caa05e9f85f71b36aa Mon Sep 17 00:00:00 2001 From: cl1pp0 <28967414+cl1pp0@users.noreply.github.com> Date: Sat, 4 Jul 2020 14:30:45 +0200 Subject: [PATCH 38/58] add mail.de to domains.csv (#485) Co-authored-by: cl1pp0 --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 18775ef..69d6432 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -184,6 +184,7 @@ loves.dicksinhisan.us,mail.cock.li,993,mail.cock.li,587 loves.dicksinmyan.us,mail.cock.li,993,mail.cock.li,587 lukesmith.xyz,mail.lukesmith.xyz,993,mail.lukesmith.xyz,587 mail.com,imap.mail.com,993,smtp.mail.com,587 +mail.de,imap.mail.de,993,smtp.mail.de,465 mail.mcgill.ca,outlook.office365.com,993,smtp.office365.com,587 mail.polimi.it,outlook.office365.com,993,smtp.office365.com,587 mail.ru,imap.mail.ru,993,smtp.mail.ru,465 From 96c0073ecfa9d8063404c23b48570287adf1544d Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 9 Jul 2020 17:50:01 -0400 Subject: [PATCH 39/58] mailsync and cron removed, mw sync added --- README.md | 9 +++------ bin/mw | 35 ++++++++++------------------------- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 8681f8d..0da14f4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ Specifically, this wizard: - Encrypts and locally stores your password for easy remote access, accessible only by your GPG key - Handles as many as nine separate email accounts automatically - Auto-creates bindings to switch between accounts or between mailboxes -- Can automatically set mail updates as often as you want to sync your mail and update you when new mail arrives - Provides sensible defaults and an attractive appearance for the neomutt email client - If mutt-wizard doesn't know your server's IMAP/SMTP info by default, it will prompt you for them and will put them in all the right places. @@ -26,14 +25,14 @@ sudo make install User of Arch-based distros can also install mutt-wizard from the AUR as [mutt-wizard-git](https://aur.archlinux.org/packages/mutt-wizard-git/). -The mutt-wizard is run with the command `mw`. It also installs the `mailsync` command. Once everything is setup, you'll use `neomutt` to access your mail. +The mutt-wizard is run with the command `mw`. Once everything is setup, you'll use `neomutt` to access your mail. - `mw add` -- add a new email account - `mw ls` -- list existing accounts - `mw pass` -- revise an account's password - `mw delete` -- delete an added account +- `mw sync` -- sync all mail accounts and update notmuch database - `mw purge` -- delete all accounts and settings -- `mw cron` -- toggle/configure a cronjob to sync mail ## Dependencies @@ -47,10 +46,8 @@ There's a chance of errors if you use a slow-release distro like Ubuntu, Debian ### Optional - `lynx` - view HTML email in neomutt. -- `notmuch` - index and search mail. Install it and run `notmuch setup`, tell it that your mail is in `~/.local/share/mail/` (although `mw` will do this automatically if you haven't set notmuch up before). You can run it in mutt with `ctrl-f`. Run `notmuch new` to process new mail, although the included `mailsync` script does this for you. -- `libnotify`/`libnotify-bin` - allows notifications when syncing mail with `mailsync` +- `notmuch` - index and search mail. Install it and run `notmuch setup`, tell it that your mail is in `~/.local/share/mail/` (although `mw` will do this automatically if you haven't set notmuch up before). You can run it in mutt with `ctrl-f`. Run `notmuch new` to process new mail. - `abook` - a terminal-based address book. Pressing tab while typing an address to send mail to will suggest contacts that are in your abook. -- A cron manager - if you want to enable the auto-sync feature. - `pam-gnupg` - this is a more general program that I use. It automatically logs you into your GPG key on login so you will never need to input your password once logged on to your system. Check the repo and directions out [here](https://github.com/cruegge/pam-gnupg). - `urlview` - outputs urls in mail to browser. diff --git a/bin/mw b/bin/mw index c7a5c62..d04204b 100755 --- a/bin/mw +++ b/bin/mw @@ -97,7 +97,7 @@ bind index,pager g noop bind index,pager M noop bind index,pager C noop bind index gg first-entry -macro index o \"mailsync -V $title\" \"run mbsync to sync $title\" +macro index o \"mbsync -V $title\" \"run mbsync to sync $title\" unmailboxes * " else @@ -286,27 +286,6 @@ delete() { sed -ibu "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc" ; sed -ibu "/account $title/,/^\(\s*$\|account\)/d" "$msmtprc"; rm -f "$msmtprc"bu } -choosecron() { ! pgrep cron >/dev/null && echo "No cron manager running. Install/enable one and then select this option again." && return 1 - if crontab -l | grep mailsync >/dev/null; then - echo "Active mail sync cronjob detected. Do you want to remove it?" - printf "\033[36m\t" - read -r rmyn - printf "\033[0m" - echo "$rmyn" | grep -i "^y\(es\)*$" >/dev/null && crontab -l | sed '/mailsync/d' | crontab - >/dev/null && echo "Mail sync turned off." - else - echo "How many minutes between each mail sync?" - printf "\033[36m\t" - read -r minnum - printf "\033[0m" - while ! echo "$minnum" | grep "^[0-9]\+$" >/dev/null; do - printf "That doesn't look like a number. How many minutes between each mail sync?\\n\033[36m\t" - read -r minnum - printf "\033[0m" - done - (crontab -l; echo "*/$minnum * * * * $(type mailsync | cut -d' ' -f3) >/dev/null 2>&1") | crontab - >/dev/null && - echo "Cronjob added. Mail will sync every $minnum minutes. Be sure you have your cron manager running." - fi ;} - asktype() { while : ; do printf "Do you want to keep your mail for this account offline with mbsync? [yes/no]\\n\t" read -r offnot @@ -318,11 +297,17 @@ asktype() { while : ; do purge() { confirm "delete all account data" || exit rm -rf "$mbsyncrc" "$accdir" "$HOME/.config/msmtp" "$cachedir" - crontab -l | sed '/mailsync/d' | crontab - >/dev/null echo "All configs and account settings have been purged." sed -ibu "/\# mw-autogenerated/d" "$muttrc" ; rm -f "$muttrc"bu } +syncwrapper() { mbsync -a & + ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null + wait + ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null + notmuch new +} + notmuchauto() { \ [ -z "$NOTMUCH_CONFIG" ] && NOTMUCH_CONFIG="$HOME/.notmuch-config" [ -f "$NOTMUCH_CONFIG" ] && return 0 @@ -349,8 +334,8 @@ case "$1" in add) asktype && askinfo && tryconnect && finalize || delete ;; pass) pick "change the password of" && getpass ;; delete) pick delete && confirm "delete the \`$title\` profile" && delete ;; + sync) syncwrapper ;; purge) purge ;; - cron) choosecron ;; *) cat << EOF mw: mutt-wizard, auto-configure email accounts for mutt including downloadable mail with \`isync\`. @@ -360,7 +345,7 @@ Allowed options: ls List configured accounts delete Pick an account to delete purge Delete all accounts and settings - cron Enable or disable an autosync via cronjob + sync Syncs mail and updates notmuch database all else Print this message NOTE: Once at least one account is added, you can run From 16188017b29b58708593963ae894a13c5251d9d7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 9 Jul 2020 17:55:56 -0400 Subject: [PATCH 40/58] like i said... --- bin/mailsync | 71 ---------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100755 bin/mailsync diff --git a/bin/mailsync b/bin/mailsync deleted file mode 100755 index 93ec35d..0000000 --- a/bin/mailsync +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -# Sync mail and give notification if there is new mail. - -# Run only if user logged in (prevent cron errors) -pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} -# Run only if not already running in other instance -pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;} - -# Checks for internet connection and set notification script. -ping -q -c 1 1.1.1.1 > /dev/null || ping -q -c 1 1.0.0.1 > /dev/null || ping -q -c 1 example.org || { echo "No internet connection detected."; exit ;} -command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotify-send\` should be installed for pop-up mail notifications with this script." - -# Required to display notifications if run as a cronjob: -export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus -export DISPLAY=:0.0 - -# For individual configurations: -[ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" - -# Settings are different for MacOS (Darwin) systems. -if [ "$(uname)" = "Darwin" ]; then - notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} - messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} -else - notify() { notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;} - messageinfo() { notify-send --app-name="mutt-wizard" "📧$from:" "$subject" ;} -fi - -# Check account for new mail. Notify if there is new content. -syncandnotify() { - acc="$(echo "$account" | sed "s/.*\///")" - if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi - new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null) - newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) - if [ "$newcount" -gt "0" ]; then - notify "$acc" "$newcount" & - for file in $new; do - # Extract subject and sender from mail. - from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') - subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n 1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') - messageinfo & - done - fi -} - -# Sync accounts passed as argument or all. -if [ "$#" -eq "0" ]; then - accounts="$(awk '/^Channel/ {print $2}' "$HOME/.mbsyncrc")" -else - for arg in "$@"; do - [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 - done - accounts=$* -fi - -( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null - -# Parallelize multiple accounts -for account in $accounts -do - syncandnotify & -done - -wait -( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null - -notmuch new 2>/dev/null - -#Create a touch file that indicates the time of the last run of mailsync -touch "$HOME/.config/mutt/.mailsynclastrun" From 1ace8994f402b9b7e644137f291e1e935ce7c802 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 18 Jul 2020 18:51:30 -0400 Subject: [PATCH 41/58] update man; fix #497 --- mw.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mw.1 b/mw.1 index 217ae2b..55ad43c 100644 --- a/mw.1 +++ b/mw.1 @@ -28,8 +28,8 @@ delete the configuration files for an already configured email account .B purge totally purge all local mutt-wizard accounts .TP -.B cron -toggle a cronjob that will automatically sync mail with +.B sync +sync mail accounts then update notmuch database .B mailsync as often as you wish .SH DETAILS From a2623f77cc77fa26317d7bc6887a215b708db3f4 Mon Sep 17 00:00:00 2001 From: g-w1 <58830309+g-w1@users.noreply.github.com> Date: Sun, 19 Jul 2020 17:58:53 -0400 Subject: [PATCH 42/58] Add audio playback with mailcap and mpv (#499) Allow audio to also be listened to from an email. Did not include setsid because then there would be no way to pause. --- share/mailcap | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mailcap b/share/mailcap index 5bd2471..b355f32 100644 --- a/share/mailcap +++ b/share/mailcap @@ -3,6 +3,7 @@ text/html; openfile %s ; nametemplate=%s.html text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; image/*; openfile %s ; video/*; setsid mpv --quiet %s &; copiousoutput +audio/*; mpv %s ; application/pdf; openfile %s ; application/pgp-encrypted; gpg -d '%s'; copiousoutput; application/pgp-keys; gpg --import '%s'; copiousoutput; From 913c05b145353d920396f07818e0b7dd60415a1f Mon Sep 17 00:00:00 2001 From: Pim Beune <47817451+beune@users.noreply.github.com> Date: Sun, 26 Jul 2020 13:15:17 +0200 Subject: [PATCH 43/58] Update domains.csv (#498) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 69d6432..5b9a8e2 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -317,3 +317,4 @@ ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 zaclys.net,mail.zaclys.net,993,mail.zaclys.net,465 zoho.com,imap.zoho.com,993,smtp.zoho.com,465 zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 +student.utwente.nl,imap.gmail.com,993,smtp.gmail.com,587 From fc610e889857c1a3a250f040c8358d34d8561fb8 Mon Sep 17 00:00:00 2001 From: samadouz <39070773+samadouz@users.noreply.github.com> Date: Sat, 8 Aug 2020 19:08:40 +0200 Subject: [PATCH 44/58] update domains.csv (#507) --- share/domains.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/domains.csv b/share/domains.csv index 5b9a8e2..a8c504e 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -318,3 +318,5 @@ zaclys.net,mail.zaclys.net,993,mail.zaclys.net,465 zoho.com,imap.zoho.com,993,smtp.zoho.com,465 zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 student.utwente.nl,imap.gmail.com,993,smtp.gmail.com,587 +univ-ubs.fr,partage.univ-ubs.fr,993,partage.univ-ubs.fr,587 + From 1492a11b3ee0a1c3f5544a351089ff154521b68b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 8 Aug 2020 13:09:26 -0400 Subject: [PATCH 45/58] sort --- share/domains.csv | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/share/domains.csv b/share/domains.csv index a8c504e..2c17820 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -256,6 +256,7 @@ stud.uni-bamberg.de,outlook.office365.com,993,smtp.office365.com,587 student.binadarma.ac.id,imap.gmail.com,993,smtp.gmail.com,587 student.rmit.edu.au,outlook.office365.com,993,smtp.office365.com,587 student.tuwien.ac.at,mail.student.tuwien.ac.at,993,mail.student.tuwien.ac.at,587 +student.utwente.nl,imap.gmail.com,993,smtp.gmail.com,587 studenti.unipi.it,outlook.office365.com,993,smtp.office365.com,587 students.rmcacs.org,imap.gmail.com,993,smtp.gmail.com,587 students.southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587 @@ -282,6 +283,7 @@ ucdavis.edu,imap.gmail.com,993,smtp.gmail.com,587 uni-duesseldorf.de,mail.hhu.de,993,mail.hhu.de,465 unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 unitybox.de,mail.unity-mail.de,993,mail.unity-mail.de,587 +univ-ubs.fr,partage.univ-ubs.fr,993,partage.univ-ubs.fr,587 uoregon.edu,imap.uoregon.edu,993,smtp.uoregon.edu,587 uqtr.ca,outlook.office365.com,993,smtp.office365.com,587 usa.com,imap.mail.com,993,smtp.mail.com,587 @@ -317,6 +319,3 @@ ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 zaclys.net,mail.zaclys.net,993,mail.zaclys.net,465 zoho.com,imap.zoho.com,993,smtp.zoho.com,465 zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 -student.utwente.nl,imap.gmail.com,993,smtp.gmail.com,587 -univ-ubs.fr,partage.univ-ubs.fr,993,partage.univ-ubs.fr,587 - From 57a3f317ade14ca65c02e29dedc59059b97ea6c2 Mon Sep 17 00:00:00 2001 From: Luke Bubar <43391582+lukerb52@users.noreply.github.com> Date: Wed, 12 Aug 2020 08:38:31 -0400 Subject: [PATCH 46/58] Update domains.csv (#508) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 2c17820..631eff6 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -51,6 +51,7 @@ clasnet.sunyocc.edu,outlook.office365.com,993,smtp.office365.com,587 clerk.com,imap.mail.com,993,smtp.mail.com,587 clubmember.org,imap.mail.com,993,smtp.mail.com,587 cmail.carleton.ca,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +cn.edu,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 cocaine.ninja,mail.cock.li,993,mail.cock.li,587 cock.email,mail.cock.li,993,mail.cock.li,587 cock.li,mail.cock.li,993,mail.cock.li,587 From 2cd21c2db29e0a79a8fb7c667af6bf5b1a962da0 Mon Sep 17 00:00:00 2001 From: "A. Tammy" Date: Thu, 13 Aug 2020 16:02:34 -0400 Subject: [PATCH 47/58] add check for MANPREFIX (#510) --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 70f780d..1d8d362 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,9 @@ OS = $(shell uname -s) ifndef PREFIX PREFIX = /usr/local endif -MANPREFIX = $(PREFIX)/share/man +ifndef MANPREFIX + MANPREFIX = $(PREFIX)/share/man +endif install: mkdir -p $(DESTDIR)$(PREFIX)/bin From aece24c7ddb058589273e5e0b7cc89b70d6a54e1 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 27 Aug 2020 16:38:14 -0400 Subject: [PATCH 48/58] revert auto gpg to fix #491 #484 #493 etc --- bin/mw | 12 ------------ share/mutt-wizard.muttrc | 5 +++++ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/bin/mw b/bin/mw index 41e07e7..c0528de 100755 --- a/bin/mw +++ b/bin/mw @@ -87,11 +87,6 @@ set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies set mbox_type = Maildir -set crypt_autosign = yes -set crypt_opportunistic_encrypt = yes -set pgp_self_encrypt = yes -set pgp_default_key = $keyid - bind index,pager gg noop bind index,pager g noop bind index,pager M noop @@ -113,12 +108,6 @@ set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies set imap_pass = \"\`pass mutt-wizard-$title\`\" -set crypt_autosign = yes -set crypt_opportunistic_encrypt = yes -set pgp_self_encrypt = yes -set pgp_default_key = $keyid - - set mbox_type = Maildir set ssl_starttls = yes set ssl_force_tls = yes @@ -137,7 +126,6 @@ fi askinfo() { \ printf "Insert the \033[31memail address\033[0m that you want to autoconfigure for mutt/mbsync\\n\tEmail: \033[36m" read -r fulladdr - keyid=$("$GPG" --list-keys --with-colons "$fulladdr" | awk -F: '/^pub:/ { print $5 }') printf "\033[0m" while ! echo "$fulladdr" | grep "$emailre" >/dev/null; do printf "That is not a valid \033[31memail address\033[0m, please retype the desired email.\\n\\nEmail: \033[36m\t" diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index aafb3d5..e7fa8c8 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -63,6 +63,11 @@ bind pager \031 previous-line # Mouse wheel bind pager \005 next-line # Mouse wheel bind editor complete-query +#set crypt_autosign = yes +#set crypt_opportunistic_encrypt = yes +#set pgp_self_encrypt = yes +#set pgp_default_key = 'your@gpgemailaddre.ss' + macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" macro index \Cr "T~UN." "mark all messages as read" macro index O "mbsync -a" "run mbsync to sync all mail" From d3f34931a6b27179f34431d1817dab872aea6b99 Mon Sep 17 00:00:00 2001 From: jackhanslope <30721726+jackhanslope@users.noreply.github.com> Date: Thu, 27 Aug 2020 21:42:52 +0100 Subject: [PATCH 49/58] Add @btinternet.com to domains.csv (#513) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 631eff6..a68fab6 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -37,6 +37,7 @@ bjoernguthphotography.de,wp300.webpack.hosteurope.de,993,wp300.webpack.hosteurop bocken.org,imap.gmail.com,993,smtp.gmail.com,465 brew-meister.com,imap.mail.com,993,smtp.mail.com,587 bruttocarattere.org,mail.autistici.org,993,smtp.autistici.org,465 +btinternet.com,mail.btinternet.com,993,mail.btinternet.com,587 canaglie.net,mail.autistici.org,993,smtp.autistici.org,465 canaglie.org,mail.autistici.org,993,smtp.autistici.org,465 carleton.ca,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 From f87acd70421a177b4b63120e6c9c3b17ab3c369f Mon Sep 17 00:00:00 2001 From: "A. Tammy" Date: Thu, 27 Aug 2020 16:43:24 -0400 Subject: [PATCH 50/58] fix regex check for email address (#511) -E option is cross platform and interprets pattern as regular expression always Co-authored-by: Aisha Tammy --- bin/mw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/mw b/bin/mw index c0528de..2d32859 100755 --- a/bin/mw +++ b/bin/mw @@ -14,7 +14,7 @@ muttdir="$HOME/.config/mutt" # Main mutt config location accdir="$muttdir/accounts" # Directory for account settings maildir="$HOME/.local/share/mail" # Location of mail storage namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username -emailre=".\+@.\+\\..\+" # Regex to confirm valid email address +emailre=".+@.+\..+" # Regex to confirm valid email address muttshare="$prefix/share/mutt-wizard" mbsyncrc="$HOME/.mbsyncrc" mwconfig="$muttshare/mutt-wizard.muttrc" @@ -127,7 +127,7 @@ askinfo() { \ printf "Insert the \033[31memail address\033[0m that you want to autoconfigure for mutt/mbsync\\n\tEmail: \033[36m" read -r fulladdr printf "\033[0m" - while ! echo "$fulladdr" | grep "$emailre" >/dev/null; do + while ! echo "$fulladdr" | grep -E "$emailre" >/dev/null; do printf "That is not a valid \033[31memail address\033[0m, please retype the desired email.\\n\\nEmail: \033[36m\t" read -r fulladdr printf "\033[0m" From abe90a1bc4a2ceee3580fad2e8e25fad0a06ec35 Mon Sep 17 00:00:00 2001 From: Alexander Bocken <32177905+AlexBocken@users.noreply.github.com> Date: Thu, 27 Aug 2020 22:45:43 +0200 Subject: [PATCH 51/58] updated 2 domains (#481) --- share/domains.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index a68fab6..a6abfc6 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -34,7 +34,7 @@ bikerider.com,imap.mail.com,993,smtp.mail.com,587 billycarlyle.uk,mail.muny.us,993,mail.muny.us,465 birdlover.com,imap.mail.com,993,smtp.mail.com,587 bjoernguthphotography.de,wp300.webpack.hosteurope.de,993,wp300.webpack.hosteurope.de,587 -bocken.org,imap.gmail.com,993,smtp.gmail.com,465 +bocken.org,mail.bocken.org,993,mail.bocken.org,587 brew-meister.com,imap.mail.com,993,smtp.mail.com,587 bruttocarattere.org,mail.autistici.org,993,smtp.autistici.org,465 btinternet.com,mail.btinternet.com,993,mail.btinternet.com,587 @@ -256,6 +256,7 @@ stud.tu-darmstadt.de,imap.stud.tu-darmstadt.de,993,smtp.tu-darmstadt.de,465 stud.uis.no,outlook.office365.com,993,smtp.office365.com,587 stud.uni-bamberg.de,outlook.office365.com,993,smtp.office365.com,587 student.binadarma.ac.id,imap.gmail.com,993,smtp.gmail.com,587 +student.ethz.ch,mail.ethz.ch,993,mail.ethz.ch,587 student.rmit.edu.au,outlook.office365.com,993,smtp.office365.com,587 student.tuwien.ac.at,mail.student.tuwien.ac.at,993,mail.student.tuwien.ac.at,587 student.utwente.nl,imap.gmail.com,993,smtp.gmail.com,587 From 9910b434c2a1ce21dc7f5db7336b78eb645d959b Mon Sep 17 00:00:00 2001 From: Lorenzo Leonardini Date: Thu, 27 Aug 2020 22:46:36 +0200 Subject: [PATCH 52/58] Top-level domain wildcard (#475) --- bin/mw | 4 +++ share/domains.csv | 77 ++++++----------------------------------------- 2 files changed, 14 insertions(+), 67 deletions(-) diff --git a/bin/mw b/bin/mw index 2d32859..f8d9d7b 100755 --- a/bin/mw +++ b/bin/mw @@ -149,6 +149,10 @@ askinfo() { \ esac printf "\\nSearching for \033[32m%s\033[0m in \033[34m\`domains.csv\`\033[0m..." "$domain" serverinfo="$(grep "^$search_query" "$muttshare/domains.csv" 2>/dev/null)" + if [ -z "$serverinfo" ]; then + search_query=$(echo "$search_query" | sed "s/\.[^\.]*$/\.\\\*/") + serverinfo="$(grep "^$search_query" "$muttshare/domains.csv" 2>/dev/null)" + fi if [ -z "$serverinfo" ]; then printf "Your email domain is not in mutt-wizard's database yet.\\nmutt-wizard will still autoconfigure everything, but you will have to manually type in your service's IMAP and SMTP server information.\\nYou can usually quickly find this by internet searching for it.\\n" printf "Insert the IMAP server for your email provider (excluding the port number)\\n\033[36m\t" diff --git a/share/domains.csv b/share/domains.csv index a6abfc6..9db3601 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -96,64 +96,20 @@ fsu-jena,exchange.uni-jena.de,993,smtp.uni-jena.de,587 gcc.edu,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 getbackinthe.kitchen,mail.cock.li,993,mail.cock.li,587 gmail.com,imap.gmail.com,993,smtp.gmail.com,587 -gmx.at,imap.gmx.net,993,mail.gmx.net,587 -gmx.com,imap.gmx.net,993,mail.gmx.net,587 -gmx.de,imap.gmx.net,993,mail.gmx.net,587 -gmx.eu,imap.gmx.net,993,mail.gmx.net,587 -gmx.fr,imap.gmx.com,993,mail.gmx.com,587 -gmx.info,imap.gmx.net,993,mail.gmx.net,587 -gmx.net,imap.gmx.net,993,mail.gmx.net,587 -gmx.org,imap.gmx.net,993,mail.gmx.net,587 +gmx.*,imap.gmx.net,993,mail.gmx.net,587 go2.pl,poczta.o2.pl,993,poczta.o2.pl,465 goat.si,mail.cock.li,993,mail.cock.li,587 googlemail.com,imap.googlemail.com,993,smtp.googlemail.com,587 grrlz.net,mail.autistici.org,993,smtp.autistici.org,465 -hacari.com,mail.autistici.org,993,smtp.autistici.org,465 -hacari.net,mail.autistici.org,993,smtp.autistici.org,465 -hacari.org,mail.autistici.org,993,smtp.autistici.org,465 +hacari.*,mail.autistici.org,993,smtp.autistici.org,465 helsinki.fi,outlook.office365.com,993,smtp.helsinki.fi,587 hhu.de,mail.hhu.de,993,mail.hhu.de,465 hitler.rocks,mail.cock.li,993,mail.cock.li,587 horsefucker.org,mail.cock.li,993,mail.cock.li,587 hostgator,gator4171.hostgator.com,993,gator4171.hostgator.com,587 -hotmail.be,outlook.office365.com,993,smtp.office365.com,587 -hotmail.ca,outlook.office365.com,993,smtp.office365.com,587 -hotmail.cl,outlook.office365.com,993,smtp.office365.com,587 -hotmail.co.id,outlook.office365.com,993,smtp.office365.com,587 -hotmail.co.il,outlook.office365.com,993,smtp.office365.com,587 -hotmail.co.in,outlook.office365.com,993,smtp.office365.com,587 -hotmail.co.jp,outlook.office365.com,993,smtp.office365.com,587 -hotmail.co.kr,outlook.office365.com,993,smtp.office365.com,587 -hotmail.co.th,outlook.office365.com,993,smtp.office365.com,587 -hotmail.co.uk,outlook.office365.com,993,smtp.office365.com,587 -hotmail.co.za,outlook.office365.com,993,smtp.office365.com,587 -hotmail.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 -hotmail.com.ar,outlook.office365.com,993,smtp.office365.com,587 -hotmail.com.au,outlook.office365.com,993,smtp.office365.com,587 -hotmail.com.br,outlook.office365.com,993,smtp.office365.com,587 -hotmail.com.hk,outlook.office365.com,993,smtp.office365.com,587 -hotmail.com.tr,outlook.office365.com,993,smtp.office365.com,587 -hotmail.com.tw,outlook.office365.com,993,smtp.office365.com,587 -hotmail.com.vn,outlook.office365.com,993,smtp.office365.com,587 -hotmail.cz,outlook.office365.com,993,smtp.office365.com,587 -hotmail.de,outlook.office365.com,993,smtp.office365.com,587 -hotmail.dk,outlook.office365.com,993,smtp.office365.com,587 -hotmail.es,outlook.office365.com,993,smtp.office365.com,587 -hotmail.fi,outlook.office365.com,993,smtp.office365.com,587 -hotmail.fr,outlook.office365.com,993,smtp.office365.com,587 -hotmail.gr,outlook.office365.com,993,smtp.office365.com,587 -hotmail.hu,outlook.office365.com,993,smtp.office365.com,587 -hotmail.it,outlook.office365.com,993,smtp.office365.com,587 -hotmail.lt,outlook.office365.com,993,smtp.office365.com,587 -hotmail.lv,outlook.office365.com,993,smtp.office365.com,587 -hotmail.my,outlook.office365.com,993,smtp.office365.com,587 -hotmail.nl,outlook.office365.com,993,smtp.office365.com,587 -hotmail.no,outlook.office365.com,993,smtp.office365.com,587 -hotmail.ph,outlook.office365.com,993,smtp.office365.com,587 -hotmail.rs,outlook.office365.com,993,smtp.office365.com,587 -hotmail.se,outlook.office365.com,993,smtp.office365.com,587 -hotmail.sg,outlook.office365.com,993,smtp.office365.com,587 -hotmail.sk,outlook.office365.com,993,smtp.office365.com,587 +hotmail.*,outlook.office365.com,993,smtp.office365.com,587 +hotmail.co.*,outlook.office365.com,993,smtp.office365.com,587 +hotmail.com.*,outlook.office365.com,993,smtp.office365.com,587 hs-mittweida.de,mail.hs-mittweida.de,993,mail.hs-mittweida.de,465 humbug.pw,imap.migadu.com,993,smtp.migadu.com,587 hushmail.com,imap.hushmail.com,993,smtp.hushmail.com,465 @@ -166,8 +122,7 @@ infomaniak.com,imap.infomaniak.com,993,imap.infomaniak.com,587 insiberia.net,mail.autistici.org,993,smtp.autistici.org,465 insicuri.net,mail.autistici.org,993,smtp.autistici.org,465 interactio.io,imap.gmail.com,993,smtp.gmail.com,587 -interia.eu,poczta.interia.pl,993,poczta.interia.pl,465 -interia.pl,poczta.interia.pl,993,poczta.interia.pl,465 +interia.*,poczta.interia.pl,993,poczta.interia.pl,465 inventati.org,mail.autistici.org,993,smtp.autistici.org,465 ionos.de,imap.ionos.de,993,smtp.ionos.de,587 itu.dk,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 @@ -220,9 +175,7 @@ online.de,imap.1und1.de,993,smtp.1und1.de,465 op.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 opoczta.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 orange.fr,imap.orange.fr,993,smtp.orange.fr,465 -outlook.at,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 -outlook.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 -outlook.de,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 +outlook.*,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 outlook.es,outlook.office365.com,993,smtp.office365.com,587 paranoici.org,mail.autistici.org,993,smtp.autistici.org,465 pm.me,127.0.0.1,1143,127.0.0.1,1025 @@ -230,10 +183,8 @@ poczta.fm,poczta.interia.pl,993,poczta.interia.pl,465 poczta.onet.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 polimi.it,outlook.office365.com,993,smtp.office365.com,587 polito.it,mail.polito.it,993,mail.polito.it,465 -polito.it,mail.polito.it,993,mail.polito.it,465 post.com,imap.mail.com,993,smtp.mail.com,587 -posteo.de,posteo.de,993,posteo.de,587 -posteo.net,posteo.de,993,posteo.de,587 +posteo.*,posteo.de,993,posteo.de,587 privacyrequired.com,mail.autistici.org,993,smtp.autistici.org,465 prokonto.pl,poczta.o2.pl,993,poczta.o2.pl,465 protonmail.ch,127.0.0.1,1143,127.0.0.1,1025 @@ -264,7 +215,6 @@ studenti.unipi.it,outlook.office365.com,993,smtp.office365.com,587 students.rmcacs.org,imap.gmail.com,993,smtp.gmail.com,587 students.southwales.ac.uk,imap.gmail.com,993,smtp.gmail.com,587 studio.unibo.it,outlook.office365.com,993,smtp.office365.com,587 -studio.unibo.it,outlook.office365.com,993,smtp.office365.com,587 studserv.uni-leipzig.de,studserv.uni-leipzig.de,993,studserv.uni-leipzig.de,25 subvertising.org,mail.autistici.org,993,smtp.autistici.org,465 t-online.de,secureimap.t-online.de,993,securesmtp.t-online.de,465 @@ -309,15 +259,8 @@ wit.edu,outlook.office365.com,993,smtp.office365.com,587 wp.pl,imap.wp.pl,993,smtp.wp.pl,465 writeme.com,imap.mail.com,993,smtp.mail.com,587 ya.ru,imap.yandex.com,993,smtp.yandex.com,587 -yahoo.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,587 -yahoo.fr,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,587 -yahoo.gr,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,587 -yandex.by,imap.yandex.com,993,smtp.yandex.com,587 -yandex.com,imap.yandex.com,993,smtp.yandex.com,587 -yandex.kz,imap.yandex.com,993,smtp.yandex.com,587 -yandex.net,imap.yandex.com,993,smtp.yandex.com,587 -yandex.ru,imap.yandex.com,993,smtp.yandex.com,587 -yandex.ua,imap.yandex.com,993,smtp.yandex.com,587 +yahoo.*,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,587 +yandex.*,imap.yandex.com,993,smtp.yandex.com,587 ymail.com,imap.mail.yahoo.com,993,smtp.mail.yahoo.com,465 zaclys.net,mail.zaclys.net,993,mail.zaclys.net,465 zoho.com,imap.zoho.com,993,smtp.zoho.com,465 From 38213235727efb7e70a67d8bf3d92a13a2c479eb Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 27 Aug 2020 16:54:06 -0400 Subject: [PATCH 53/58] mw sync can take arg, otherwise sync all --- bin/mw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/mw b/bin/mw index c0528de..c83274f 100755 --- a/bin/mw +++ b/bin/mw @@ -289,7 +289,7 @@ purge() { confirm "delete all account data" || exit sed -ibu "/\# mw-autogenerated/d" "$muttrc" ; rm -f "$muttrc"bu } -syncwrapper() { mbsync -a & +syncwrapper() { mbsync "${1:--a}" & ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null wait ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null @@ -322,7 +322,7 @@ case "$1" in add) asktype && askinfo && tryconnect && finalize || delete ;; pass) pick "change the password of" && getpass ;; delete) pick delete && confirm "delete the \`$title\` profile" && delete ;; - sync) syncwrapper ;; + sync) syncwrapper $2 ;; purge) purge ;; *) cat << EOF mw: mutt-wizard, auto-configure email accounts for mutt From 06f416f5eb73c4d01df25046d17a1cfdbfb116ae Mon Sep 17 00:00:00 2001 From: Jonassenher Date: Sun, 30 Aug 2020 18:28:21 +0200 Subject: [PATCH 54/58] Support for XDG Base Directory Today's mutt-wizard does not support the XDG Base Directory specifications (https://wiki.archlinux.org/index.php/XDG_Base_Directory) because it says the user should be able to change the config, cache, data folders etc. using the environmental variables XDG_CONFIG_HOME, XDG_CACHE_HOME, and XDG_DATA_HOME, and instead hard codes the default paths ~/.config, ~/.cache, and ~/.local/share. My commit corrects this. --- bin/mw | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/mw b/bin/mw index 9f39cc4..fffc965 100755 --- a/bin/mw +++ b/bin/mw @@ -10,17 +10,17 @@ command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" ! command -v mbsync >/dev/null && printf "\`mbsync (isync package)\` must be installed to run mutt-wizard.\\n" && exit prefix="/usr/local" -muttdir="$HOME/.config/mutt" # Main mutt config location +muttdir="${XDG_CONFIG_HOME:-$HOME/.config}/mutt" # Main mutt config location accdir="$muttdir/accounts" # Directory for account settings -maildir="$HOME/.local/share/mail" # Location of mail storage +maildir="${XDG_DATA_HOME:-$HOME/.local/share}/mail" # Location of mail storage namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username emailre=".+@.+\..+" # Regex to confirm valid email address muttshare="$prefix/share/mutt-wizard" -mbsyncrc="$HOME/.mbsyncrc" +mbsyncrc="${MBSYNCRC_HOME:-$HOME/.mbsyncrc}" mwconfig="$muttshare/mutt-wizard.muttrc" -cachedir="$HOME/.cache/mutt-wizard" +cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" muttrc="$muttdir/muttrc" -msmtprc="$HOME/.config/msmtp/config" +msmtprc="${XDG_CACHE_HOME:-$HOME/.config}/msmtp/config" ssltype="IMAPS" # This is later changed to `None` later in the script if using Protonmail for x in "/etc/ssl/certs/ca-certificates.crt" "/etc/pki/tls/certs/ca-bundle.crt" "/etc/ssl/ca-bundle.pem" "/etc/pki/tls/cacert.pem" "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" "/etc/ssl/cert.pem" "/usr/local/share/ca-certificates/" @@ -38,7 +38,7 @@ msmtp_header="defaults auth on tls on tls_trust_file $sslcert -logfile ~/.config/msmtp/msmtp.log +logfile $XDG_CONFIG_HOME/msmtp/msmtp.log " msmtp_profile="account $title host $smtp @@ -59,8 +59,8 @@ CertificateFile $sslcert MaildirStore $title-local Subfolders Verbatim -Path ~/.local/share/mail/$title/ -Inbox ~/.local/share/mail/$title/INBOX +Path $XDG_DATA_HOME/mail/$title/ +Inbox $XDG_DATA_HOME/mail/$title/INBOX Flatten . Channel $title From d60d2398869796ee1fd7e6c424afe11654e2e702 Mon Sep 17 00:00:00 2001 From: Jonassenher Date: Sun, 30 Aug 2020 19:02:15 +0200 Subject: [PATCH 55/58] Fixed the case for no environmental variables --- bin/mw | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/mw b/bin/mw index fffc965..5e5a610 100755 --- a/bin/mw +++ b/bin/mw @@ -38,7 +38,7 @@ msmtp_header="defaults auth on tls on tls_trust_file $sslcert -logfile $XDG_CONFIG_HOME/msmtp/msmtp.log +logfile ${XDG_CONFIG_HOME/:-$HOME/.config}/msmtp/msmtp.log " msmtp_profile="account $title host $smtp @@ -59,8 +59,8 @@ CertificateFile $sslcert MaildirStore $title-local Subfolders Verbatim -Path $XDG_DATA_HOME/mail/$title/ -Inbox $XDG_DATA_HOME/mail/$title/INBOX +Path ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$title/ +Inbox ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$title/INBOX Flatten . Channel $title From f00fa04f15c479dd32dbd9802602f6adbcefbbed Mon Sep 17 00:00:00 2001 From: Jonassenher Date: Sun, 30 Aug 2020 19:26:10 +0200 Subject: [PATCH 56/58] Fixed mbsync using the correct rc file --- bin/mw | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/mw b/bin/mw index 5e5a610..c0c6f7a 100755 --- a/bin/mw +++ b/bin/mw @@ -10,11 +10,11 @@ command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" ! command -v mbsync >/dev/null && printf "\`mbsync (isync package)\` must be installed to run mutt-wizard.\\n" && exit prefix="/usr/local" -muttdir="${XDG_CONFIG_HOME:-$HOME/.config}/mutt" # Main mutt config location -accdir="$muttdir/accounts" # Directory for account settings +muttdir="${XDG_CONFIG_HOME:-$HOME/.config}/mutt" # Main mutt config location +accdir="$muttdir/accounts" # Directory for account settings maildir="${XDG_DATA_HOME:-$HOME/.local/share}/mail" # Location of mail storage -namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username -emailre=".+@.+\..+" # Regex to confirm valid email address +namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username +emailre=".+@.+\..+" # Regex to confirm valid email address muttshare="$prefix/share/mutt-wizard" mbsyncrc="${MBSYNCRC_HOME:-$HOME/.mbsyncrc}" mwconfig="$muttshare/mutt-wizard.muttrc" @@ -22,6 +22,7 @@ cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" muttrc="$muttdir/muttrc" msmtprc="${XDG_CACHE_HOME:-$HOME/.config}/msmtp/config" ssltype="IMAPS" # This is later changed to `None` later in the script if using Protonmail +alias mbsync='mbsync -c "$mbsyncrc"' for x in "/etc/ssl/certs/ca-certificates.crt" "/etc/pki/tls/certs/ca-bundle.crt" "/etc/ssl/ca-bundle.pem" "/etc/pki/tls/cacert.pem" "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" "/etc/ssl/cert.pem" "/usr/local/share/ca-certificates/" do From 8b1ba846d03009e4e771725727856f58be1c33cf Mon Sep 17 00:00:00 2001 From: Jonassenher Date: Sun, 30 Aug 2020 21:22:35 +0200 Subject: [PATCH 57/58] fix --- bin/mw | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/mw b/bin/mw index c0c6f7a..57fd7b5 100755 --- a/bin/mw +++ b/bin/mw @@ -20,7 +20,7 @@ mbsyncrc="${MBSYNCRC_HOME:-$HOME/.mbsyncrc}" mwconfig="$muttshare/mutt-wizard.muttrc" cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" muttrc="$muttdir/muttrc" -msmtprc="${XDG_CACHE_HOME:-$HOME/.config}/msmtp/config" +msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config" ssltype="IMAPS" # This is later changed to `None` later in the script if using Protonmail alias mbsync='mbsync -c "$mbsyncrc"' @@ -193,7 +193,7 @@ EOF echo "$maxmes" | grep "[1-9]" >/dev/null || maxmes="0" getpass getprofiles - mkdir -p "$muttdir" "$accdir" "$cachedir/$title/bodies" "$HOME/.config/msmtp" + mkdir -p "$muttdir" "$accdir" "$cachedir/$title/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" getaccounts for x in $(seq 1 9); do echo "$accounts" | grep "$x" >/dev/null 2>&1 || { export idnum="$x"; break ;}; done [ ! -f "$msmtprc" ] && echo "$msmtp_header" > "$msmtprc" @@ -203,6 +203,7 @@ EOF protonmail.ch|protonmail.com|pm.me) protonfinger || return 1 ;; esac echo "$mutt_profile" > "$accdir/$idnum-$title.muttrc" + mkdir -p "${mbsyncrc%/*}" echo "$mbsync_profile" >> "$mbsyncrc" notmuchauto [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created." @@ -289,7 +290,7 @@ asktype() { while : ; do esac; done ;} purge() { confirm "delete all account data" || exit - rm -rf "$mbsyncrc" "$accdir" "$HOME/.config/msmtp" "$cachedir" + rm -rf "$mbsyncrc" "$accdir" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$cachedir" echo "All configs and account settings have been purged." sed -ibu "/\# mw-autogenerated/d" "$muttrc" ; rm -f "$muttrc"bu } From 113499cf740a7a4473ac33414ec833d4fd9c9633 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 31 Aug 2020 16:57:19 -0400 Subject: [PATCH 58/58] tweaks --- bin/mw | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/mw b/bin/mw index 57fd7b5..ca090c3 100755 --- a/bin/mw +++ b/bin/mw @@ -16,11 +16,12 @@ maildir="${XDG_DATA_HOME:-$HOME/.local/share}/mail" # Location of mail storage namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username emailre=".+@.+\..+" # Regex to confirm valid email address muttshare="$prefix/share/mutt-wizard" -mbsyncrc="${MBSYNCRC_HOME:-$HOME/.mbsyncrc}" +mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}" mwconfig="$muttshare/mutt-wizard.muttrc" cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" muttrc="$muttdir/muttrc" msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config" +msmtplog="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/msmtp.log" ssltype="IMAPS" # This is later changed to `None` later in the script if using Protonmail alias mbsync='mbsync -c "$mbsyncrc"' @@ -39,7 +40,7 @@ msmtp_header="defaults auth on tls on tls_trust_file $sslcert -logfile ${XDG_CONFIG_HOME/:-$HOME/.config}/msmtp/msmtp.log +logfile $msmtplog " msmtp_profile="account $title host $smtp @@ -328,7 +329,7 @@ case "$1" in add) asktype && askinfo && tryconnect && finalize || delete ;; pass) pick "change the password of" && getpass ;; delete) pick delete && confirm "delete the \`$title\` profile" && delete ;; - sync) syncwrapper $2 ;; + sync) syncwrapper "$2" ;; purge) purge ;; *) cat << EOF mw: mutt-wizard, auto-configure email accounts for mutt