From 04a1e46ee1dfe1787b62e4402048ce75f08df1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Battistella=20Nadas?= Date: Tue, 3 May 2022 09:10:16 +0200 Subject: [PATCH 01/20] added domain for freedom.nl --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index adbe06d..aedb0d6 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -107,6 +107,7 @@ fct.unl.pt,imap.gmail.com,993,smtp.gmail.com,587 firemail.cc,mail.cock.li,993,mail.cock.li,587 forpsi.com,imap.forpsi.com,993,smtp.forpsi.com,465 forthnet.gr,mail.forthnet.gr,993,smtp-auth.forthnet.gr,465 +freedom.nl,imap.freedom.nl,993,smtp.freedom.nl,465 freedom.xyz,imap.nixnet.email,143,smtp.nixnet.email,587 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 From e1d47ea4830a41220e0a9754ad61bd71bcd81d51 Mon Sep 17 00:00:00 2001 From: rl Date: Fri, 13 May 2022 17:40:35 +0300 Subject: [PATCH 02/20] added encryption shortcut in neomutt interface description --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7626e4d..479870f 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ To give you an example of the interface, here's an idea: - `?` - see all keyboard shortcuts - `ctrl-j`/`ctrl-k` - move up and down in sidebar, `ctrl-o` opens mailbox. - `ctrl-b` - open a menu to select a URL you want to open in your browser. +- `p` - before sending mail choose to encrypt/sign your message ## Additional functionality From 162441dde07cf9c811085f3dbb7fee2ce4fa3522 Mon Sep 17 00:00:00 2001 From: rickylinden <59360547+rickylinden@users.noreply.github.com> Date: Fri, 13 May 2022 17:45:43 +0300 Subject: [PATCH 03/20] Update README.md Clearer description of encryption shortcut. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 479870f..b634fc7 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ To give you an example of the interface, here's an idea: - `?` - see all keyboard shortcuts - `ctrl-j`/`ctrl-k` - move up and down in sidebar, `ctrl-o` opens mailbox. - `ctrl-b` - open a menu to select a URL you want to open in your browser. -- `p` - before sending mail choose to encrypt/sign your message +- `p` - encrypt/sign your message (in compose view, before sending the email). ## Additional functionality From 7c4f552cfb566d2244239e616b1c0afb79db8fc0 Mon Sep 17 00:00:00 2001 From: Gil Oliveira Date: Sun, 22 May 2022 19:37:36 +0100 Subject: [PATCH 04/20] Add purelymail.com to domains.csv --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index adbe06d..bba5bf9 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -228,6 +228,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 +purelymail.com,imap.purelymail.com,993,smtp.purelymail.com,465 pwned.life,imap.nixnet.email,143,smtp.nixnet.email,587 qq.com,imap.qq.com,993,smtp.qq.com,587 rape.lol,mail.cock.li,993,mail.cock.li,587 From f2014408b984c7e5814d1021cab55624cbed7ae6 Mon Sep 17 00:00:00 2001 From: Kr1ss Date: Tue, 31 May 2022 18:19:40 +0200 Subject: [PATCH 05/20] fix notifications when the Xorg process is just X To close #845 : I added the `-x` flag to prevent the regex from matching on _every_ pro- cess name containing an `X`. Because I'm not entirely sure about portability (does every `pgrep` va- riant support that flag), I didn't push this directly. So what do you think @LukeSmithxyz ? --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index 97cd224..2f32c14 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -42,7 +42,7 @@ case "$(uname)" in *systemd*|*openrc*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; esac # remember if a display server is running since `ps` doesn't always contain a display - pgrepoutput="$(pgrep -a X\(org\|wayland\))" + pgrepoutput="$(pgrep -ax X\(\|org\|wayland\))" displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)" notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do export DISPLAY=$x From 3a2f4a55fa966a6c095639193cb9ab1f3a3d8229 Mon Sep 17 00:00:00 2001 From: f380cedric Date: Fri, 10 Jun 2022 18:16:29 +0200 Subject: [PATCH 06/20] Fix: find & case-insensitive filesystem On case-insensitive filesystem, `inbox` and `Inbox` are the same path. Running `find Inbox inbox [expr]` will print twice the same information. Use shell glob instead: `find` will descend into path `inbox`, ignoring letter cases, only once. Fix #828. --- bin/mailsync | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 2f32c14..0d2983f 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -56,12 +56,8 @@ 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/"\ - "$HOME/.local/share/mail/$acc/INBOX/cur/"\ - "$HOME/.local/share/mail/$acc/Inbox/cur/"\ - "$HOME/.local/share/mail/$acc/inbox/cur/"\ + "$HOME/.local/share/mail/$acc/"[Ii][Nn][Bb][Oo][Xx]/new/\ + "$HOME/.local/share/mail/$acc/"[Ii][Nn][Bb][Oo][Xx]/cur/\ -type f -newer "$lastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) case 1 in From 72fcb51e2434afe4e672019c5fce08d7fdfa8b86 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 14 Jun 2022 07:45:16 -0600 Subject: [PATCH 07/20] remove harmless sed error msg if no muttrc --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 04361fc..d8d4d73 100755 --- a/bin/mw +++ b/bin/mw @@ -224,7 +224,7 @@ getboxes() { if [ -n "${force+x}" ] ; then mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')" fi [ "$type" = "pop" ] && mailboxes="INBOX" - for x in $(sed -n "/^macro.* i[0-9] / s/\(^macro.* i\| .*\)//gp " "$muttrc" | sort -u; echo 0); do + for x in $(sed -n "/^macro.* i[0-9] / s/\(^macro.* i\| .*\)//gp " "$muttrc" 2>/dev/null | sort -u; echo 0); do idnum=$((idnum + 1)) [ "$idnum" -eq "$x" ] || break done From ef8cda91cf58be7eec314b4752a4085f4afbec3a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 21 Jun 2022 12:59:23 -0400 Subject: [PATCH 08/20] fix #792, fix #820 --- share/mutt-wizard.muttrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 3cefeeb..4df16a4 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -57,8 +57,10 @@ bind index,query tag-entry macro browser h '..' "Go to parent folder" bind index,pager H view-raw-message bind browser l select-entry -bind pager,browser gg top-page -bind pager,browser G bottom-page +bind browser gg top-page +bind browser G bottom-page +bind pager gg top +bind pager G bottom bind index,pager,browser d half-down bind index,pager,browser u half-up bind index,pager S sync-mailbox From 367c10ec3f16c3c11e1a5de980bc95dd4fa6bf79 Mon Sep 17 00:00:00 2001 From: jw Date: Fri, 1 Jul 2022 00:12:04 +0200 Subject: [PATCH 09/20] Silence mailsync, so cron doesn't spam e-mails on every update --- bin/mailsync | 7 +++---- bin/mw | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 2f32c14..6aba835 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -70,14 +70,13 @@ syncandnotify() { } # Sync accounts passed as argument or all. -if [ "$#" -eq "0" ]; then - accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")" -else +if [ "$#" -gt "0" ]; then for arg in "$@"; do [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1 done accounts=$* fi +[[ ! $accounts ]] && accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")" # Parallelize multiple accounts for account in $accounts; do @@ -86,7 +85,7 @@ done wait -notmuch new 2>/dev/null +notmuch new --quiet #Create a touch file that indicates the time of the last run of mailsync touch "$lastrun" diff --git a/bin/mw b/bin/mw index d8d4d73..8a89a17 100755 --- a/bin/mw +++ b/bin/mw @@ -262,7 +262,7 @@ togglecron() { cron="$(mktemp)" sed -ibu /mailsync/d "$cron"; rm -f "$cron"bu else echo "Adding automatic mailsync every ${cronmin:-10} minutes..." - echo "*/${cronmin-10} * * * * $prefix/bin/mailsync" >> "$cron" + echo "*/${cronmin:-10} * * * * $prefix/bin/mailsync -q" >> "$cron" fi && crontab "$cron"; rm -f "$cron" ;} From ef5bac2b55e3bd665d103eff4ea435ecaa9db22c Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 1 Jul 2022 09:38:07 -0400 Subject: [PATCH 10/20] remove Protonmail support. POP server now -p --- README.md | 14 ++------------ bin/mw | 17 +++-------------- mw.1 | 8 +------- share/domains.csv | 3 --- 4 files changed, 6 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index b634fc7..90243b6 100644 --- a/README.md +++ b/README.md @@ -99,11 +99,10 @@ The mutt-wizard runs via the command `mw`. Once setup is complete, you'll use #### 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. -- `-P` -- Use POP protocol instead of IMAP (requires `mpop` installed). +- `-p` -- Use POP protocol instead of IMAP (requires `mpop` installed). ## Neomutt user interface @@ -168,7 +167,7 @@ To give you an example of the interface, here's an idea: errors generally. - Addition of a manual `man mw` - Now handles POP protocol via `mpop` for those who prefer it (add an account - with the `-P` option). POP configs are still generated automatically. + with the `-p` option). POP configs are still generated automatically. ## Help the Project! @@ -205,15 +204,6 @@ See Luke's website [here](https://lukesmith.xyz). Email him at 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 require a "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. diff --git a/bin/mw b/bin/mw index d8d4d73..f0b46e2 100755 --- a/bin/mw +++ b/bin/mw @@ -297,8 +297,7 @@ Options allowed with -a: -s SMTP server address -S SMTP server port -x Password for account (recommended to be in double quotes) - -p Install for a Protonmail account. - -P Add for a POP server instead of IMAP. + -p Add for a POP server instead of IMAP. -X Delete an account's local email too when deleting. -o Configure address, but keep mail online. -f Assume typical English mailboxes without attempting log-on. @@ -333,7 +332,7 @@ reorder() { ' "$tempfile" >> "$muttrc" } -while getopts "rfpPXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in +while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in l) setact list || exit 1 ;; r) setact reorder || exit 1 ;; d) setact delete || exit 1 ;; @@ -349,22 +348,12 @@ while getopts "rfpPXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in n) setact add || exit 1 ; realname="$OPTARG" ;; m) setact add || exit 1 ; maxmes="$OPTARG" ;; o) setact add || exit 1 ; type="online" ;; - P) setact add || exit 1 ; type="pop"; protocol="pop3s" ; iport="${iport:-995}" ;; + p) setact add || exit 1 ; type="pop"; protocol="pop3s" ; iport="${iport:-995}" ;; f) setact add || exit 1 ; force=True ;; x) setact add || exit 1 ; password="$OPTARG" ;; X) setact delete || exit 1 ; purge=True ;; t) setact toggle || exit 1 ; cronmin="$OPTARG" ;; T) setact toggle || exit 1 ;; - p) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." - protocol="imap" - imap="127.0.0.1" - iport="1143" - smtp="127.0.0.1" - sport="1025" - auth="login" - tlsline="tls_fingerprint $(msmtp --serverinfo --host=$smtp --port=$sport --tls --tls-certcheck=off | sed -n '/SHA256:/ s/^\s*SHA256:\s*// p')" - setact add || exit 1 - ;; *) mwinfo; exit 1 ;; esac done diff --git a/mw.1 b/mw.1 index 2172f80..c3cbd07 100644 --- a/mw.1 +++ b/mw.1 @@ -80,9 +80,6 @@ Create settings for an account to be used online only without mail syncing abili .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. -.TP .B -X When removing an email profile with either .I -d @@ -90,7 +87,7 @@ or .I -D, also delete the local mail (will not delete the mail on the server). .TP -.B -P +.B -p Use POP protocol instead of IMAP. Requires .I mpop to download mail after configuration. Server details can still be given with the @@ -155,9 +152,6 @@ on mutt-wizard's Github or Gitlab .B Gmail accounts Google will require you to allow "less-secure" (third party) applications or remove two-factor authentication in order to access their IMAP servers to download your mail. If you use Gmail, be sure to handle this before running mutt-wizard . .TP -.B Protonmail accounts -Protonmail users must use the Protonmail Bridge to access their IMAP and SMTP servers. This too should be configured before running mutt-wizard. -.TP .B Enterprise and university accounts Many universities and businesses might host their domain's email via Google or another service. This often requires a special IMAP/SMTP-specific password that you must generate and use. Again, mutt-wizard can handle these systems, but only once they've been set up. .TP diff --git a/share/domains.csv b/share/domains.csv index be0086e..77a20af 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -217,7 +217,6 @@ parabolas.xyz,mail.parabolas.xyz,993,mail.parabolas.xyz,587 paranoici.org,mail.autistici.org,993,smtp.autistici.org,465 paranoid.email,imap.paranoid.email,993,smtp.paranoid.email,25 paranoid.network,imap.nixnet.email,143,smtp.nixnet.email,587 -pm.me,127.0.0.1,1143,127.0.0.1,1025 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 @@ -227,8 +226,6 @@ posteo.*,posteo.de,993,posteo.de,587 privacy.xyz,imap.nixnet.email,143,smtp.nixnet.email,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 -protonmail.com,127.0.0.1,1143,127.0.0.1,1025 purelymail.com,imap.purelymail.com,993,smtp.purelymail.com,465 pwned.life,imap.nixnet.email,143,smtp.nixnet.email,587 qq.com,imap.qq.com,993,smtp.qq.com,587 From caf2681891eb3fbe04bd10ba30369ffe8e8616d4 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 1 Jul 2022 10:00:34 -0400 Subject: [PATCH 11/20] remove bashism --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index 6aba835..f100cd0 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -76,7 +76,7 @@ if [ "$#" -gt "0" ]; then done accounts=$* fi -[[ ! $accounts ]] && accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")" +[ -z "$accounts" ] && accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")" # Parallelize multiple accounts for account in $accounts; do From 30c1c0d2ae1ea4439986b1868557bbd2cc9e297a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 1 Jul 2022 17:35:52 -0400 Subject: [PATCH 12/20] fix #785 since cron now silent --- bin/mailsync | 2 -- 1 file changed, 2 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index f100cd0..c924de5 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -11,8 +11,6 @@ # issues. It also should at least be compatible with Linux (and maybe BSD) with # Xorg and MacOS as well. -# 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 mbsync >/dev/null && { echo "mbsync is already running."; exit ;} From 2aae3860a2531c872ac69285da2b52801b73e864 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 1 Jul 2022 18:30:29 -0400 Subject: [PATCH 13/20] rm paypal crap, replace with xmr/btc. add website. --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 90243b6..9ec4f31 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # mutt-wizard +https://muttwizard.com/ + Get this great stuff without effort: - A full-featured and autoconfigured email client on the terminal with neomutt @@ -176,10 +178,9 @@ To give you an example of the interface, here's an idea: errors. - Open a PR to add new server information into `domains.csv` so their users can more easily use mutt-wizard. -- If nothing else, [Donate!](https://paypal.me/LukeMSmith) - -See Luke's website [here](https://lukesmith.xyz). Email him at -[luke@lukesmith.xyz](mailto:luke@lukesmith.xyz). +- If nothing else, donate: + - XMR: `8AzeWXhJvYJ1VeENHcNXCR1dLMgDALreZ1BdooZVjRKndv6myr3t1ue6C4ML2an5fWSpcP1sTDA9nKUMevkukDXG6chRjNv` + - BTC: `bc1qacqfp36ffv9mafechmvk8f6r8qy4tual6rcm9p` ## Details for Tinkerers From 315069b5a27a7965dfa9efb5778ddaa6421e02eb Mon Sep 17 00:00:00 2001 From: Lokesh Mohanty Date: Sat, 2 Jul 2022 21:46:54 +0530 Subject: [PATCH 14/20] pass: add feature to optionally add a prefix --- bin/mw | 29 ++++++++++++++++------------- mw.1 | 2 ++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/bin/mw b/bin/mw index c71d662..cd5235c 100755 --- a/bin/mw +++ b/bin/mw @@ -43,7 +43,7 @@ host $smtp port ${sport:-465} from $fulladdr user $login -passwordeval \"pass $fulladdr\" +passwordeval \"pass $passprefix$fulladdr\" auth ${auth:-on} tls on tls_trust_file $sslcert @@ -58,7 +58,7 @@ IMAPStore $fulladdr-remote Host $imap Port ${iport:-993} User $login -PassCmd \"pass $fulladdr\" +PassCmd \"pass $passprefix$fulladdr\" AuthMechs LOGIN SSLType ${imapssl:-IMAPS} CertificateFile $sslcert @@ -87,7 +87,7 @@ tls on user $login host $imap delivery maildir ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$fulladdr/${inbox:-INBOX} -passwordeval pass $fulladdr +passwordeval pass $passprefix$fulladdr " >> "$mpoprc" ;} prepmutt() { echo "# vim: filetype=neomuttrc @@ -128,7 +128,7 @@ getprofiles() { \ case "$type" in online) folder="imaps://$login@$imap:${iport:-993}" extra="set imap_user = \"$login\" -set imap_pass = \"\`pass $fulladdr\`\" +set imap_pass = \"\`pass $passprefix$fulladdr\`\" set ssl_starttls = yes set ssl_force_tls = yes" ;; @@ -176,7 +176,7 @@ delete() { if [ -z "${fulladdr+x}" ]; then sed -ibu "/\([0-9]-\)\?$fulladdr.muttrc/d" "$muttrc" 2>/dev/null; rm -f "$muttrc"bu sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$msmtprc" 2>/dev/null; rm -f "$msmtprc"bu sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 2>/dev/null; rm -f "$mpoprc"bu - pass rm -f "$fulladdr" >/dev/null 2>&1 + pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1 [ -n "${purge+x}" ] && rm -rf "${maildir:?}/${fulladdr:?}" for file in "$msmtprc" "$mbsyncrc" "$mpoprc"; do @@ -200,6 +200,7 @@ askinfo() { \ read -r smtp [ "$sport" = 587 ] && tlsline="# tls_starttls" [ -z "$realname" ] && realname="${fulladdr%%@*}" + [ -z "$passprefix" ] && passprefix="" hostname="${fulladdr#*@}" login="${login:-$fulladdr}" if [ -n "${password+x}" ]; then @@ -209,17 +210,17 @@ askinfo() { \ fi } -createpass() { echo "$password" > "$PASSWORD_STORE_DIR/$fulladdr" - "$GPG" -qe $(printf -- " -r %s" $(cat "$PASSWORD_STORE_DIR/.gpg-id")) "$PASSWORD_STORE_DIR/$fulladdr" - rm -f "$PASSWORD_STORE_DIR/$fulladdr" ;} +createpass() { echo "$password" > "$PASSWORD_STORE_DIR/$passprefix$fulladdr" + "$GPG" -qe $(printf -- " -r %s" $(cat "$PASSWORD_STORE_DIR/.gpg-id")) "$PASSWORD_STORE_DIR/$passprefix$fulladdr" + rm -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr" ;} -getpass() { while : ; do pass rm -f "$fulladdr" >/dev/null 2>&1 - pass insert -f "$fulladdr" && break; done ;} +getpass() { while : ; do pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1 + pass insert -f "$passprefix$fulladdr" && break; done ;} getboxes() { if [ -n "${force+x}" ] ; then mailboxes="$(printf "INBOX\\nDrafts\\nJunk\\nTrash\\nSent\\nArchive")" else - info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")" + info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")" [ -z "$info" ] && echo "Log-on not successful." && return 1 mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')" fi @@ -297,6 +298,7 @@ Options allowed with -a: -s SMTP server address -S SMTP server port -x Password for account (recommended to be in double quotes) + -P Pass Prefix (prefix of the file where password is stored) -p Add for a POP server instead of IMAP. -X Delete an account's local email too when deleting. -o Configure address, but keep mail online. @@ -305,7 +307,7 @@ Options allowed with -a: NOTE: Once at least one account is added, you can run \`mbsync -a\` to begin downloading mail. -To change an account's password, run \`pass edit your@email.com\`. +To change an account's password, run \`pass edit '$passprefix'your@email.com\`. EOF } @@ -332,7 +334,7 @@ reorder() { ' "$tempfile" >> "$muttrc" } -while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in +while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:P:x:m:t:" o; do case "${o}" in l) setact list || exit 1 ;; r) setact reorder || exit 1 ;; d) setact delete || exit 1 ;; @@ -346,6 +348,7 @@ while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:x:m:t:" o; do case "${o}" in S) setact add || exit 1 ; sport="$OPTARG" ;; u) setact add || exit 1 ; login="$OPTARG" ;; n) setact add || exit 1 ; realname="$OPTARG" ;; + P) setact add || exit 1 ; passprefix="$OPTARG" ;; m) setact add || exit 1 ; maxmes="$OPTARG" ;; o) setact add || exit 1 ; type="online" ;; p) setact add || exit 1 ; type="pop"; protocol="pop3s" ; iport="${iport:-995}" ;; diff --git a/mw.1 b/mw.1 index c3cbd07..e4755ba 100644 --- a/mw.1 +++ b/mw.1 @@ -70,6 +70,8 @@ SMTP server port (assumed to be 465 if not specified) .TP .B -x Account password. You will be prompted for the password interactively if this option is not given. +.B -P +Pass Prefix. The password will be stored using pass at .SH OTHER OPTIONS .TP .B -f From 0b9135142a22dfc696628d620407e913cc58f778 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 4 Jul 2022 23:59:24 -0400 Subject: [PATCH 15/20] move msmtp cache and reorder prep --- bin/mw | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/mw b/bin/mw index c71d662..739d2bb 100755 --- a/bin/mw +++ b/bin/mw @@ -7,14 +7,13 @@ cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" muttrc="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc" accdir="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/accounts" msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config" -msmtplog="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/msmtp.log" +msmtplog="${XDG_CACHE_HOME:-$HOME/.cache}/msmtp/msmtp.log" mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}" mpoprc="${XDG_CONFIG_HOME:-$HOME/.config}/mpop/config" alias mbsync='mbsync -c "$mbsyncrc"' # On Ubuntu/Debian, a link is needed since they use an older version. if command -V apt-get >/dev/null 2>&1; then - ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null master="Master" slave="Slave" fi @@ -38,7 +37,9 @@ getaccounts() { accounts="$(find -L "$accdir" -type f 2>/dev/null | grep -o "\S* list() { getaccounts && [ -n "$accounts" ] && echo "$accounts" || exit 1 ;} -prepmsmtp() { echo "account $fulladdr +prepmsmtp() { mkdir -p "${msmtprc%/*}" "${msmtplog%/*}" + ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null + echo "account $fulladdr host $smtp port ${sport:-465} from $fulladdr @@ -90,7 +91,8 @@ delivery maildir ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$fulladdr/${inbox:-IN passwordeval pass $fulladdr " >> "$mpoprc" ;} -prepmutt() { echo "# vim: filetype=neomuttrc +prepmutt() { mkdir -p "${muttrc%/*}" "${accdir%/*}" + echo "# vim: filetype=neomuttrc # muttrc file for account $fulladdr set realname = \"$realname\" set from = \"$fulladdr\" @@ -119,8 +121,6 @@ macro index \eh \"$prefix/libexec/gpg-wks-client --receive | msmtp } getprofiles() { \ - mkdir -p "${muttrc%/*}" "$accdir" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" - unset msmtp_header msmtp_profile mutt_profile mbsync_profile case "$iport" in 1143) imapssl=None ;; 143) imapssl=STARTTLS ;; From 36c87c512ed0e5b2fd3e67b79711eaab555de5e3 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 5 Jul 2022 17:37:36 -0400 Subject: [PATCH 16/20] removed introduced bug, fix #861 --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index f444cb7..52c46cc 100755 --- a/bin/mw +++ b/bin/mw @@ -91,7 +91,7 @@ delivery maildir ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$fulladdr/${inbox:-IN passwordeval pass $passprefix$fulladdr " >> "$mpoprc" ;} -prepmutt() { mkdir -p "${muttrc%/*}" "${accdir%/*}" +prepmutt() { mkdir -p "${muttrc%/*}" "$accdir" echo "# vim: filetype=neomuttrc # muttrc file for account $fulladdr set realname = \"$realname\" From 3844aa140428d2e278b3848ad4785a90bf104f33 Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Fri, 8 Jul 2022 02:51:11 -0500 Subject: [PATCH 17/20] put keyboard shortcuts in tag --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 9ec4f31..7904bb5 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ A user of Arch-based distros can also install the current mutt-wizard release fr - `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. + 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. - `urlview` - outputs urls in mail to browser. @@ -110,25 +110,25 @@ The mutt-wizard runs via the command `mw`. Once setup is complete, you'll use To give you an example of the interface, here's an idea: -- `m` - send mail (uses your default `$EDITOR` to write) -- `j`/`k` and `d`/`u` - vim-like bindings to go down and up (or `d`/`u` to go +- m - send mail (uses your default `$EDITOR` to write) +- j/k and d/u - vim-like bindings to go down and up (or d/u to go down/up a page). -- `l` - open mail, or attachment page or attachment -- `h` - the opposite of `l` -- `r`/`R` - reply/reply all to highlighted mail -- `s` - save selected mail or selected attachment -- `gs`,`gi`,`ga`,`gd`,`gS` - Press `g` followed by another letter to change - mailbox: `s`ent, `i`nbox, `a`rchive, `d`rafts, `S`pam, etc. -- `M` and `C` - For `M`ove and `C`opy: follow them with one of the mailbox - letters above, i.e. `MS` means "move to Spam". -- `i#` - Press `i` followed by a number 1-9 to go to a different account. If you +- l - open mail, or attachment page or attachment +- h - the opposite of l +- r/R - reply/reply all to highlighted mail +- s - save selected mail or selected attachment +- gs,gi,ga,gd,gS - Press g followed by another letter to change + mailbox: sent, inbox, archive, drafts, Spam, etc. +- M and C - For Move and Copy: follow them with one of the mailbox + letters above, i.e. MS means "move to Spam". +- i# - Press i followed by a number 1-9 to go to a different account. If you add 9 accounts via mutt-wizard, they will each be assigned a number. -- `a` to add address/person to abook and `Tab` while typing address to complete +- a to add address/person to abook and Tab while typing address to complete one from abook. -- `?` - see all keyboard shortcuts -- `ctrl-j`/`ctrl-k` - move up and down in sidebar, `ctrl-o` opens mailbox. -- `ctrl-b` - open a menu to select a URL you want to open in your browser. -- `p` - encrypt/sign your message (in compose view, before sending the email). +- ? - see all keyboard shortcuts +- ctrl-j/ctrl-k - move up and down in sidebar, ctrl-o opens mailbox. +- ctrl-b - open a menu to select a URL you want to open in your browser. +- p - encrypt/sign your message (in compose view, before sending the email). ## Additional functionality @@ -139,7 +139,7 @@ To give you an example of the interface, here's an idea: - `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. + 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. - `urlview` - Outputs URLs in an email to your browser. From e35a9686c9ca60fab62464b376ca295e2adfcaca Mon Sep 17 00:00:00 2001 From: Beau McCartney Date: Fri, 8 Jul 2022 11:41:17 -0600 Subject: [PATCH 18/20] Update domains.csv --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 77a20af..08a3a95 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -33,6 +33,7 @@ autograf.pl,imap.poczta.onet.pl,993,smtp.poczta.onet.pl,465 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 +beaumccartney.xyz,mail.beaumccartney.xyz,993,mail.beaumccartney.xyz,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 From 0fed845bfdfde433810e03449a194c9e0c70a2b0 Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Thu, 15 Sep 2022 16:39:55 -0400 Subject: [PATCH 19/20] add umbc.edu domain --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 08a3a95..0ac67cb 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -294,6 +294,7 @@ uclive.ac.nz,outlook.office365.com,993,smtp.office365.com,587 ucsb.edu,imap.gmail.com,993,smtp.gmail.com,587 ucsc.edu,imap.gmail.com,993,smtp.gmail.com,587 ukr.net,imap.ukr.net,993,smtp.ukr.net,465 +umbc.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 uni.edu.pe,imap.gmail.com,993,smtp.gmail.com,587 From f723938a73d3096b6e174437c61924f21978630b Mon Sep 17 00:00:00 2001 From: Parin Jasoliya Date: Thu, 29 Sep 2022 22:32:43 +0530 Subject: [PATCH 20/20] Add Support for POP3 Notification --- bin/mailsync | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 854e1d1..1dc3d47 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -19,7 +19,7 @@ pgrep mbsync >/dev/null && { echo "mbsync is already running."; exit ;} # files for variable assignments. This is ugly, but there are few options that # will work on the maximum number of machines. eval "$(grep -h -- \ - "^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\)=" \ + "^\s*\(export \)\?\(MBSYNCRC\|MPOPRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\)=" \ "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \ "$HOME/.config/zsh/.zshenv" "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" \ "$HOME/.pam_environment" 2>/dev/null)" @@ -27,6 +27,7 @@ eval "$(grep -h -- \ export GPG_TTY="$(tty)" [ -n "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" || MBSYNCRC="$HOME/.mbsyncrc" +[ -n "$MPOPRC" ] || MPOPRC="$HOME/.config/mpop/config" lastrun="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" @@ -52,7 +53,13 @@ esac # 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 + if [ "$1" = "pop" ]; then + # Handle POP + mpop "$acc" + else + # Handle IMAP + if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi + fi new=$(find\ "$HOME/.local/share/mail/$acc/"[Ii][Nn][Bb][Oo][Xx]/new/\ "$HOME/.local/share/mail/$acc/"[Ii][Nn][Bb][Oo][Xx]/cur/\ @@ -70,11 +77,17 @@ if [ "$#" -gt "0" ]; then done accounts=$* fi +# TODO handle account passed from argument [ -z "$accounts" ] && accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")" +[ -z "$pop_accounts" ] && pop_accounts="$(awk '/^account/ {print $2}' "$MPOPRC")" # Parallelize multiple accounts for account in $accounts; do - syncandnotify & + syncandnotify "imap" & +done + +for account in $pop_accounts; do + syncandnotify "pop" & done wait