From 789f5932720fb05a232460ad89a8ef5fb8e46454 Mon Sep 17 00:00:00 2001 From: Lingyu Zhu <302590304@qq.com> Date: Sun, 5 Apr 2020 21:11:55 +0800 Subject: [PATCH 001/101] remove unnecessary prefix setting up msmtp. (#401) the prefix is not correct at least for Ubuntu distro. Since doc clearly states the dependencis. We assume msmpt is on the PATH environment. Co-authored-by: Lingyu Zhu --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index e7a673a..862f937 100755 --- a/bin/mw +++ b/bin/mw @@ -101,7 +101,7 @@ mutt_profile="# vim: filetype=neomuttrc # muttrc file for account $title set realname = \"$realname\" set from = \"$fulladdr\" -set sendmail = \"$prefix/bin/msmtp -a $title\" +set sendmail = \"msmtp -a $title\" alias me $realname <$fulladdr> set folder = \"imaps://$fulladdr@$imap:$iport\" set imap_user = \"$login\" From 11374f4182d73620dc45bad91e70ce21b9369d08 Mon Sep 17 00:00:00 2001 From: Leo Liu <38640768+leoliu0@users.noreply.github.com> Date: Fri, 10 Apr 2020 13:19:44 +1000 Subject: [PATCH 002/101] add ad.unsw.edu.au (#408) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 6b6aa7e..4476d65 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -4,6 +4,7 @@ ADDRESS,IMAP,imap port,SMTP,smtp port aaathats3as.com,mail.cock.li,993,mail.cock.li,587 accountant.com,imap.mail.com,993,smtp.mail.com,587 activist.com,imap.mail.com,993,smtp.mail.com,587 +ad.unsw.edu.au,outlook.office365.com,993,smtp.office365.com,587 adexec.com,imap.mail.com,993,smtp.mail.com,587 airmail.cc,mail.cock.li,993,mail.cock.li,587 allergist.com,imap.mail.com,993,smtp.mail.com,587 From f6ae7ddaf0a01373feffea3d56346bf39d8336d6 Mon Sep 17 00:00:00 2001 From: sudoLife Date: Fri, 10 Apr 2020 19:36:20 +0300 Subject: [PATCH 003/101] Fix a double "for" in manual (#409) --- mw.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mw.1 b/mw.1 index 2f04a48..c866c83 100644 --- a/mw.1 +++ b/mw.1 @@ -56,7 +56,7 @@ Neither .B delete or .B purge -will delete downloaded mail for for safety (and time)'s sake. If you want to delete downloaded mail, do so manually by removing it from the directory above. +will delete downloaded mail for safety (and time)'s sake. If you want to delete downloaded mail, do so manually by removing it from the directory above. .TP .B Default settings The mutt-wizard has many default settings that focus on making it aesthetically pleasing and supplying more vim-like bindings. These can be found in From 6a4afea526d1d102e2939f4f7e31bad13569ca12 Mon Sep 17 00:00:00 2001 From: dt098 <48135605+dt098@users.noreply.github.com> Date: Fri, 10 Apr 2020 23:14:36 +0200 Subject: [PATCH 004/101] Update domains.csv (#410) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 4476d65..001cd32 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -302,3 +302,4 @@ 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 From 50f227b4535ecd4b13b122ace7872468fa1ddc65 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 10 Apr 2020 22:45:33 -0400 Subject: [PATCH 005/101] blocks for STATUSBAR apparently works... --- bin/mailsync | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 326279c..32c0825 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -17,7 +17,6 @@ export DISPLAY=:0.0 # For individual configurations: [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" -pgrep i3blocks >/dev/null && STATUSBAR="i3blocks" || STATUSBAR="dwmblocks" # Settings are different for MacOS (Darwin) systems. if [ "$(uname)" = "Darwin" ]; then @@ -51,7 +50,7 @@ else fi echo " 🔃" > /tmp/imapsyncicon_"$USER" -( pkill -RTMIN+12 "${STATUSBAR:?}" >/dev/null 2>&1 ) 2>/dev/null +( pkill -RTMIN+12 "${STATUSBAR:-blocks}" >/dev/null 2>&1 ) 2>/dev/null # Parallelize multiple accounts for account in $accounts @@ -61,7 +60,7 @@ done wait rm -f /tmp/imapsyncicon_"$USER" -( pkill -RTMIN+12 "${STATUSBAR:?}" >/dev/null 2>&1 ) 2>/dev/null +( pkill -RTMIN+12 "${STATUSBAR:-blocks}" >/dev/null 2>&1 ) 2>/dev/null notmuch new 2>/dev/null From 7c980ec6fbc4e51f3fa663a541de4ff5a4f6587f Mon Sep 17 00:00:00 2001 From: ofwinterpassed Date: Sun, 12 Apr 2020 14:29:58 +0200 Subject: [PATCH 006/101] adding librem.one server info (#411) Co-authored-by: Johannes Christenson --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 001cd32..33217be 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -167,6 +167,7 @@ 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 lavabit.com,lavabit.com,993,lavabit.com,587 +librem.one,imap.librem.one,993,smtp.librem.one,465 linuxmail.org,imap.mail.com,993,smtp.mail.com,587 live.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 live.de,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 From 946abe8f5fc97524cb58b8049bf2b37e71f55901 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 17 Apr 2020 10:21:59 -0400 Subject: [PATCH 007/101] 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 008/101] 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 009/101] 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 010/101] 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 011/101] 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 012/101] 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 013/101] 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 014/101] 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 015/101] 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 016/101] 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 017/101] 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 018/101] 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 019/101] 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 020/101] 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 021/101] 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 022/101] 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 023/101] 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 024/101] 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 025/101] 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 026/101] 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 027/101] 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 028/101] 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 029/101] 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 030/101] 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 031/101] 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 032/101] 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 033/101] 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 034/101] 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 035/101] 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 036/101] 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 037/101] 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 038/101] 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 039/101] + 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 040/101] 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 041/101] 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 042/101] 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 043/101] 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 044/101] 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 045/101] 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 046/101] 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 047/101] 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 048/101] 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 049/101] 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 050/101] 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 051/101] 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 052/101] 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 053/101] 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 054/101] 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 055/101] 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 056/101] 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 057/101] 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 058/101] 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 059/101] 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 060/101] 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 061/101] 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 062/101] 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 063/101] 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 064/101] 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 From 289533279b21f0fc6ecbdf03ebde2a67741e3ded Mon Sep 17 00:00:00 2001 From: Ethan Rietz Date: Wed, 2 Sep 2020 08:11:22 -0400 Subject: [PATCH 065/101] Update domains.csv (#519) 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 9db3601..6735872 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -126,6 +126,7 @@ 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 +iu.edu,imap.exchange.iu.edu,993,mail-relay.iu.edu,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 @@ -264,4 +265,4 @@ 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 -zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 +zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 \ No newline at end of file From 032077adf6a7f7d56b48df5c4f879b207155dd55 Mon Sep 17 00:00:00 2001 From: "A. Tammy" Date: Sun, 6 Sep 2020 15:58:53 -0400 Subject: [PATCH 066/101] fix notmuch integration caller command (#520) Co-authored-by: Aisha Tammy --- 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 e7fa8c8..c3dae24 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -71,7 +71,7 @@ bind editor complete-query 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" -macro index \Cf "unset wait_keyread -p 'Enter a search term to find with notmuch: ' x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" +macro index \Cf "unset wait_keyread x?'Enter a search term to find with notmuch: '; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" macro index A "all\n" "show all messages (undo limit)" # Sidebar mappings From 95cf003c036dd95000ab80ca6c680dab2e3ca092 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 6 Sep 2020 16:00:58 -0400 Subject: [PATCH 067/101] larbs address added --- share/domains.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index 6735872..cfda62c 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -132,6 +132,7 @@ 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 lavabit.com,lavabit.com,993,lavabit.com,587 +larbs.xyz,mail.larbs.xyz,993,mail.larbs.xyz,587 librem.one,imap.librem.one,993,smtp.librem.one,465 linuxmail.org,imap.mail.com,993,smtp.mail.com,587 live.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 @@ -265,4 +266,4 @@ 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 -zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 \ No newline at end of file +zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 From 50ae4af96738e32e6a7ebdd04641b4fdaa3d30f8 Mon Sep 17 00:00:00 2001 From: Nicholas <39540565+NicholasDefranco@users.noreply.github.com> Date: Tue, 8 Sep 2020 09:33:41 -0400 Subject: [PATCH 068/101] Added Seneca College to domains.csv (#521) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index cfda62c..3e8eb80 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -158,6 +158,7 @@ mortemale.org,mail.autistici.org,993,smtp.autistici.org,465 msn.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 muny.us,mail.muny.us,993,mail.muny.us,465 myself.com,imap.mail.com,993,smtp.mail.com,587 +myseneca.ca,outlook.office365.com,993,outlook.office365.com,587 narod.ru,imap.yandex.com,993,smtp.yandex.com,587 national.shitposting.agency,mail.cock.li,993,mail.cock.li,587 ncsu.edu,imap.gmail.com,993,smtp.gmail.com,587 From 90de356b8aa89a52f2cf8ca2b23607189616ab84 Mon Sep 17 00:00:00 2001 From: beldi961 <55185525+beldi961@users.noreply.github.com> Date: Wed, 9 Sep 2020 15:02:24 +0200 Subject: [PATCH 069/101] =?UTF-8?q?Added=20Friedrich-Schiller-Universit?= =?UTF-8?q?=C3=A4t=20Jena=20(#522)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 3e8eb80..4a77edd 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -237,6 +237,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 +uni-jena.de,imap.uni-jena.de,993,smtp.uni-jena.de,587 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 From 5076fa59e3bc6f56ae81c963c18e2186762ef08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Povoln=C3=BD?= Date: Sun, 13 Sep 2020 19:42:20 +0200 Subject: [PATCH 070/101] added seznam.cz and FEEC BUT mail (#524) added settings for Czech mail provider seznam.cz and a faculty e-mail for Faculty of Electrical Engineering and Communication, Brno University of Technology --- share/domains.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/domains.csv b/share/domains.csv index 4a77edd..800c2d6 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -200,12 +200,14 @@ 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 +seznam.cz,imap.seznam.cz,993,smtp.seznam.cz,465 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.feec.vutbr.cz,imap.stud.feec.vutbr.cz,993,smtp.stud.feec.vutbr.cz,587 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 From dba3bcf9e6eb1ba96c3fe010863093f207e6e5ec Mon Sep 17 00:00:00 2001 From: qorg11 Date: Wed, 16 Sep 2020 22:12:21 +0200 Subject: [PATCH 071/101] modified vxempire for TLS ports (instead of STARTTLS) --- share/domains.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index 800c2d6..b0c68ed 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -255,7 +255,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 +vxempire.xyz,vxempire.xyz,993,vxempire.xyz,465 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 From 7f4897aae1775ba7dacd184f4b86604e86d34a89 Mon Sep 17 00:00:00 2001 From: qorg11 Date: Wed, 16 Sep 2020 22:14:44 +0200 Subject: [PATCH 072/101] modified vxempire for TLS ports (instead of STARTTLS) (#525) --- share/domains.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index 800c2d6..b0c68ed 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -255,7 +255,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 +vxempire.xyz,vxempire.xyz,993,vxempire.xyz,465 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 From 052afead8793d83f7d1a53d503ef0d5abebf224a Mon Sep 17 00:00:00 2001 From: Corey Stephan <54367850+historical-theology@users.noreply.github.com> Date: Fri, 18 Sep 2020 07:25:27 -0500 Subject: [PATCH 073/101] Add Marquette University (fn.ln@marquette.edu) (#526) --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index b0c68ed..a06e486 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -151,6 +151,7 @@ mailbox.org,imap.mailbox.org,993,smtp.mailbox.org,587 mailbox.tu-dresden.de,msx.tu-dresden.de,993,msx.tu-dresden.de,587 mailfence.com,imap.mailfence.com,993,smtp.mailfence.com,465 mailo.com,mail.mailo.com,993,mail.mailo.com,465 +marquette.edu,outlook.office365.com,993,smtp.office365.com,587 memeware.net,mail.cock.li,993,mail.cock.li,587 metu.edu.tr,imap.metu.edu.tr,993,smtp.metu.edu.tr,465 ml1.net,imap.fastmail.com,993,smtp.fastmail.com,465 From faa5f2aad9daa9fafc80df96968cff1ebbda06f8 Mon Sep 17 00:00:00 2001 From: Laura Powles Date: Sat, 26 Sep 2020 19:40:56 +1000 Subject: [PATCH 074/101] changed the prefix for password files into a variable so that it can be edited more easily --- bin/mw | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/mw b/bin/mw index ca090c3..f501638 100755 --- a/bin/mw +++ b/bin/mw @@ -10,6 +10,7 @@ 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" +pass_prefix="mutt-wizard-" 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 @@ -47,14 +48,14 @@ host $smtp port $sport from $fulladdr user $login -passwordeval \"pass mutt-wizard-$title\" +passwordeval \"pass $pass_prefix$title\" $starttlsoff " mbsync_profile="IMAPStore $title-remote Host $imap Port $iport User $login -PassCmd \"pass mutt-wizard-$title\" +PassCmd \"pass $pass_prefix$title\" AuthMechs LOGIN SSLType $ssltype CertificateFile $sslcert @@ -108,7 +109,7 @@ set folder = \"imaps://$login@$imap:$iport\" set imap_user = \"$login\" set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies -set imap_pass = \"\`pass mutt-wizard-$title\`\" +set imap_pass = \"\`pass $pass_prefix$title\`\" set mbox_type = Maildir set ssl_starttls = yes @@ -218,8 +219,8 @@ protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" sed -ibu "s/account $title/&\ntls_trust_file\ntls_fingerprint $fingerprint/" "$msmtprc" ; rm -f "$msmtprc"bu } -getpass() { while : ; do pass rm -f "mutt-wizard-$title" >/dev/null 2>&1 - pass insert "mutt-wizard-$title" && break; done ;} +getpass() { while : ; do pass rm -f "$pass_prefix$title" >/dev/null 2>&1 + pass insert "$pass_prefix$title" && break; done ;} formatShortcut() { \ while read -r data; do { echo "macro index,pager g$1 \"$data\" \"go to $2\" # mw-autogenerated" From ff4e648878d973dcb0842ae36b62dc1c4129a3fe Mon Sep 17 00:00:00 2001 From: johngodlee Date: Sun, 27 Sep 2020 19:59:23 +0100 Subject: [PATCH 075/101] Update domains.csv --- share/domains.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/domains.csv b/share/domains.csv index a06e486..7c37f76 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -272,3 +272,5 @@ 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 +sms.ed.ac.uk,pod51015.outlook.com,993,pod51015.outlook.com,587 + From d58b0d82f29f07a118fa74fe53d814f04c86ac89 Mon Sep 17 00:00:00 2001 From: LazyBvr <16289763+LazyBvr@users.noreply.github.com> Date: Tue, 29 Sep 2020 02:32:45 +0200 Subject: [PATCH 076/101] Update domains.csv Add Jagiellonian University student email. --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index a06e486..70b247b 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -216,6 +216,7 @@ 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.uj.edu.pl,outlook.office365.com,993,smtp.office365.com,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 From 264c623340d148799675e85e86204c848394d921 Mon Sep 17 00:00:00 2001 From: nebulaeandstars <53393049+nebulaeandstars@users.noreply.github.com> Date: Thu, 1 Oct 2020 06:29:16 +1000 Subject: [PATCH 077/101] Add anu.edu.au (#529) * added anu.edu.au * found/fixed an out-of-place domain --- share/domains.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index a06e486..05a7f21 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -14,6 +14,7 @@ alumnidirector.com,imap.mail.com,993,smtp.mail.com,587 alunos.utfpr.edu.br,imap.gmail.com,993,smtp.gmail.com,587 anche.no,mail.autistici.org,993,smtp.autistici.org,465 angelic.com,imap.mail.com,993,smtp.mail.com,587 +anu.edu.au,outlook.office365.com,993,smtp.office365.com,587 aol.com,imap.aol.com,993,smtp.aol.com,465 appraiser.net,imap.mail.com,993,smtp.mail.com,587 aquilenet.fr,imap.aquilenet.fr,993,smtp.aquilenet.fr,587 @@ -131,8 +132,8 @@ 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 -lavabit.com,lavabit.com,993,lavabit.com,587 larbs.xyz,mail.larbs.xyz,993,mail.larbs.xyz,587 +lavabit.com,lavabit.com,993,lavabit.com,587 librem.one,imap.librem.one,993,smtp.librem.one,465 linuxmail.org,imap.mail.com,993,smtp.mail.com,587 live.com,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 From bf28f165a045ce3714701c6e9dc91597317e51fd Mon Sep 17 00:00:00 2001 From: qorg11 Date: Fri, 2 Oct 2020 11:10:39 +0200 Subject: [PATCH 078/101] Add kalli.st to domains.csv --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index b0c68ed..347c869 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -127,6 +127,7 @@ 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 iu.edu,imap.exchange.iu.edu,993,mail-relay.iu.edu,587 +kalli.st,mail.kalli.st,993,kalli.st,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 From 9cd26a24959ac339f44b6cde6195116a9f1e6656 Mon Sep 17 00:00:00 2001 From: f380cedric Date: Mon, 5 Oct 2020 11:30:58 +0200 Subject: [PATCH 079/101] Use POSIX-compliant read Rewrite #520. Using `read var?'prompt'` is wrong. It is ksh (and zsh) specific. Using `read -p 'prompt' var` is also wrong. It is bash specific. Since we cannot assume which sh is implemented, we should write POSIX-compliant code. --- 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 c3dae24..57df579 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -71,7 +71,7 @@ bind editor complete-query 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" -macro index \Cf "unset wait_keyread x?'Enter a search term to find with notmuch: '; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" +macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" macro index A "all\n" "show all messages (undo limit)" # Sidebar mappings From a60f5e7fb6609cb8d6c9bd6f32e20c7d744fd0fd Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 6 Oct 2020 11:42:28 -0400 Subject: [PATCH 080/101] some simplifications and soydevery removed --- bin/mw | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/bin/mw b/bin/mw index ca090c3..3936b16 100755 --- a/bin/mw +++ b/bin/mw @@ -23,6 +23,7 @@ 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 +MARKER="# mw-autogenerated" 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/" @@ -208,9 +209,9 @@ EOF echo "$mbsync_profile" >> "$mbsyncrc" notmuchauto [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created." - ! grep "^source.*mutt-wizard.muttrc" "$muttrc" >/dev/null && echo "source $mwconfig # mw-autogenerated" >> "$muttrc" - ! grep "^source.*.muttrc" "$muttrc" | grep -v "$mwconfig" >/dev/null && echo "source $accdir/$idnum-$title.muttrc # mw-autogenerated" >> "$muttrc" - echo "macro index,pager i$idnum 'source $accdir/$idnum-$title.muttrc!;' \"switch to $fulladdr\" # mw-autogenerated" >> "$muttrc" + ! grep "^source.*mutt-wizard.muttrc" "$muttrc" >/dev/null && echo "source $mwconfig $MARKER" >> "$muttrc" + ! grep "^source.*.muttrc" "$muttrc" | grep -v "$mwconfig" >/dev/null && echo "source $accdir/$idnum-$title.muttrc $MARKER" >> "$muttrc" + echo "macro index,pager i$idnum 'source $accdir/$idnum-$title.muttrc!;' \"switch to $fulladdr\" $MARKER" >> "$muttrc" } protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" @@ -221,11 +222,14 @@ protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" getpass() { while : ; do pass rm -f "mutt-wizard-$title" >/dev/null 2>&1 pass insert "mutt-wizard-$title" && break; done ;} -formatShortcut() { \ - while read -r data; do { echo "macro index,pager g$1 \"$data\" \"go to $2\" # mw-autogenerated" - echo "macro index,pager M$1 \";$data\" \"move mail to $2\" # mw-autogenerated" - echo "macro index,pager C$1 \";$data\" \"copy mail to $2\" # mw-autogenerated"; } >> "$accdir/$idnum-$title.muttrc" - done ;} +formatShortcut() { toappend="$toappend +macro index,pager g$1 \"=$3\" \"go to $2\" $MARKER +macro index,pager M$1 \";=$3\" \"move mail to $2\" $MARKER +macro index,pager C$1 \";=$3\" \"copy mail to $2\" $MARKER" >> "$accdir/$idnum-$title.muttrc" +} + +setBox() { toappend="$toappend +set $1 = \"+$2\" $MARKER" ;} tryconnect() { mkdir -p "$maildir/$title" if mailboxes="$(mbsync -l "$title" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then @@ -239,25 +243,23 @@ tryconnect() { mkdir -p "$maildir/$title" fi ;} finalize() { \ - boxes="$(find "$maildir/$title/" -mindepth 1 -type d | sed "s/\ /\\\ /g;s/^.*\//=/;/=\(cur\|new\|tmp\)$/d")" + boxes="$(find "$maildir/$title/" -mindepth 1 -type d | sed "s/\ /\\\ /g;s/^.*\///;/\(cur\|new\|tmp\)$/d")" [ -z "$boxes" ] && printf "\033[31mNo local mailboxes have been detected for %s.\033[0m\\nThis means that mbsync has not been successfully run.\\nRun mbsync, and if it has an error, be sure to check your password and server settings manually if needbe.\\n" "$title" && return printf "Setting default mailboxes for your Inbox, Sent, Drafts and Trash in mutt...\\n" - spoolfile=$(echo "$boxes" | grep -i -m 1 inbox | sed 's/=/+/g') - record=$(echo "$boxes" | grep -i -m 1 sent | sed 's/=/+/g') - postponed=$(echo "$boxes" | grep -i -m 1 draft | sed 's/=/+/g') - trash=$(echo "$boxes" | grep -i -m 1 trash | sed 's/=/+/g') - sed -ibu "/^mailboxes\|^set record\|^set postponed\|^set trash\|^set spoolfile/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu" - { echo "set spoolfile = \"$spoolfile\""; echo "set record = \"$record\""; echo "set postponed = \"$postponed\""; echo "set trash = \"$trash\""; } >> "$accdir/$idnum-$title.muttrc" - echo "mailboxes $(echo "$boxes" | sed -e "s/^\|$/\"/g" | tr "\n" " ")" >> "$accdir/$idnum-$title.muttrc" + sed -ibu "/$MARKER/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu" + toappend="mailboxes $(echo "$boxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' )" + for x in $boxes; do + case $x in + *[Ii][Nn][Bb][Oo][Xx]*) formatShortcut i inbox "$x"; setBox spoolfile "$x" ;; + *[Ss][Ee][Nn][Tt]*) setBox record "$x"; formatShortcut s sent "$x" ;; + *[Dd][Rr][Aa][Ff][Tt][Ss]*) setBox postponed "$x"; formatShortcut d drafts "$x" ;; + *[Tt][Rr][Aa][Ss][Hh]*|*[Jj][Uu][Nn][Kk]*) formatShortcut t trash "$x"; setBox trash "$x" ;; + *[Aa][Rr][Cc][Hh][Ii][Vv][Ee]*) formatShortcut a archive "$x" ;; + *[Ss][Pp][Aa][Mm]*) formatShortcut S spam "$x" ;; + esac + done printf "Setting up your keyboard shortcuts for jumping between mailboxes...\\n" - sed -ibu "/# mw-autogenerated/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu" - echo "$boxes" | grep -i inbox | head -n 1 | formatShortcut i inbox - echo "$boxes" | grep -i sent | head -n 1 | formatShortcut s sent - echo "$boxes" | grep -i draft | head -n 1 | formatShortcut d drafts - echo "$boxes" | grep -i trash | head -n 1 | formatShortcut t trash - echo "$boxes" | grep -i spam | head -n 1 | formatShortcut S spam - echo "$boxes" | grep -i junk | head -n 1 | formatShortcut j junk - echo "$boxes" | grep -i archive | head -n 1 | formatShortcut a archive + echo "$toappend" >> "$accdir/$idnum-$title.muttrc" [ "$accounttype" = "offline" ] && printf "All done.\\n\033[33mYou should now be able to run \`\033[32mmbsync %s\033[33m\` to begin to download your mail.\033[0m\\n" "$title" command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" return 0 @@ -293,7 +295,7 @@ asktype() { while : ; do purge() { confirm "delete all account data" || exit 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 + sed -ibu "/$MARKER/d" "$muttrc" ; rm -f "$muttrc"bu } syncwrapper() { mbsync "${1:--a}" & From 3135132f64bbe6b9f75f5a0b19168656ccd3a6ff Mon Sep 17 00:00:00 2001 From: ccmywish Date: Thu, 8 Oct 2020 13:58:40 +0800 Subject: [PATCH 081/101] Add qq,126,163 mail for chinese users --- share/domains.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/domains.csv b/share/domains.csv index 0fd4c83..22596e4 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -1,4 +1,6 @@ ADDRESS,IMAP,imap port,SMTP,smtp port +126.com,imap.126.com,993,smtp.126.com,587 +163.com,imap.163.com,993,smtp.163.com,587 420blaze.it,mail.cock.li,993,mail.cock.li,587 8chan.co,mail.cock.li,993,mail.cock.li,587 aaathats3as.com,mail.cock.li,993,mail.cock.li,587 @@ -195,6 +197,7 @@ 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 protonmail.com,127.0.0.1,1143,127.0.0.1,1025 +qq.com,imap.qq.com,993,smtp.qq.com,587 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 From 71abb874a01e04532c33b13ff2caf78c60e1250f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 8 Oct 2020 18:12:53 -0400 Subject: [PATCH 082/101] fix --- share/domains.csv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/domains.csv b/share/domains.csv index 0fd4c83..115fd19 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -205,6 +205,7 @@ rwth-aachen.de,mail.rwth-aachen.de,993,mail.rwth-aachen.de,587 sapo.pt,imap.sapo.pt,993,smtp.sapo.pt,587 seznam.cz,imap.seznam.cz,993,smtp.seznam.cz,465 smail.inf.h-brs.de,imap.inf.h-brs.de,993,smtp.inf.h-brs.de,587 +sms.ed.ac.uk,pod51015.outlook.com,993,pod51015.outlook.com,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 @@ -275,5 +276,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 -sms.ed.ac.uk,pod51015.outlook.com,993,pod51015.outlook.com,587 - From 8f45a05115732d601551835236b5ba6c46cd4eca Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 8 Oct 2020 18:13:15 -0400 Subject: [PATCH 083/101] begin work for 3.0 --- bin/mw | 299 +++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 185 insertions(+), 114 deletions(-) diff --git a/bin/mw b/bin/mw index e44d580..e23e5a1 100755 --- a/bin/mw +++ b/bin/mw @@ -1,5 +1,20 @@ #!/bin/sh +debug() { + echo "fulladdr: $fulladdr" + echo "login: $login" + echo "title: $title" + echo "imap: $imap" + echo "iport: $iport" + echo "smtp: $smtp" + echo "sport: $sport" + echo "proton: $proton" + echo "tls: $tls" + echo "force: $force" + echo "online: $online" + echo "action: $action" +} + 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" ] && @@ -10,7 +25,7 @@ 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" -pass_prefix="mutt-wizard-" +pass_prefix="mw-" 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 @@ -46,7 +61,7 @@ logfile $msmtplog " msmtp_profile="account $title host $smtp -port $sport +port ${sport:-587} from $fulladdr user $login passwordeval \"pass $pass_prefix$title\" @@ -54,7 +69,7 @@ $starttlsoff " mbsync_profile="IMAPStore $title-remote Host $imap -Port $iport +Port ${iport:-993} User $login PassCmd \"pass $pass_prefix$title\" AuthMechs LOGIN @@ -79,7 +94,7 @@ ExpireUnread no # End profile " -if [ "$accounttype" = "offline" ]; then +if [ -z "${online+x}" ]; then mutt_profile="# vim: filetype=neomuttrc # muttrc file for account $title set realname = \"$realname\" @@ -106,7 +121,7 @@ set realname = \"$realname\" set from = \"$fulladdr\" set sendmail = \"msmtp -a $title\" alias me $realname <$fulladdr> -set folder = \"imaps://$login@$imap:$iport\" +set folder = \"imaps://$login@$imap:${iport:-993}\" set imap_user = \"$login\" set header_cache = $cachedir/$title/headers set message_cachedir = $cachedir/$title/bodies @@ -127,92 +142,94 @@ fi printf "DONE.\\n" } +parsedomains(){ serverinfo="$(grep "^${fulladdr#*@}" "$muttshare/domains.csv" 2>/dev/null)" + + [ -z "$serverinfo" ] && + serverinfo="$(grep "$(echo "${fulladdr#*@}" | sed "s/\.[^\.]*$/\.\\\*/")" "$muttshare/domains.csv" 2>/dev/null)" + + IFS=, read -r service imapsugg iportsugg smtpsugg sportsugg </dev/null; do - printf "That is not a valid \033[31memail address\033[0m, please retype the desired email.\\n\\nEmail: \033[36m\t" + [ -z "$fulladdr" ] && echo "Give the full email address to add:" && + read -r fulladdr + + while ! echo "$fulladdr" | grep -qE "$emailre"; do + echo "\`$fulladdr\` is not a valid email address. Please retype the address:" read -r fulladdr - printf "\033[0m" done - domain="$(echo "$fulladdr" | sed "s/.*@//")" - search_query=$domain - case "$domain" in - protonmail.com|protonmail.ch|pm.me) - search_query='protonmail.com' ;; - *) - while : ; do - printf "\nIs your email hosted with Protonmail? [yes/no] " - read -r is_protonmail - case $is_protonmail in - [Yy][Ee][Ss]) search_query='protonmail.com' && break;; - [Nn][Oo]) break;; - *) printf 'Please answer Yes or No' - esac; done; - 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" - read -r imap - printf "\033[0mWhat is your server's IMAP port number? (Usually something like 993)\\n\033[36m\t" - read -r iport - printf "\033[0mInsert the SMTP server for your email provider (excluding the port number)\\n\033[36m\t" - read -r smtp - printf "\033[0mWhat is your server's SMTP port number? (Usually 587 or 465)\\n\033[36m\t" - read -r sport - printf "\033[0m\\nGreat! If you want to be helpful, copy the line below and you can add it to the \`domains.csv\` file on Github.\\nThis will make things easier for others who use your email provider.\\n\\n%s,%s,%s,%s,%s\\n\\nAlthough be sure to test to see if these settings work first! ;-)\\n" "$domain" "$imap" "$iport" "$smtp" "$sport" - else - IFS=, read -r service imap iport smtp sport </dev/null || ls "$accdir"/[0-9]"-$title.muttrc" >/dev/null 2>&1; do - printf "\033[31mTry again\033[0m. Pick a nickname that is one word only including lowercase letters and _ or - and that you have \033[1mnot\033[0m used before.\\n\tAccount name: \033[36m\t" - read -r title - printf "\033[0m" - done - printf "If your account has a special username different from your address, insert it now. Otherwise leave this prompt totally blank.\\n\033[34mMost accounts will not have a separate login, so you should probably leave this blank.\033[0m\\n\tLogin(?): \033[36m" - read -r login - printf "\033[0m" - [ -z "$login" ] && login="$fulladdr" - [ "$accounttype" = "offline" ] && printf "If you want to limit the number of messages kept offline to a number, enter that number below. If you do not want to limit your mail and would like \`mbsync\` to sync all mail, press enter without typing a number.\\n\t" && read -r maxmes - echo "$maxmes" | grep "[1-9]" >/dev/null || maxmes="0" + + [ -z "$realname" ] && echo "Give the name you would like to be identified by on the email account:" && + read -r realname + + title="$fulladdr" + #while ! echo "$title" | grep -q "$namere" || ls "$accdir"/[0-9]"-$title.muttrc" >/dev/null 2>&1; do + #printf "\033[31mTry again\033[0m. Pick a nickname that is one word only including lowercase letters and _ or - and that you have \033[1mnot\033[0m used before.\\n\tAccount name: \033[36m\t" + #read -r title + #printf "\033[0m" + #done + + [ -z "$login" ] && echo "Give the account log-on/username for this address:" && read -r login + login="${login:-$fulladdr}" + + + + #case "$service" in + #gmail.com) printf "\033[31mREMEMBER: Gmail users must enable \"less secure\" (third-party) applications first for the sync to work:\\nhttps://support.google.com/accounts/answer/6010255\\n\033[0m" ;; + #protonmail.ch|protonmail.com|pm.me) printf "\033[31mREMEMBER: Protonmail users must install and configure Protonmail Bridge first for the sync to work:\\nhttps://protonmail.com/bridge/\\n\033[0m" && ssltype="None" ;; + #esac + getpass +} + + +writeinfo() { + # Insert account information into variables. getprofiles - mkdir -p "$muttdir" "$accdir" "$cachedir/$title/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" + + # Create required directories. + mkdir -p "$muttdir" "$accdir" "$cachedir/$title/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$maildir/$title" + + # Get accounts and find the first missing account number (max. 9). getaccounts - for x in $(seq 1 9); do echo "$accounts" | grep "$x" >/dev/null 2>&1 || { export idnum="$x"; break ;}; done + for x in $(seq 1 9); do echo "$accounts" | grep -q "$x" || { export idnum="$x"; break ;}; done + + # Create msmtprc file if not present. [ ! -f "$msmtprc" ] && echo "$msmtp_header" > "$msmtprc" + + # Add account msmtp settings. echo "$msmtp_profile" >> "$msmtprc" + + # On Ubuntu/Debian, a link is needed since they use an older version. command -V apt-get >/dev/null 2>&1 && ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null - case "$service" in - protonmail.ch|protonmail.com|pm.me) protonfinger || return 1 ;; - esac + + # Create the individual mutt config file for the account. echo "$mutt_profile" > "$accdir/$idnum-$title.muttrc" + + # Create the mbsync config file. mkdir -p "${mbsyncrc%/*}" echo "$mbsync_profile" >> "$mbsyncrc" + + # Create a notmuch config file if not present already. notmuchauto + + # Create a basic muttrc is not present and source the mutt-wizard files + # and add the shortcuts to the account. [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created." - ! grep "^source.*mutt-wizard.muttrc" "$muttrc" >/dev/null && echo "source $mwconfig $MARKER" >> "$muttrc" - ! grep "^source.*.muttrc" "$muttrc" | grep -v "$mwconfig" >/dev/null && echo "source $accdir/$idnum-$title.muttrc $MARKER" >> "$muttrc" + ! grep -q "^source.*mutt-wizard.muttrc" "$muttrc" && echo "source $mwconfig $MARKER" >> "$muttrc" + ! grep "^source.*.muttrc" "$muttrc" | grep -qv "$mwconfig" && echo "source $accdir/$idnum-$title.muttrc $MARKER" >> "$muttrc" echo "macro index,pager i$idnum 'source $accdir/$idnum-$title.muttrc!;' \"switch to $fulladdr\" $MARKER" >> "$muttrc" + } protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" @@ -225,18 +242,23 @@ getpass() { while : ; do pass rm -f "$pass_prefix$title" >/dev/null 2>&1 formatShortcut() { toappend="$toappend macro index,pager g$1 \"=$3\" \"go to $2\" $MARKER + getpass macro index,pager M$1 \";=$3\" \"move mail to $2\" $MARKER + getpass macro index,pager C$1 \";=$3\" \"copy mail to $2\" $MARKER" >> "$accdir/$idnum-$title.muttrc" } setBox() { toappend="$toappend set $1 = \"+$2\" $MARKER" ;} -tryconnect() { mkdir -p "$maildir/$title" +getboxes() { [ -n "${force+x}" ] && mailboxes="INBOX +Drafts +Junk +Sent +Archive" && return 0 if mailboxes="$(mbsync -l "$title" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then [ "$accounttype" = "online" ] && sed -ibu "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu printf "\033[32mMailboxes detected.\033[0m\\n" - echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$title/{}" return 0 else printf "\033[31m\033[31mLog-on not successful.\033[0m\\nIt seems that either you inputted the wrong password or server settings, or there are other requirements for your account out of the control of mutt-wizard.\\n" @@ -244,12 +266,17 @@ tryconnect() { mkdir -p "$maildir/$title" fi ;} finalize() { \ - boxes="$(find "$maildir/$title/" -mindepth 1 -type d | sed "s/\ /\\\ /g;s/^.*\///;/\(cur\|new\|tmp\)$/d")" - [ -z "$boxes" ] && printf "\033[31mNo local mailboxes have been detected for %s.\033[0m\\nThis means that mbsync has not been successfully run.\\nRun mbsync, and if it has an error, be sure to check your password and server settings manually if needbe.\\n" "$title" && return + + # Create the required mailbox structure. + echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$title/{}" + printf "Setting default mailboxes for your Inbox, Sent, Drafts and Trash in mutt...\\n" + sed -ibu "/$MARKER/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu" - toappend="mailboxes $(echo "$boxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' )" - for x in $boxes; do + + toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' )" + + for x in $mailboxes; do case $x in *[Ii][Nn][Bb][Oo][Xx]*) formatShortcut i inbox "$x"; setBox spoolfile "$x" ;; *[Ss][Ee][Nn][Tt]*) setBox record "$x"; formatShortcut s sent "$x" ;; @@ -259,15 +286,19 @@ finalize() { \ *[Ss][Pp][Aa][Mm]*) formatShortcut S spam "$x" ;; esac done - printf "Setting up your keyboard shortcuts for jumping between mailboxes...\\n" + echo "$toappend" >> "$accdir/$idnum-$title.muttrc" - [ "$accounttype" = "offline" ] && printf "All done.\\n\033[33mYou should now be able to run \`\033[32mmbsync %s\033[33m\` to begin to download your mail.\033[0m\\n" "$title" + + [ -z "${online+x}" ] && printf "All done.\\n\033[33mYou should now be able to run \`\033[32mmbsync %s\033[33m\` to begin to download your mail.\033[0m\\n" "$title" + + # Create a urlview config file if non-existent. command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" + return 0 } -confirm() { printf "Do you want to %s? [yes/N]\\n\t" "$@" && read -r input && ! echo "$input" | grep -i "^yes$" >/dev/null && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 - printf "Are you really, really sure you want to %s?\\n\t" "$@" && read -r input && ! echo "$input" | grep -i "^yes$" >/dev/null && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 +confirm() { printf "Do you want to %s? [yes/N]\\n\t" "$@" && read -r input && ! echo "$input" | grep -qi "^yes$" && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 + printf "Are you really, really sure you want to %s?\\n\t" "$@" && read -r input && ! echo "$input" | grep -qi "^yes$" && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 return 0 ;} pick() { printf "Select an accounts to %s:\\n" "$1" @@ -284,21 +315,6 @@ delete() { sed -ibu "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc" ; sed -ibu "/account $title/,/^\(\s*$\|account\)/d" "$msmtprc"; rm -f "$msmtprc"bu } -asktype() { while : ; do - printf "Do you want to keep your mail for this account offline with mbsync? [yes/no]\\n\t" - read -r offnot - case "$offnot" in - [Yy][Ee][Ss]) accounttype="offline" && break ;; - [Nn][Oo]) accounttype="online" && break ;; - *) echo "Write out either yes or no completely. Try again or press ctrl-c to quit." ;; - esac; done ;} - -purge() { confirm "delete all account data" || exit - rm -rf "$mbsyncrc" "$accdir" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$cachedir" - echo "All configs and account settings have been purged." - sed -ibu "/$MARKER/d" "$muttrc" ; rm -f "$muttrc"bu -} - syncwrapper() { mbsync "${1:--a}" & ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null wait @@ -306,6 +322,12 @@ syncwrapper() { mbsync "${1:--a}" & notmuch new } +purge() { confirm "delete all account data" || exit + rm -rf "$mbsyncrc" "$accdir" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$cachedir" + echo "All configs and account settings have been purged." + sed -ibu "/$MARKER/d" "$muttrc" ; rm -f "$muttrc"bu +} + notmuchauto() { \ [ -z "$NOTMUCH_CONFIG" ] && NOTMUCH_CONFIG="$HOME/.notmuch-config" [ -f "$NOTMUCH_CONFIG" ] && return 0 @@ -327,26 +349,75 @@ gpg_path=$GPG" trap 'echo -e "\033[0m\n"; exit' INT ABRT -case "$1" in - ls) list ;; - 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" ;; - purge) purge ;; +setaction() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then + echo "Running $1 with $action..." + echo "Incompatible options given. Only one action may be specified per run." + return 1 + else + action="$1" + fi; } + +while getopts "gbpPlhdYD:y:i:I:s:S:u:a:" o; do case "${o}" in + l) setaction list || exit 1 ;; + p) setaction pass || exit 1 ;; + d) setaction delete || exit 1 ;; + D) setaction delete || exit 1 ; title="$OPTARG" ;; + y) setaction sync || exit 1 ; title="$OPTARG" ;; + Y) setaction sync || exit 1 ;; + + a) setaction add || exit 1 ; fulladdr="$OPTARG" ;; + i) setaction add || exit 1 ; imap="$OPTARG" ;; + I) setaction add || exit 1 ; iport="$OPTARG" ;; + s) setaction add || exit 1 ; smtp="$OPTARG" ;; + S) setaction add || exit 1 ; sport="$OPTARG" ;; + u) setaction add || exit 1 ; login="$OPTARG" ;; + + o) setaction add || exit 1 ; online=True ;; + b) setaction add || exit 1 ; force=True ;; + P) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." + proton=True + imap="127.0.0.1" + iport=1143 + smtp="127.0.0.1" + sport=1025 + setaction add || exit 1 + ;; + + g) debug ;; + *) cat << EOF mw: mutt-wizard, auto-configure email accounts for mutt including downloadable mail with \`isync\`. -Allowed options: - add Add and autoconfigure an email address (9 max.) - ls List configured accounts - delete Pick an account to delete - purge Delete all accounts and settings - sync Syncs mail and updates notmuch database - all else Print this message +Main actions: + -a your@email.com Add an email address + -d Remove an already added address + -D nameofaccount Force remove account without confirmation + -l List email addresses configured + -y nameofaccount Sync mail for account by name + -Y Sync mail for all accounts + +Options allowed with -a: + -u Account login name if not full address. + -i IMAP server address + -I IMAP server port + -s SMTP server address + -S SMTP server port + -p Install for a Protonmail account. + -o Configure address, but keep mail online. + -b Assume typical English mailboxes without attempting log-on. NOTE: Once at least one account is added, you can run \`mbsync -a\` to begin downloading mail. EOF +;; +esac done + +case "$action" in + list) list ;; + add) askinfo && writeinfo && getboxes && finalize || delete ;; + pass) pick "change the password of" && getpass ;; + delete) pick delete && confirm "delete the \`$title\` profile" && delete ;; + sync) syncwrapper $title ;; + purge) purge ;; esac From cf6b8fd052a45986e1d64b82255405b4188620e1 Mon Sep 17 00:00:00 2001 From: ccmywish Date: Thu, 8 Oct 2020 13:58:40 +0800 Subject: [PATCH 084/101] Add qq,126,163 mail for chinese users --- share/domains.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/domains.csv b/share/domains.csv index 115fd19..c57aa25 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -1,4 +1,6 @@ ADDRESS,IMAP,imap port,SMTP,smtp port +126.com,imap.126.com,993,smtp.126.com,587 +163.com,imap.163.com,993,smtp.163.com,587 420blaze.it,mail.cock.li,993,mail.cock.li,587 8chan.co,mail.cock.li,993,mail.cock.li,587 aaathats3as.com,mail.cock.li,993,mail.cock.li,587 @@ -195,6 +197,7 @@ 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 protonmail.com,127.0.0.1,1143,127.0.0.1,1025 +qq.com,imap.qq.com,993,smtp.qq.com,587 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 From 601d496fdf0df4d2f48877c545f0eee60632a9b2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 9 Oct 2020 09:46:50 -0400 Subject: [PATCH 085/101] 3.0 release --- README.md | 31 ++++++-- bin/mw | 232 +++++++++++++++++++++++------------------------------- mw.1 | 70 ++++++++++++---- 3 files changed, 178 insertions(+), 155 deletions(-) diff --git a/README.md b/README.md index 0da14f4..0a7629f 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,31 @@ User of Arch-based distros can also install mutt-wizard from the AUR as [mutt-wi 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 -a you@email.com` -- add a new email account +- `mw -l` -- list existing accounts +- `mw -y your@email.com` -- sync an email account +- `my -Y` -- sync all configured email accounts +- `mw -d` -- choose an account to delete +- `mw -D your@email.com` -- delete account settings without confirmation +- `pass edit mw-your@email.com` -- revise an account's password + +### Options usable when adding an account + +#### Providing arguments + +- `-u` -- Give an account username if different from the email address. If you use my [emailwiz](https://github.com/lukesmithxyz/emailwiz), give your username with this option. Not necessary for other accounts. +- `-n` -- A real name to be used by the account. Put in quotations if multiple words +- `-i` -- IMAP server address +- `-I` -- IMAP server port (otherwise assumed to be 993) +- `-s` -- SMTP server address +- `-S` -- SMTP server port (otherwise assumed to be 587) +- `-m` -- Maximum number of emails to be kept offline. No maximum is default functionality. + +#### General Settings + +- `-p` -- Add a Protonmail account +- `-f` -- Assume mailbox names and force account configuration without connecting online at all. +- `-o` -- Configure mutt for an account, but do not keep mail offline. ## Dependencies diff --git a/bin/mw b/bin/mw index e23e5a1..387747a 100755 --- a/bin/mw +++ b/bin/mw @@ -1,20 +1,5 @@ #!/bin/sh -debug() { - echo "fulladdr: $fulladdr" - echo "login: $login" - echo "title: $title" - echo "imap: $imap" - echo "iport: $iport" - echo "smtp: $smtp" - echo "sport: $sport" - echo "proton: $proton" - echo "tls: $tls" - echo "force: $force" - echo "online: $online" - echo "action: $action" -} - 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" ] && @@ -22,7 +7,6 @@ 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 (isync package)\` must be installed to run mutt-wizard.\\n" && exit prefix="/usr/local" pass_prefix="mw-" @@ -38,7 +22,6 @@ 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 MARKER="# mw-autogenerated" alias mbsync='mbsync -c "$mbsyncrc"' @@ -47,63 +30,63 @@ do [ -f "$x" ] && sslcert="$x" && break done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1 ;} -getaccounts() { accounts="$(find "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\..*//" | sort -n)" ;} +getaccounts() { accounts="$(find "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} + list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" ;} getprofiles() { \ unset msmtp_header msmtp_profile mutt_profile mbsync_profile - printf "Creating profiles for \`%s\`..." "$title" msmtp_header="defaults auth on tls on tls_trust_file $sslcert logfile $msmtplog " -msmtp_profile="account $title +msmtp_profile="account $fulladdr host $smtp port ${sport:-587} from $fulladdr user $login -passwordeval \"pass $pass_prefix$title\" +passwordeval \"pass $pass_prefix$fulladdr\" $starttlsoff " -mbsync_profile="IMAPStore $title-remote +mbsync_profile="IMAPStore $fulladdr-remote Host $imap Port ${iport:-993} User $login -PassCmd \"pass $pass_prefix$title\" +PassCmd \"pass $pass_prefix$fulladdr\" AuthMechs LOGIN -SSLType $ssltype +SSLType ${ssltype:-IMAPS} CertificateFile $sslcert -MaildirStore $title-local +MaildirStore $fulladdr-local Subfolders Verbatim -Path ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$title/ -Inbox ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$title/INBOX +Path ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$fulladdr/ +Inbox ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$fulladdr/INBOX Flatten . -Channel $title +Channel $fulladdr Expunge Both -Master :$title-remote: -Slave :$title-local: +Master :$fulladdr-remote: +Slave :$fulladdr-local: Patterns * !\"[Gmail]/All Mail\" Create Both SyncState * -MaxMessages $maxmes +MaxMessages ${maxmes:-0} ExpireUnread no # End profile " if [ -z "${online+x}" ]; then mutt_profile="# vim: filetype=neomuttrc -# muttrc file for account $title +# muttrc file for account $fulladdr set realname = \"$realname\" set from = \"$fulladdr\" -set sendmail = \"msmtp -a $title\" +set sendmail = \"msmtp -a $fulladdr\" alias me $realname <$fulladdr> -set folder = \"$maildir/$title\" -set header_cache = $cachedir/$title/headers -set message_cachedir = $cachedir/$title/bodies +set folder = \"$maildir/$fulladdr\" +set header_cache = $cachedir/$fulladdr/headers +set message_cachedir = $cachedir/$fulladdr/bodies set mbox_type = Maildir bind index,pager gg noop @@ -111,21 +94,21 @@ bind index,pager g noop bind index,pager M noop bind index,pager C noop bind index gg first-entry -macro index o \"mbsync -V $title\" \"run mbsync to sync $title\" +macro index o \"mbsync -V $fulladdr\" \"run mbsync to sync $fulladdr\" unmailboxes * " else mutt_profile="# vim: filetype=neomuttrc -# muttrc file for account $title +# muttrc file for account $fulladdr set realname = \"$realname\" set from = \"$fulladdr\" -set sendmail = \"msmtp -a $title\" +set sendmail = \"msmtp -a $fulladdr\" alias me $realname <$fulladdr> set folder = \"imaps://$login@$imap:${iport:-993}\" set imap_user = \"$login\" -set header_cache = $cachedir/$title/headers -set message_cachedir = $cachedir/$title/bodies -set imap_pass = \"\`pass $pass_prefix$title\`\" +set header_cache = $cachedir/$fulladdr/headers +set message_cachedir = $cachedir/$fulladdr/bodies +set imap_pass = \"\`pass $pass_prefix$fulladdr\`\" set mbox_type = Maildir set ssl_starttls = yes @@ -142,7 +125,10 @@ fi printf "DONE.\\n" } -parsedomains(){ serverinfo="$(grep "^${fulladdr#*@}" "$muttshare/domains.csv" 2>/dev/null)" +parsedomains(){ \ + # Parses the domains.csv file for server information and sets + # the required variables unless overridden by the user. + serverinfo="$(grep "^${fulladdr#*@}" "$muttshare/domains.csv" 2>/dev/null)" [ -z "$serverinfo" ] && serverinfo="$(grep "$(echo "${fulladdr#*@}" | sed "s/\.[^\.]*$/\.\\\*/")" "$muttshare/domains.csv" 2>/dev/null)" @@ -156,39 +142,42 @@ EOF iport="${iport:-$iportsugg}" } +delete() { if [ -z "${fulladdr+x}" ]; then + echo "Select the account your would like to delete (by number):" + list + read -r input + match="^$input:" + else + match=" $fulladdr$" + getaccounts + fi + + fulladdr="$(echo "$accounts" | grep "$match" | cut -f2 -d' ')" + + [ -z "$fulladdr" ] && echo "Invalid account name given." && return 1 + + sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" ; rm -rf "$mbsyncrc"bu + rm -rf "${cachedir:?}/${fulladdr:?}" "$accdir/"[1-9]"-$fulladdr.muttrc" + sed -ibu "/[0-9]-$fulladdr.muttrc/d" "$muttrc" ; rm -f "$muttrc"bu + sed -ibu "/account $fulladdr/,/^\(\s*$\|account\)/d" "$msmtprc"; rm -f "$msmtprc"bu + } + askinfo() { \ [ -z "$fulladdr" ] && echo "Give the full email address to add:" && read -r fulladdr - while ! echo "$fulladdr" | grep -qE "$emailre"; do echo "\`$fulladdr\` is not a valid email address. Please retype the address:" read -r fulladdr done - - # If we don't have either the IMAP or SMTP servers, look for them and ports. { [ -z "$imap" ] || [ -z "$smtp" ] ;} && parsedomains + [ -z "$imap" ] && echo "Give your email server's IMAP address (excluding the port number):" && + read -r imap + [ -z "$smtp" ] && echo "Give your email server's SMTP address (excluding the port number):" && + read -r smtp [ "$sport" = 465 ] && starttlsoff="tls_starttls off" - [ -z "$realname" ] && echo "Give the name you would like to be identified by on the email account:" && read -r realname - - title="$fulladdr" - #while ! echo "$title" | grep -q "$namere" || ls "$accdir"/[0-9]"-$title.muttrc" >/dev/null 2>&1; do - #printf "\033[31mTry again\033[0m. Pick a nickname that is one word only including lowercase letters and _ or - and that you have \033[1mnot\033[0m used before.\\n\tAccount name: \033[36m\t" - #read -r title - #printf "\033[0m" - #done - - [ -z "$login" ] && echo "Give the account log-on/username for this address:" && read -r login login="${login:-$fulladdr}" - - - - #case "$service" in - #gmail.com) printf "\033[31mREMEMBER: Gmail users must enable \"less secure\" (third-party) applications first for the sync to work:\\nhttps://support.google.com/accounts/answer/6010255\\n\033[0m" ;; - #protonmail.ch|protonmail.com|pm.me) printf "\033[31mREMEMBER: Protonmail users must install and configure Protonmail Bridge first for the sync to work:\\nhttps://protonmail.com/bridge/\\n\033[0m" && ssltype="None" ;; - #esac - getpass } @@ -198,7 +187,7 @@ writeinfo() { getprofiles # Create required directories. - mkdir -p "$muttdir" "$accdir" "$cachedir/$title/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$maildir/$title" + mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$maildir/$fulladdr" # Get accounts and find the first missing account number (max. 9). getaccounts @@ -214,7 +203,7 @@ writeinfo() { command -V apt-get >/dev/null 2>&1 && ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null # Create the individual mutt config file for the account. - echo "$mutt_profile" > "$accdir/$idnum-$title.muttrc" + echo "$mutt_profile" > "$accdir/$idnum-$fulladdr.muttrc" # Create the mbsync config file. mkdir -p "${mbsyncrc%/*}" @@ -227,26 +216,21 @@ writeinfo() { # and add the shortcuts to the account. [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created." ! grep -q "^source.*mutt-wizard.muttrc" "$muttrc" && echo "source $mwconfig $MARKER" >> "$muttrc" - ! grep "^source.*.muttrc" "$muttrc" | grep -qv "$mwconfig" && echo "source $accdir/$idnum-$title.muttrc $MARKER" >> "$muttrc" - echo "macro index,pager i$idnum 'source $accdir/$idnum-$title.muttrc!;' \"switch to $fulladdr\" $MARKER" >> "$muttrc" - + ! grep "^source.*.muttrc" "$muttrc" | grep -qv "$mwconfig" && echo "source $accdir/$idnum-$fulladdr.muttrc $MARKER" >> "$muttrc" + echo "macro index,pager i$idnum 'source $accdir/$idnum-$fulladdr.muttrc!;' \"switch to $fulladdr\" $MARKER" >> "$muttrc" } protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" - fingerprint="$(msmtp --serverinfo --host=127.0.0.1 --port=1025 --tls --tls-certcheck=off | grep SHA256: | sed 's/^.*: //')" - sed -ibu "s/account $title/&\ntls_trust_file\ntls_fingerprint $fingerprint/" "$msmtprc" ; rm -f "$msmtprc"bu -} + fingerprint="$(msmtp --serverinfo --host=$smtp --port=$sport --tls --tls-certcheck=off | grep SHA256: | sed 's/^.*: //')" + sed -ibu "s/account $fulladdr/&\ntls_trust_file\ntls_fingerprint $fingerprint/" "$msmtprc" ; rm -f "$msmtprc"bu ;} -getpass() { while : ; do pass rm -f "$pass_prefix$title" >/dev/null 2>&1 - pass insert "$pass_prefix$title" && break; done ;} +getpass() { while : ; do pass rm -f "$pass_prefix$fulladdr" >/dev/null 2>&1 + pass insert "$pass_prefix$fulladdr" && break; done ;} formatShortcut() { toappend="$toappend macro index,pager g$1 \"=$3\" \"go to $2\" $MARKER - getpass macro index,pager M$1 \";=$3\" \"move mail to $2\" $MARKER - getpass -macro index,pager C$1 \";=$3\" \"copy mail to $2\" $MARKER" >> "$accdir/$idnum-$title.muttrc" -} +macro index,pager C$1 \";=$3\" \"copy mail to $2\" $MARKER" >> "$accdir/$idnum-$fulladdr.muttrc" ;} setBox() { toappend="$toappend set $1 = \"+$2\" $MARKER" ;} @@ -254,73 +238,54 @@ set $1 = \"+$2\" $MARKER" ;} getboxes() { [ -n "${force+x}" ] && mailboxes="INBOX Drafts Junk +Trash Sent Archive" && return 0 - if mailboxes="$(mbsync -l "$title" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then - [ "$accounttype" = "online" ] && sed -ibu "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu - printf "\033[32mMailboxes detected.\033[0m\\n" + if mailboxes="$(mbsync -l "$fulladdr" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then + [ "$accounttype" = "online" ] && sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu return 0 else + echo "$mailboxes" printf "\033[31m\033[31mLog-on not successful.\033[0m\\nIt seems that either you inputted the wrong password or server settings, or there are other requirements for your account out of the control of mutt-wizard.\\n" return 1 fi ;} -finalize() { \ - - # Create the required mailbox structure. - echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$title/{}" - - printf "Setting default mailboxes for your Inbox, Sent, Drafts and Trash in mutt...\\n" - - sed -ibu "/$MARKER/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu" - +finalize() { echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$fulladdr/{}/cur" "$maildir/$fulladdr/{}/tmp" "$maildir/$fulladdr/{}/new" + sed -ibu "/$MARKER/d" "$accdir/$idnum-$fulladdr.muttrc" ; rm -f "$accdir/$idnum-$fulladdr.muttrcbu" toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' )" - for x in $mailboxes; do case $x in *[Ii][Nn][Bb][Oo][Xx]*) formatShortcut i inbox "$x"; setBox spoolfile "$x" ;; *[Ss][Ee][Nn][Tt]*) setBox record "$x"; formatShortcut s sent "$x" ;; *[Dd][Rr][Aa][Ff][Tt][Ss]*) setBox postponed "$x"; formatShortcut d drafts "$x" ;; - *[Tt][Rr][Aa][Ss][Hh]*|*[Jj][Uu][Nn][Kk]*) formatShortcut t trash "$x"; setBox trash "$x" ;; + *[Tt][Rr][Aa][Ss][Hh]*) formatShortcut t trash "$x"; setBox trash "$x" ;; + *[Jj][Uu][Nn][Kk]*) formatShortcut j junk "$x" ;; *[Aa][Rr][Cc][Hh][Ii][Vv][Ee]*) formatShortcut a archive "$x" ;; *[Ss][Pp][Aa][Mm]*) formatShortcut S spam "$x" ;; esac done - - echo "$toappend" >> "$accdir/$idnum-$title.muttrc" - - [ -z "${online+x}" ] && printf "All done.\\n\033[33mYou should now be able to run \`\033[32mmbsync %s\033[33m\` to begin to download your mail.\033[0m\\n" "$title" - - # Create a urlview config file if non-existent. + echo "$toappend" >> "$accdir/$idnum-$fulladdr.muttrc" + [ -z "${online+x}" ] && printf "\033[33mYou should now be able to run \`\033[32mw -y %s\033[33m\` to begin to download your mail.\033[0m\\n" "$fulladdr" command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" - - return 0 -} + return 0 ;} confirm() { printf "Do you want to %s? [yes/N]\\n\t" "$@" && read -r input && ! echo "$input" | grep -qi "^yes$" && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 printf "Are you really, really sure you want to %s?\\n\t" "$@" && read -r input && ! echo "$input" | grep -qi "^yes$" && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 return 0 ;} -pick() { printf "Select an accounts to %s:\\n" "$1" +pick() { [ -n "${fulladdr+x}" ] && return 0 + echo "Select the account your would like to $1 (by number):" list read -r input - [ -z "$input" ] && return 1 - title="$(echo "$accounts" | grep "$input" | awk '{print $2}')" - [ -z "$title" ] && printf "Invalid response." && return 1 + fulladdr="$(echo "$accounts" | grep "^$input:" | cut -f2 -d' ')" + [ -z "$fulladdr" ] && echo "Invalid response." && return 1 return 0 ;} -delete() { sed -ibu "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc" ; rm -rf "$mbsyncrc"bu - rm -rf "${cachedir:?}/${title:?}" "$accdir/"[1-9]"-$title.muttrc" - sed -ibu "/[0-9]-$title.muttrc/d" "$muttrc" ; rm -f "$muttrc"bu - sed -ibu "/account $title/,/^\(\s*$\|account\)/d" "$msmtprc"; rm -f "$msmtprc"bu - } - 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 - notmuch new -} + notmuch new ;} purge() { confirm "delete all account data" || exit rm -rf "$mbsyncrc" "$accdir" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$cachedir" @@ -357,48 +322,47 @@ setaction() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then action="$1" fi; } -while getopts "gbpPlhdYD:y:i:I:s:S:u:a:" o; do case "${o}" in +while getopts "fplhdYD:y:i:I:s:S:u:a:n:" o; do case "${o}" in l) setaction list || exit 1 ;; - p) setaction pass || exit 1 ;; d) setaction delete || exit 1 ;; - D) setaction delete || exit 1 ; title="$OPTARG" ;; - y) setaction sync || exit 1 ; title="$OPTARG" ;; + D) setaction delete || exit 1 ; fulladdr="$OPTARG" ;; + y) setaction sync || exit 1 ; fulladdr="$OPTARG" ;; Y) setaction sync || exit 1 ;; - a) setaction add || exit 1 ; fulladdr="$OPTARG" ;; i) setaction add || exit 1 ; imap="$OPTARG" ;; I) setaction add || exit 1 ; iport="$OPTARG" ;; s) setaction add || exit 1 ; smtp="$OPTARG" ;; S) setaction add || exit 1 ; sport="$OPTARG" ;; u) setaction add || exit 1 ; login="$OPTARG" ;; - + n) setaction add || exit 1 ; realname="$OPTARG" ;; + m) setaction add || exit 1 ; maxmes="$OPTARG" ;; o) setaction add || exit 1 ; online=True ;; - b) setaction add || exit 1 ; force=True ;; - P) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." + f) setaction add || exit 1 ; force=True ;; + p) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." proton=True imap="127.0.0.1" - iport=1143 + iport="1143" smtp="127.0.0.1" - sport=1025 + sport="1025" + ssltype="None" + protonfinger setaction add || exit 1 ;; - - g) debug ;; - *) cat << EOF mw: mutt-wizard, auto-configure email accounts for mutt including downloadable mail with \`isync\`. Main actions: -a your@email.com Add an email address - -d Remove an already added address - -D nameofaccount Force remove account without confirmation -l List email addresses configured - -y nameofaccount Sync mail for account by name + -d Remove an already added address + -D your@email.com Force remove account without confirmation + -y your@email.com Sync mail for account by name -Y Sync mail for all accounts Options allowed with -a: -u Account login name if not full address. + -n "Real name" to be on the email account. -i IMAP server address -I IMAP server port -s SMTP server address @@ -409,15 +373,19 @@ Options allowed with -a: NOTE: Once at least one account is added, you can run \`mbsync -a\` to begin downloading mail. + +To chane an account's password, run \`pass edit ${pass_prefix}your@email.com\`. EOF +exit 1 ;; esac done +! command -v mbsync >/dev/null && [ -z "${force+x}" ] && printf "\`mbsync (isync package)\` must be installed to run mutt-wizard.\\n" && exit + case "$action" in list) list ;; add) askinfo && writeinfo && getboxes && finalize || delete ;; - pass) pick "change the password of" && getpass ;; - delete) pick delete && confirm "delete the \`$title\` profile" && delete ;; - sync) syncwrapper $title ;; + delete) delete $fulladdr ;; + sync) syncwrapper $fulladdr ;; purge) purge ;; esac diff --git a/mw.1 b/mw.1 index 55ad43c..eb344b3 100644 --- a/mw.1 +++ b/mw.1 @@ -3,7 +3,9 @@ mw \- mutt-wizard \- autoconfigure email accounts for neomutt and isync .SH SYNOPSIS .B mw - +[ +.I OPTIONS +] .SH DESCRIPTION .B mw takes a user email account and sets up a terminal-based email interface for it with @@ -16,22 +18,58 @@ for sending mail, and also passwords automatically encrypted and stored with .B pass. .SH COMMANDS .TP -.B add -configure an email account +.B -a your@email.com +add an email address .TP -.B ls +.B -l list all email accounts configured by mutt-wizard .TP -.B delete -delete the configuration files for an already configured email account +.B -d +pick an already configured account and remove its configuration .TP -.B purge -totally purge all local mutt-wizard accounts +.B -D your@email.com +remove a configured account without confirmation .TP -.B sync -sync mail accounts then update notmuch database -.B mailsync -as often as you wish +.B -y your@email.com +download and upload mail for an email account +.TP +.B -Y +sync all email accounts +.SH OPTIONS FOR ADDING ACCOUNTS +These can be specified on the command line, otherwise, you will be prompted for what is necessary. mutt-wizard knows the IMAP/SMTP server information for most email providers, so specifying them is usually redundant. +.TP +.B -u billy +Account logon/username if required and different from email address. +.TP +.B -n Billy +Real name which will appear in emails. Should be put in quotes if multiple words. +.TP +.B -m number +Set a maximum number of messages to be stored offline. +.TP +.B -i +IMAP server address +.TP +.B -I +IMAP server port (assumed to be 993 if not specified) +.TP +.B -s +SMTP server address +.TP +.B -S +SMTP server port (assumed to be 587 if not specified) +.SH OTHER OPTIONS +.TP +.B -f +Force account creation and guess mailboxes without attempting to connect to server. Otherwise if connection cannot be made, the configured account settings will not be persistent. +.TP +.B -o +Create settings for an account to be used online only without mail syncing abilities. Without +.B -f +connection will still be attempted in setup to discover mailboxes. +.TP +.B -p +Add a Protonmail account. Protonmail Bridge must be installed and set up. .SH DETAILS .TP .B Mail location @@ -52,11 +90,9 @@ and can be edited by the user if needbe. Note that the mutt-wizard will also sou file. .TP .B Mail deletion -Neither -.B delete -or -.B purge -will delete downloaded mail for safety (and time)'s sake. If you want to delete downloaded mail, do so manually by removing it from the directory above. +mutt-wizard's delete action will delete configuration files and +.I not +downloaded mail for safety (and time)'s sake. If you want to delete downloaded mail, do so manually by removing it from the directory above. .TP .B Default settings The mutt-wizard has many default settings that focus on making it aesthetically pleasing and supplying more vim-like bindings. These can be found in From 645152d9341d18e5f337b850b202b0cf61774e9d Mon Sep 17 00:00:00 2001 From: Adam Mertzenich <62816361+Mertzenich@users.noreply.github.com> Date: Sat, 10 Oct 2020 22:23:17 -0500 Subject: [PATCH 086/101] Update domains.csv --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index c57aa25..5119d76 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -146,6 +146,7 @@ logorroici.org,mail.autistici.org,993,smtp.autistici.org,465 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 +luther.edu,imap.gmail.com,993,smtp.gmail.com,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 From c08cfd53654bb3046502955c93399861b487c760 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 11 Oct 2020 19:29:34 -0400 Subject: [PATCH 087/101] more --- bin/mw | 50 ++++++++-------------------------------- share/mutt-wizard.muttrc | 2 +- 2 files changed, 11 insertions(+), 41 deletions(-) diff --git a/bin/mw b/bin/mw index 387747a..6f4448f 100755 --- a/bin/mw +++ b/bin/mw @@ -94,7 +94,7 @@ bind index,pager g noop bind index,pager M noop bind index,pager C noop bind index gg first-entry -macro index o \"mbsync -V $fulladdr\" \"run mbsync to sync $fulladdr\" +macro index o \"mw -y $fulladdr\" \"run mbsync to sync $fulladdr\" unmailboxes * " else @@ -182,42 +182,31 @@ askinfo() { \ } -writeinfo() { - # Insert account information into variables. - getprofiles - - # Create required directories. - mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$maildir/$fulladdr" +writeinfo() { mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$maildir/$fulladdr" # Get accounts and find the first missing account number (max. 9). getaccounts for x in $(seq 1 9); do echo "$accounts" | grep -q "$x" || { export idnum="$x"; break ;}; done - # Create msmtprc file if not present. + # Configure msmtprc for sending mail. [ ! -f "$msmtprc" ] && echo "$msmtp_header" > "$msmtprc" - - # Add account msmtp settings. echo "$msmtp_profile" >> "$msmtprc" - # On Ubuntu/Debian, a link is needed since they use an older version. command -V apt-get >/dev/null 2>&1 && ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null - # Create the individual mutt config file for the account. - echo "$mutt_profile" > "$accdir/$idnum-$fulladdr.muttrc" - # Create the mbsync config file. mkdir -p "${mbsyncrc%/*}" echo "$mbsync_profile" >> "$mbsyncrc" - # Create a notmuch config file if not present already. - notmuchauto - - # Create a basic muttrc is not present and source the mutt-wizard files - # and add the shortcuts to the account. - [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created." + # Create a muttrc for viewing mail. + echo "$mutt_profile" > "$accdir/$idnum-$fulladdr.muttrc" + [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" ! grep -q "^source.*mutt-wizard.muttrc" "$muttrc" && echo "source $mwconfig $MARKER" >> "$muttrc" ! grep "^source.*.muttrc" "$muttrc" | grep -qv "$mwconfig" && echo "source $accdir/$idnum-$fulladdr.muttrc $MARKER" >> "$muttrc" echo "macro index,pager i$idnum 'source $accdir/$idnum-$fulladdr.muttrc!;' \"switch to $fulladdr\" $MARKER" >> "$muttrc" + + # Create a notmuch config file if not present already. + notmuchauto } protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" @@ -269,30 +258,12 @@ finalize() { echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$fulladdr/{}/cur command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" return 0 ;} -confirm() { printf "Do you want to %s? [yes/N]\\n\t" "$@" && read -r input && ! echo "$input" | grep -qi "^yes$" && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 - printf "Are you really, really sure you want to %s?\\n\t" "$@" && read -r input && ! echo "$input" | grep -qi "^yes$" && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 - return 0 ;} - -pick() { [ -n "${fulladdr+x}" ] && return 0 - echo "Select the account your would like to $1 (by number):" - list - read -r input - fulladdr="$(echo "$accounts" | grep "^$input:" | cut -f2 -d' ')" - [ -z "$fulladdr" ] && echo "Invalid response." && return 1 - return 0 ;} - 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 notmuch new ;} -purge() { confirm "delete all account data" || exit - rm -rf "$mbsyncrc" "$accdir" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$cachedir" - echo "All configs and account settings have been purged." - sed -ibu "/$MARKER/d" "$muttrc" ; rm -f "$muttrc"bu -} - notmuchauto() { \ [ -z "$NOTMUCH_CONFIG" ] && NOTMUCH_CONFIG="$HOME/.notmuch-config" [ -f "$NOTMUCH_CONFIG" ] && return 0 @@ -384,8 +355,7 @@ esac done case "$action" in list) list ;; - add) askinfo && writeinfo && getboxes && finalize || delete ;; + add) askinfo && getprofiles && writeinfo && getboxes && finalize || delete ;; delete) delete $fulladdr ;; sync) syncwrapper $fulladdr ;; - purge) purge ;; esac diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 57df579..de169db 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -80,7 +80,7 @@ set sidebar_width = 20 set sidebar_short_path = yes set sidebar_next_new_wrap = yes set mail_check_stats -set sidebar_format = '%B%?F? [%F]?%* %?N?%N/? %?S?%S?' +set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?' bind index,pager \Ck sidebar-prev bind index,pager \Cj sidebar-next bind index,pager \Co sidebar-open From 9fa021377427122c57e6a40813f7eb3fc4df18d3 Mon Sep 17 00:00:00 2001 From: zneix <44851575+zneix@users.noreply.github.com> Date: Mon, 12 Oct 2020 09:13:55 +0200 Subject: [PATCH 088/101] Fixed a typo in successful logon message It was a bit confusing when it said "use `w -y user@example.com` to sync your mail" --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 387747a..71ac332 100755 --- a/bin/mw +++ b/bin/mw @@ -265,7 +265,7 @@ finalize() { echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$fulladdr/{}/cur esac done echo "$toappend" >> "$accdir/$idnum-$fulladdr.muttrc" - [ -z "${online+x}" ] && printf "\033[33mYou should now be able to run \`\033[32mw -y %s\033[33m\` to begin to download your mail.\033[0m\\n" "$fulladdr" + [ -z "${online+x}" ] && printf "\033[33mYou should now be able to run \`\033[32mmw -y %s\033[33m\` to begin to download your mail.\033[0m\\n" "$fulladdr" command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" return 0 ;} From 317c36ca87bfff66316cce792d6a306ff1d1e05b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 12 Oct 2020 09:05:46 -0400 Subject: [PATCH 089/101] more more --- bin/mw | 66 ++++++++++++++++++++++++++-------------------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/bin/mw b/bin/mw index cb65be3..4a9970d 100755 --- a/bin/mw +++ b/bin/mw @@ -125,22 +125,18 @@ fi printf "DONE.\\n" } -parsedomains(){ \ - # Parses the domains.csv file for server information and sets - # the required variables unless overridden by the user. - serverinfo="$(grep "^${fulladdr#*@}" "$muttshare/domains.csv" 2>/dev/null)" +parsedomains(){ serverinfo="$(grep "^${fulladdr#*@}" "$muttshare/domains.csv" 2>/dev/null)" - [ -z "$serverinfo" ] && - serverinfo="$(grep "$(echo "${fulladdr#*@}" | sed "s/\.[^\.]*$/\.\\\*/")" "$muttshare/domains.csv" 2>/dev/null)" + [ -z "$serverinfo" ] && serverinfo="$(grep "$(echo "${fulladdr#*@}" | sed "s/\.[^\.]*$/\.\\\*/")" "$muttshare/domains.csv" 2>/dev/null)" - IFS=, read -r service imapsugg iportsugg smtpsugg sportsugg < "$msmtprc" @@ -205,8 +200,7 @@ writeinfo() { mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_ ! grep "^source.*.muttrc" "$muttrc" | grep -qv "$mwconfig" && echo "source $accdir/$idnum-$fulladdr.muttrc $MARKER" >> "$muttrc" echo "macro index,pager i$idnum 'source $accdir/$idnum-$fulladdr.muttrc!;' \"switch to $fulladdr\" $MARKER" >> "$muttrc" - # Create a notmuch config file if not present already. - notmuchauto + notmuchauto # Create a notmuch config file if not present already. } protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" @@ -283,9 +277,7 @@ synchronize_flags=true gpg_path=$GPG" echo "$nmbasic" > "$NOTMUCH_CONFIG" ;} -trap 'echo -e "\033[0m\n"; exit' INT ABRT - -setaction() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then +setact() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then echo "Running $1 with $action..." echo "Incompatible options given. Only one action may be specified per run." return 1 @@ -293,22 +285,24 @@ setaction() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then action="$1" fi; } +trap 'echo -e "\033[0m\n"; exit' INT ABRT + while getopts "fplhdYD:y:i:I:s:S:u:a:n:" o; do case "${o}" in - l) setaction list || exit 1 ;; - d) setaction delete || exit 1 ;; - D) setaction delete || exit 1 ; fulladdr="$OPTARG" ;; - y) setaction sync || exit 1 ; fulladdr="$OPTARG" ;; - Y) setaction sync || exit 1 ;; - a) setaction add || exit 1 ; fulladdr="$OPTARG" ;; - i) setaction add || exit 1 ; imap="$OPTARG" ;; - I) setaction add || exit 1 ; iport="$OPTARG" ;; - s) setaction add || exit 1 ; smtp="$OPTARG" ;; - S) setaction add || exit 1 ; sport="$OPTARG" ;; - u) setaction add || exit 1 ; login="$OPTARG" ;; - n) setaction add || exit 1 ; realname="$OPTARG" ;; - m) setaction add || exit 1 ; maxmes="$OPTARG" ;; - o) setaction add || exit 1 ; online=True ;; - f) setaction add || exit 1 ; force=True ;; + l) setact list || exit 1 ;; + d) setact delete || exit 1 ;; + D) setact delete || exit 1 ; fulladdr="$OPTARG" ;; + y) setact sync || exit 1 ; fulladdr="$OPTARG" ;; + Y) setact sync || exit 1 ;; + a) setact add || exit 1 ; fulladdr="$OPTARG" ;; + i) setact add || exit 1 ; imap="$OPTARG" ;; + I) setact add || exit 1 ; iport="$OPTARG" ;; + s) setact add || exit 1 ; smtp="$OPTARG" ;; + S) setact add || exit 1 ; sport="$OPTARG" ;; + u) setact add || exit 1 ; login="$OPTARG" ;; + n) setact add || exit 1 ; realname="$OPTARG" ;; + m) setact add || exit 1 ; maxmes="$OPTARG" ;; + o) setact add || exit 1 ; online=True ;; + f) setact add || exit 1 ; force=True ;; p) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." proton=True imap="127.0.0.1" @@ -317,7 +311,7 @@ while getopts "fplhdYD:y:i:I:s:S:u:a:n:" o; do case "${o}" in sport="1025" ssltype="None" protonfinger - setaction add || exit 1 + setact add || exit 1 ;; *) cat << EOF mw: mutt-wizard, auto-configure email accounts for mutt From 4c268e53c7dd7b023222cf18d042268d70b6c028 Mon Sep 17 00:00:00 2001 From: Gergely Peidl Date: Mon, 12 Oct 2020 18:58:04 +0200 Subject: [PATCH 090/101] Fix typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a7629f..25c0e7e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The mutt-wizard is run with the command `mw`. Once everything is setup, you'll u - `mw -a you@email.com` -- add a new email account - `mw -l` -- list existing accounts - `mw -y your@email.com` -- sync an email account -- `my -Y` -- sync all configured email accounts +- `mw -Y` -- sync all configured email accounts - `mw -d` -- choose an account to delete - `mw -D your@email.com` -- delete account settings without confirmation - `pass edit mw-your@email.com` -- revise an account's password From ca6cbd54b82ceb0d7b4c0987dff2c2b3b30b15fe Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 12 Oct 2020 18:50:10 -0400 Subject: [PATCH 091/101] passwords can be given by commandline --- README.md | 1 + bin/mw | 14 +++++++++++--- mw.1 | 3 +++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0a7629f..10bdc1f 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ The mutt-wizard is run with the command `mw`. Once everything is setup, you'll u - `-s` -- SMTP server address - `-S` -- SMTP server port (otherwise assumed to be 587) - `-m` -- Maximum number of emails to be kept offline. No maximum is default functionality. +- `-x` -- Account password. You will be prompted for it otherwise. #### General Settings diff --git a/bin/mw b/bin/mw index 4a9970d..eeebe53 100755 --- a/bin/mw +++ b/bin/mw @@ -122,7 +122,6 @@ bind index gg first-entry unmailboxes * " fi - printf "DONE.\\n" } parsedomains(){ serverinfo="$(grep "^${fulladdr#*@}" "$muttshare/domains.csv" 2>/dev/null)" @@ -156,6 +155,7 @@ delete() { if [ -z "${fulladdr+x}" ]; then rm -rf "${cachedir:?}/${fulladdr:?}" "$accdir/"[1-9]"-$fulladdr.muttrc" sed -ibu "/[0-9]-$fulladdr.muttrc/d" "$muttrc" ; rm -f "$muttrc"bu sed -ibu "/account $fulladdr/,/^\(\s*$\|account\)/d" "$msmtprc"; rm -f "$msmtprc"bu + pass rm -f "$pass_prefix$fulladdr" >/dev/null 2>&1 } askinfo() { \ @@ -174,9 +174,16 @@ askinfo() { \ [ -z "$realname" ] && echo "Give the name you would like to be identified by on the email account:" && read -r realname login="${login:-$fulladdr}" - getpass + if [ -n "${password+x}" ]; then + createpass + else + getpass + fi } +createpass() { echo "$password" > "$PASSWORD_STORE_DIR/$pass_prefix$fulladdr" + "$GPG" -qer "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" "$PASSWORD_STORE_DIR/$pass_prefix$fulladdr" + rm -f "$PASSWORD_STORE_DIR/$pass_prefix$fulladdr" ;} writeinfo() { mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$maildir/$fulladdr" @@ -287,7 +294,7 @@ setact() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then trap 'echo -e "\033[0m\n"; exit' INT ABRT -while getopts "fplhdYD:y:i:I:s:S:u:a:n:" o; do case "${o}" in +while getopts "fplhdYD:y:i:I:s:S:u:a:n:x:" o; do case "${o}" in l) setact list || exit 1 ;; d) setact delete || exit 1 ;; D) setact delete || exit 1 ; fulladdr="$OPTARG" ;; @@ -303,6 +310,7 @@ while getopts "fplhdYD:y:i:I:s:S:u:a:n:" o; do case "${o}" in m) setact add || exit 1 ; maxmes="$OPTARG" ;; o) setact add || exit 1 ; online=True ;; f) setact add || exit 1 ; force=True ;; + x) setact add || exit 1 ; password="$OPTARG" ;; p) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." proton=True imap="127.0.0.1" diff --git a/mw.1 b/mw.1 index eb344b3..3ed4d95 100644 --- a/mw.1 +++ b/mw.1 @@ -58,6 +58,9 @@ SMTP server address .TP .B -S SMTP server port (assumed to be 587 if not specified) +.TP +.B -x +Account password. You will be prompted for the password interactively if this option is not given. .SH OTHER OPTIONS .TP .B -f From 6f02c6b995795ac788ced8fad5e83bff17444481 Mon Sep 17 00:00:00 2001 From: Marc <40807627+marcwallach@users.noreply.github.com> Date: Tue, 13 Oct 2020 17:32:12 -0300 Subject: [PATCH 092/101] Fix typo --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index eeebe53..cf5011a 100755 --- a/bin/mw +++ b/bin/mw @@ -347,7 +347,7 @@ Options allowed with -a: NOTE: Once at least one account is added, you can run \`mbsync -a\` to begin downloading mail. -To chane an account's password, run \`pass edit ${pass_prefix}your@email.com\`. +To change an account's password, run \`pass edit ${pass_prefix}your@email.com\`. EOF exit 1 ;; From befa419f64c643dc20e173cd1634e92bd2ebe1bd Mon Sep 17 00:00:00 2001 From: Yiqun Ding Date: Thu, 15 Oct 2020 14:22:19 +0800 Subject: [PATCH 093/101] add mail server setting for Zhejiang University --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 5119d76..45edcca 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -278,5 +278,6 @@ 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 +zju.edu.cn,imap.zju.edu.cn,993,smtp.zju.edu.cn,994 zoho.com,imap.zoho.com,993,smtp.zoho.com,465 zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 From 27dc2f9be66388530007a71148a5f70571077d72 Mon Sep 17 00:00:00 2001 From: Julian Marcos Date: Sun, 18 Oct 2020 19:22:32 +0200 Subject: [PATCH 094/101] Added e.email service --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 45edcca..d982ee8 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -281,3 +281,4 @@ zaclys.net,mail.zaclys.net,993,mail.zaclys.net,465 zju.edu.cn,imap.zju.edu.cn,993,smtp.zju.edu.cn,994 zoho.com,imap.zoho.com,993,smtp.zoho.com,465 zohomail.eu,imap.zoho.eu,993,smtp.zoho.eu,465 +e.email,mail.ecloud.global,993.00,mail.ecloud.global,587.00 From a978f36ec2a4309ed545009552797ef52e14b2d6 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 20 Oct 2020 19:05:06 -0400 Subject: [PATCH 095/101] protonmail fingerprint fix --- bin/mw | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/mw b/bin/mw index cf5011a..59ef132 100755 --- a/bin/mw +++ b/bin/mw @@ -48,7 +48,7 @@ port ${sport:-587} from $fulladdr user $login passwordeval \"pass $pass_prefix$fulladdr\" -$starttlsoff +$tlsline " mbsync_profile="IMAPStore $fulladdr-remote Host $imap @@ -170,7 +170,7 @@ askinfo() { \ read -r imap [ -z "$smtp" ] && echo "Give your email server's SMTP address (excluding the port number):" && read -r smtp - [ "$sport" = 465 ] && starttlsoff="tls_starttls off" + [ "$sport" = 465 ] && tlsline="tls_starttls off" [ -z "$realname" ] && echo "Give the name you would like to be identified by on the email account:" && read -r realname login="${login:-$fulladdr}" @@ -210,10 +210,6 @@ writeinfo() { mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_ notmuchauto # Create a notmuch config file if not present already. } -protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" - fingerprint="$(msmtp --serverinfo --host=$smtp --port=$sport --tls --tls-certcheck=off | grep SHA256: | sed 's/^.*: //')" - sed -ibu "s/account $fulladdr/&\ntls_trust_file\ntls_fingerprint $fingerprint/" "$msmtprc" ; rm -f "$msmtprc"bu ;} - getpass() { while : ; do pass rm -f "$pass_prefix$fulladdr" >/dev/null 2>&1 pass insert "$pass_prefix$fulladdr" && break; done ;} @@ -318,7 +314,7 @@ while getopts "fplhdYD:y:i:I:s:S:u:a:n:x:" o; do case "${o}" in smtp="127.0.0.1" sport="1025" ssltype="None" - protonfinger + tlsline="tls_fingerprint $(msmtp --serverinfo --host=$smtp --port=$sport --tls --tls-certcheck=off | awk '/SHA256:/ {print $2}')" setact add || exit 1 ;; *) cat << EOF From 96c2492e6de2b7052f049e7645d182b883a107f3 Mon Sep 17 00:00:00 2001 From: inktrap Date: Tue, 27 Oct 2020 23:49:46 +0100 Subject: [PATCH 096/101] extend list to also work for symlinked accounts --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index cf5011a..3e83ab2 100755 --- a/bin/mw +++ b/bin/mw @@ -30,7 +30,7 @@ do [ -f "$x" ] && sslcert="$x" && break done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1 ;} -getaccounts() { accounts="$(find "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} +getaccounts() { accounts="$(find "$accdir" -type f -or -type l | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" ;} From 16a5a450a4e9d65bbf6823a95ac37de9d2ed2aec Mon Sep 17 00:00:00 2001 From: inktrap Date: Wed, 28 Oct 2020 01:04:14 +0100 Subject: [PATCH 097/101] use -L --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 3e83ab2..b00f597 100755 --- a/bin/mw +++ b/bin/mw @@ -30,7 +30,7 @@ do [ -f "$x" ] && sslcert="$x" && break done || { echo "CA Certificate not found. Please install one or link it to /etc/ssl/certs/ca-certificates.crt" && exit 1 ;} -getaccounts() { accounts="$(find "$accdir" -type f -or -type l | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} +getaccounts() { accounts="$(find -L "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /;s/\.muttrc$//" | sort -n)" ;} list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" ;} From e7180e1b570532c18613106c5786c1172d22831b Mon Sep 17 00:00:00 2001 From: Yiqun Ding Date: Wed, 28 Oct 2020 11:25:51 +0800 Subject: [PATCH 098/101] fix macro for sync all accounts the macro for sync all accounts uses 'mbsync -a' command, which failed to run for users who have moved their ~/.mbsyncrc somewhere else. we should use mw -Y instead, which can detect the MBSYNCRC env --- 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 de169db..ac4883e 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -70,7 +70,7 @@ bind editor complete-query 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" +macro index O "mw -Y" "run mw -Y to sync all mail" macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" macro index A "all\n" "show all messages (undo limit)" From 12664a3f596b347b98ad33e5ff911f8396d5dedc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 28 Oct 2020 10:24:14 -0400 Subject: [PATCH 099/101] error code on failure --- bin/mw | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/mw b/bin/mw index 59ef132..e02d3ab 100755 --- a/bin/mw +++ b/bin/mw @@ -330,12 +330,13 @@ Main actions: -Y Sync mail for all accounts Options allowed with -a: - -u Account login name if not full address. - -n "Real name" to be on the email account. + -u Account login name if not full address + -n "Real name" to be on the email account -i IMAP server address -I IMAP server port -s SMTP server address -S SMTP server port + -x Password for account (recommended to be in double quotes) -p Install for a Protonmail account. -o Configure address, but keep mail online. -b Assume typical English mailboxes without attempting log-on. @@ -353,7 +354,7 @@ esac done case "$action" in list) list ;; - add) askinfo && getprofiles && writeinfo && getboxes && finalize || delete ;; + add) askinfo && getprofiles && writeinfo && getboxes && finalize || { delete ; exit 1 ;} ;; delete) delete $fulladdr ;; sync) syncwrapper $fulladdr ;; esac From ab11cd83229325b8b86d4ed46d5b7b1b4795b460 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 28 Oct 2020 10:26:15 -0400 Subject: [PATCH 100/101] suppress autoview messages --- share/mutt-wizard.muttrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index de169db..a7aa26a 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -22,8 +22,9 @@ set forward_quote # include message in forwards set reverse_name # reply as whomever it was to set include # include message in replies set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) -auto_view text/html # automatically show html (mailcap uses w3m) +auto_view text/html # automatically show html (mailcap uses lynx) auto_view application/pgp-encrypted +set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. alternative_order text/plain text/enriched text/html bind index,pager i noop bind index,pager g noop From a22d223d7988538560b1227747699d16ff7114b2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 28 Oct 2020 10:38:04 -0400 Subject: [PATCH 101/101] fix #557 --- bin/mw | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/mw b/bin/mw index e02d3ab..11d59e9 100755 --- a/bin/mw +++ b/bin/mw @@ -13,7 +13,6 @@ pass_prefix="mw-" 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 muttshare="$prefix/share/mutt-wizard" mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}" @@ -228,7 +227,7 @@ Trash Sent Archive" && return 0 if mailboxes="$(mbsync -l "$fulladdr" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then - [ "$accounttype" = "online" ] && sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu + [ -n "${online+x}" ] && sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu return 0 else echo "$mailboxes" @@ -290,7 +289,7 @@ setact() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then trap 'echo -e "\033[0m\n"; exit' INT ABRT -while getopts "fplhdYD:y:i:I:s:S:u:a:n:x:" o; do case "${o}" in +while getopts "fplhodYD:y:i:I:s:S:u:a:n:x:m:" o; do case "${o}" in l) setact list || exit 1 ;; d) setact delete || exit 1 ;; D) setact delete || exit 1 ; fulladdr="$OPTARG" ;; @@ -308,7 +307,6 @@ while getopts "fplhdYD:y:i:I:s:S:u:a:n:x:" o; do case "${o}" in f) setact add || exit 1 ; force=True ;; x) setact add || exit 1 ; password="$OPTARG" ;; p) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." - proton=True imap="127.0.0.1" iport="1143" smtp="127.0.0.1"