From c37a748227a7c81519ae73cdbb69f3a3368833f8 Mon Sep 17 00:00:00 2001 From: Robert White Date: Tue, 23 Jul 2019 08:24:58 +1000 Subject: Surround value of imap_pass with quotes (#260) If the password contains single quotes and is not surrounded by quotes, Mutt removes the single quotes, rendering an incorrect password. --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/mw b/bin/mw index 651dd90..8ba5d39 100755 --- a/bin/mw +++ b/bin/mw @@ -107,7 +107,7 @@ set folder = \"imaps://$fulladdr@$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 mutt-wizard-$title\`\" set mbox_type = Maildir set ssl_starttls = yes -- cgit v1.2.3 From c270bdb5df7593128e707348baee4697bbe20ee2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 24 Jul 2019 15:27:22 -0400 Subject: vars in script; msg if fail --- bin/mailsync | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/mailsync b/bin/mailsync index 202d9be..d79507d 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -1,17 +1,20 @@ #!/usr/bin/env sh # Sync mail and give notification if there is new mail. +export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +export DISPLAY=:0.0 +[ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" + # Run only if user logged in (prevent cron errors) -pgrep -u "$USER" >/dev/null || exit +pgrep -u "$USER" >/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 && exit +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 || exit +ping -q -c 1 1.1.1.1 > /dev/null || { 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." -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 ;} -- cgit v1.2.3 From 48f61faef7bb7eecc525e410f9ba699652f9ad4d Mon Sep 17 00:00:00 2001 From: WhaleJ84 <43613409+WhaleJ84@users.noreply.github.com> Date: Tue, 6 Aug 2019 13:07:18 +0100 Subject: Modified code to work better with Protonmail (#267) Added new search location for certificates and modified command that caused errors for Protonmail users. --- bin/mw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/mw b/bin/mw index 8ba5d39..2499318 100755 --- a/bin/mw +++ b/bin/mw @@ -26,7 +26,7 @@ muttrc="$muttdir/muttrc" msmtprc="$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" +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 [ -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 ;} @@ -194,7 +194,7 @@ EOF } protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" - fingerprint="$(msmtp --serverinfo --tls --tls-certcheck=off -a "$title")" || return 1 + fingerprint="$(msmtp --serverinfo --host=127.0.0.1 --port=1025 --tls --tls-certcheck=off)" || return 1 sed -ibu "s/account $title/&\ntls_trust_file\ntls_fingerprint $fingerprint/" "$msmtprc" ; rm -f "$msmtprc"bu } -- cgit v1.2.3 From 856eea6d71a0a32cb9bea4ab704dc41f7619c18f Mon Sep 17 00:00:00 2001 From: mkomo Date: Mon, 12 Aug 2019 21:13:06 +0300 Subject: fix cronjob removed on purge (#269) --- bin/mw | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/mw b/bin/mw index 2499318..8712bf0 100755 --- a/bin/mw +++ b/bin/mw @@ -293,6 +293,7 @@ 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 } -- cgit v1.2.3