From 8c71c10b0a8066cf0dc6bc5e0c5583eaddbb5441 Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 25 May 2021 16:05:16 -0400 Subject: [PATCH 01/14] password store with multiple private keys fix --- bin/mw | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/mw b/bin/mw index 54af276..92e539c 100755 --- a/bin/mw +++ b/bin/mw @@ -18,8 +18,7 @@ done || { echo "CA Certificate not found. Please install one or link it to /etc/ checkbasics() { command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" PASSWORD_STORE_DIR="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] && - "$GPG" --list-secret-keys "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" >/dev/null 2>&1 || { + [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] || { echo "First run \`pass init \` to set up a password archive." echo "(If you don't already have a GPG key pair, first run \`$GPG --full-generate-key\`.)" exit 1 ;} ;} @@ -204,7 +203,7 @@ askinfo() { \ } createpass() { echo "$password" > "$PASSWORD_STORE_DIR/$fulladdr" - "$GPG" -qer "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" "$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" ;} getpass() { while : ; do pass rm -f "$fulladdr" >/dev/null 2>&1 From 8dd99232806ad038bb060e71354d1a861d74f3b0 Mon Sep 17 00:00:00 2001 From: Sean Brar <69971174+seanbrar@users.noreply.github.com> Date: Fri, 9 Jul 2021 04:49:41 -0700 Subject: [PATCH 02/14] Add calstatela.edu to domains.csv --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index c72e713..f0d8399 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -43,6 +43,7 @@ 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 +calstatela.edu,outlook.office365.com,993,smtp.office365.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 b8736f6a8582ae6d2f1467f6bec19dab3e929573 Mon Sep 17 00:00:00 2001 From: 3nt3 Date: Wed, 4 Aug 2021 23:29:00 +0200 Subject: [PATCH 03/14] update domains.csv to add 3nt3.de --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index c72e713..e8cce57 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -317,3 +317,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 +3nt3.de,mail.3nt3.de,993,mail.3nt3.de,465 From 8e5bb8bd095aaf9cb42997c243c4d4dc47f588a9 Mon Sep 17 00:00:00 2001 From: ananthu Date: Sat, 7 Aug 2021 14:14:15 +0530 Subject: [PATCH 04/14] bug; argument getting splitted by space --- bin/mw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/mw b/bin/mw index 0fd01d8..2e38cde 100755 --- a/bin/mw +++ b/bin/mw @@ -228,6 +228,7 @@ getboxes() { if [ -n "${force+x}" ] ; then [ "$type" = "pop" ] && mailboxes="INBOX" getaccounts; for x in $(seq 1 9); do echo "$accounts" | grep -q "^$x:" || { export idnum="$x"; break ;}; done toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' - )" + IFS=$'\n' for x in $mailboxes; do case "$x" in *[Ss][Ee][Nn][Tt]*) setBox record "$x"; formatShortcut s sent "$x" ;; @@ -239,6 +240,7 @@ getboxes() { if [ -n "${force+x}" ] ; then *[Ii][Nn][Bb][Oo][Xx]) formatShortcut i inbox "$x"; setBox spoolfile "$x" inbox="$x" ;; esac done + unset IFS } finalize() { echo "$toappend" >> "$accdir/$idnum-$fulladdr.muttrc" From 852cacce7a77630bc4b8c8a2ef0ce6b3f5de44a0 Mon Sep 17 00:00:00 2001 From: ananthu Date: Sat, 7 Aug 2021 14:14:51 +0530 Subject: [PATCH 05/14] enhancement; added college domain --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index e8cce57..a7135bd 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -157,6 +157,7 @@ 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 mac.com,imap.mail.me.com,993,smtp.mail.me.com,587 +mace.ac.in,imap.gmail.com,993,smtp.gmail.com,465 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 99c0466a3495a6b064b84ed47f15919f10650ee2 Mon Sep 17 00:00:00 2001 From: Ananthu Date: Sat, 7 Aug 2021 14:40:28 +0530 Subject: [PATCH 06/14] enhancement; college domain smtp port change --- share/domains.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index a7135bd..618ee09 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -157,7 +157,7 @@ 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 mac.com,imap.mail.me.com,993,smtp.mail.me.com,587 -mace.ac.in,imap.gmail.com,993,smtp.gmail.com,465 +mace.ac.in,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 8239a7d5ca6807d395f787c8c940a08301eb61d7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 9 Aug 2021 20:52:19 -0400 Subject: [PATCH 07/14] remove bashism, fix #752 --- bin/mw | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/mw b/bin/mw index 2e38cde..41977b1 100755 --- a/bin/mw +++ b/bin/mw @@ -182,7 +182,7 @@ askinfo() { \ [ -z "$fulladdr" ] && echo "Give the full email address to add:" && read -r fulladdr while ! echo "$fulladdr" | grep -qE "^.+@.+\.[A-Za-z]+$"; do - echo "\`$fulladdr\` is not a valid email address. Please retype the address:" + echo "$fulladdr is not a valid email address. Please retype the address:" read -r fulladdr done getaccounts; echo "$accounts" | grep -q "\s$fulladdr$" 2>/dev/null && @@ -228,7 +228,8 @@ getboxes() { if [ -n "${force+x}" ] ; then [ "$type" = "pop" ] && mailboxes="INBOX" getaccounts; for x in $(seq 1 9); do echo "$accounts" | grep -q "^$x:" || { export idnum="$x"; break ;}; done toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' - )" - IFS=$'\n' + IFS=' +' for x in $mailboxes; do case "$x" in *[Ss][Ee][Nn][Tt]*) setBox record "$x"; formatShortcut s sent "$x" ;; From d2942f2d22f4090fa3abc8d1f8eb2377fac0a7ba Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 13 Aug 2021 14:19:05 -0400 Subject: [PATCH 08/14] sort --- share/domains.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/domains.csv b/share/domains.csv index 618ee09..6b23434 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -1,6 +1,7 @@ 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 +3nt3.de,mail.3nt3.de,993,mail.3nt3.de,465 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 @@ -205,8 +206,8 @@ outlook.*,imap-mail.outlook.com,993,smtp-mail.outlook.com,587 outlook.es,outlook.office365.com,993,smtp.office365.com,587 parabolas.xyz,mail.parabolas.xyz,993,mail.parabolas.xyz,587 paranoici.org,mail.autistici.org,993,smtp.autistici.org,465 -paranoid.network,imap.nixnet.email,143,smtp.nixnet.email,587 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 @@ -280,9 +281,9 @@ uach.mx,imap.gmail.com,993,smtp.gmail.com,587 ucdavis.edu,imap.gmail.com,993,smtp.gmail.com,587 ucsb.edu,imap.gmail.com,993,smtp.gmail.com,587 ucsc.edu,imap.gmail.com,993,smtp.gmail.com,587 -uni.strath.ac.uk,outlook.office365.com,993,smtp.office365.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.strath.ac.uk,outlook.office365.com,993,smtp.office365.com,587 unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 unitn.it,imap.gmail.com,993,smtp.gmail.com,587 unitybox.de,mail.unity-mail.de,993,mail.unity-mail.de,587 @@ -318,4 +319,3 @@ 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 -3nt3.de,mail.3nt3.de,993,mail.3nt3.de,465 From fb68f19846141df5ff5c6b8c4f15f589b0f5000f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 14 Aug 2021 18:50:33 -0400 Subject: [PATCH 09/14] use soyterms if not slower distro --- bin/mw | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/bin/mw b/bin/mw index 41977b1..87ec79c 100755 --- a/bin/mw +++ b/bin/mw @@ -12,7 +12,18 @@ mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}" mpoprc="${XDG_CONFIG_HOME:-$HOME/.config}/mpop/config" 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 +# 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 + +for x in "/etc/ssl/certs/ca-certificates.crt" \ + "/etc/pki/tls/certs/ca-bundle.crt" "/etc/ssl/cert.pem" \ + "/etc/ssl/ca-bundle.pem" "/etc/pki/tls/cacert.pem" \ + "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" \ + "/usr/local/share/ca-certificates/"; 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 ;} @@ -39,8 +50,6 @@ ${tlsline:-tls on} tls_trust_file $sslcert logfile $msmtplog " >> "$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 } prepmbsync() { mkdir -p "${mbsyncrc%/*}" @@ -61,8 +70,8 @@ Inbox ${XDG_DATA_HOME:-$HOME/.local/share}/mail/$fulladdr/${inbox:-INBOX} Channel $fulladdr Expunge Both -Master :$fulladdr-remote: -Slave :$fulladdr-local: +${master:-Far} :$fulladdr-remote: +${slave:-Near} :$fulladdr-local: Patterns * !\"[Gmail]/All Mail\" Create Both SyncState * From 3ef2b112459ce7101a6ee881cb478ff68647871e Mon Sep 17 00:00:00 2001 From: Hudson Finn Date: Mon, 16 Aug 2021 19:54:23 -0400 Subject: [PATCH 10/14] Update domains.csv --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index 6b23434..0cb7026 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -1,4 +1,5 @@ ADDRESS,IMAP,imap port,SMTP,smtp port +gordon.edu,outlook.office365.com,993,smtp.office365.com,587 126.com,imap.126.com,993,smtp.126.com,587 163.com,imap.163.com,993,smtp.163.com,587 3nt3.de,mail.3nt3.de,993,mail.3nt3.de,465 From bd8551163ead2720fd3d3579f64f8816521be11c Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 27 Aug 2021 19:05:55 -0400 Subject: [PATCH 11/14] fix for 465 starttls --- bin/mw | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 87ec79c..fbf2884 100755 --- a/bin/mw +++ b/bin/mw @@ -46,9 +46,10 @@ from $fulladdr user $login passwordeval \"pass $fulladdr\" auth ${auth:-on} -${tlsline:-tls on} +tls on tls_trust_file $sslcert logfile $msmtplog +$tlsline " >> "$msmtprc" } From 20e08b07fd2df0afc066df9d3d252ac94374e824 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 27 Aug 2021 19:06:29 -0400 Subject: [PATCH 12/14] sort --- share/domains.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index 292e05c..2ec18f1 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -1,5 +1,4 @@ ADDRESS,IMAP,imap port,SMTP,smtp port -gordon.edu,outlook.office365.com,993,smtp.office365.com,587 126.com,imap.126.com,993,smtp.126.com,587 163.com,imap.163.com,993,smtp.163.com,587 3nt3.de,mail.3nt3.de,993,mail.3nt3.de,465 @@ -114,6 +113,7 @@ 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 +gordon.edu,outlook.office365.com,993,smtp.office365.com,587 grrlz.net,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 From 2be8ea7871e6d07592d7b4ed85ace213774261f6 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 29 Aug 2021 14:36:26 -0400 Subject: [PATCH 13/14] not necessary to create cachedir manually --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 823730e..e63fff2 100755 --- a/bin/mw +++ b/bin/mw @@ -121,7 +121,7 @@ $synccmd } getprofiles() { \ - mkdir -p "${muttrc%/*}" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" + 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 ;; From 5971fadec832e6b970e7911e1919432c6052fdc7 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Thu, 9 Sep 2021 19:04:18 -0400 Subject: [PATCH 14/14] Check both new and cur dirs for notification Also better formattin --- bin/mailsync | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index f00baf1..a633308 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -57,7 +57,14 @@ esac 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 "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) + 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/"\ + -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) case 1 in $((newcount > 5)) ) notify "$acc" "$newcount" ;;