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 01/30] 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 02/30] 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 03/30] 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 04/30] 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 05/30] 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 06/30] 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 07/30] 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 08/30] 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 09/30] 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 10/30] 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 11/30] 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 12/30] 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 13/30] 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 14/30] 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 15/30] 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 16/30] 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 17/30] 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 18/30] 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 19/30] 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 20/30] 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 21/30] 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 22/30] 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 23/30] 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 24/30] 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 25/30] 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 26/30] 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 27/30] 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 28/30] 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 29/30] 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 30/30] 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 ;}