From ca64a6ae56a31ead28cc638d8d8dac7e28f9df68 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Thu, 7 Nov 2019 11:08:27 -0600 Subject: [PATCH 1/9] line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line --- bin/mailsync | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index d79507d..4677d3b 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -2,7 +2,8 @@ # 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 +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +export DBUS_SESSION_BUS_ADDRESS export DISPLAY=:0.0 [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" From 50290119526d54dfe0e8888a48d1d05d173dec37 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Thu, 7 Nov 2019 12:37:21 -0600 Subject: [PATCH 2/9] change the pgrep line --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index 4677d3b..c56ccb2 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -8,7 +8,7 @@ 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 || { echo "$USER not logged in; sync will not run."; exit ;} +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 ;} From af0c0826b9a699780256dc8492e74a157cab2a85 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Thu, 7 Nov 2019 12:55:01 -0600 Subject: [PATCH 3/9] Revert "Update domains.csv (#321)" This reverts commit a92c01e13121f42b9f9b8962ae2c07b0a0ce5d4d. --- share/domains.csv | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/share/domains.csv b/share/domains.csv index 970a321..850c4ee 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -60,7 +60,7 @@ counsellor.com,imap.mail.com,993,smtp.mail.com,587 cryptolab.net,mail.autistici.org,993,smtp.autistici.org,465 cumallover.me,mail.cock.li,993,mail.cock.li,587 cyberservices.com,imap.mail.com,993,smtp.mail.com,587 -datentopf.org,imap.migadu.com,993,smtp.migadu.com,587 +datentopf.org,mail.datentopf.org,993,mail.datentopf.org,587 deliveryman.com,imap.mail.com,993,smtp.mail.com,587 dicksinhisan.us,mail.cock.li,993,mail.cock.li,587 dicksinmyan.us,mail.cock.li,993,mail.cock.li,587 @@ -143,7 +143,6 @@ 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 -humbug.pw,imap.migadu.com,993,smtp.migadu.com,587 hushmail.com,imap.hushmail.com,993,smtp.hushmail.com,465 illinois.edu, imap.gmail.com,993,smtp.gmail.com,465 iname.com,imap.mail.com,993,smtp.mail.com,587 @@ -214,7 +213,6 @@ protonmail.ch,127.0.0.1,1143,127.0.0.1,1025 protonmail.com,127.0.0.1,1143,127.0.0.1,1025 rape.lol,mail.cock.li,993,mail.cock.li,587 redchan.it,mail.cock.li,993,mail.cock.li,587 -resch.pw,imap.migadu.com,993,smtp.migadu.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 From 4792b1000d38e1f56b2ee8f55bc0c15d8acb117b Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Thu, 7 Nov 2019 12:58:45 -0600 Subject: [PATCH 4/9] Revert "Revert "Update domains.csv (#321)"" This reverts commit af0c0826b9a699780256dc8492e74a157cab2a85. --- share/domains.csv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/domains.csv b/share/domains.csv index 850c4ee..970a321 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -60,7 +60,7 @@ counsellor.com,imap.mail.com,993,smtp.mail.com,587 cryptolab.net,mail.autistici.org,993,smtp.autistici.org,465 cumallover.me,mail.cock.li,993,mail.cock.li,587 cyberservices.com,imap.mail.com,993,smtp.mail.com,587 -datentopf.org,mail.datentopf.org,993,mail.datentopf.org,587 +datentopf.org,imap.migadu.com,993,smtp.migadu.com,587 deliveryman.com,imap.mail.com,993,smtp.mail.com,587 dicksinhisan.us,mail.cock.li,993,mail.cock.li,587 dicksinmyan.us,mail.cock.li,993,mail.cock.li,587 @@ -143,6 +143,7 @@ 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 +humbug.pw,imap.migadu.com,993,smtp.migadu.com,587 hushmail.com,imap.hushmail.com,993,smtp.hushmail.com,465 illinois.edu, imap.gmail.com,993,smtp.gmail.com,465 iname.com,imap.mail.com,993,smtp.mail.com,587 @@ -213,6 +214,7 @@ protonmail.ch,127.0.0.1,1143,127.0.0.1,1025 protonmail.com,127.0.0.1,1143,127.0.0.1,1025 rape.lol,mail.cock.li,993,mail.cock.li,587 redchan.it,mail.cock.li,993,mail.cock.li,587 +resch.pw,imap.migadu.com,993,smtp.migadu.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 From 4304eb731c109289251e06ef86377d372cef07e4 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Thu, 7 Nov 2019 12:59:05 -0600 Subject: [PATCH 5/9] Revert "line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line" This reverts commit ca64a6ae56a31ead28cc638d8d8dac7e28f9df68. --- bin/mailsync | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 4677d3b..d79507d 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -2,8 +2,7 @@ # 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 -DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus -export DBUS_SESSION_BUS_ADDRESS +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" From eeb49b7247a250fddc0ca4557c176dce7fb536e2 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Thu, 7 Nov 2019 13:01:58 -0600 Subject: [PATCH 6/9] Revert "Revert "line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line"" This reverts commit 4304eb731c109289251e06ef86377d372cef07e4. --- bin/mailsync | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/mailsync b/bin/mailsync index d79507d..4677d3b 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -2,7 +2,8 @@ # 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 +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +export DBUS_SESSION_BUS_ADDRESS export DISPLAY=:0.0 [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" From b7f2bc0ff14f7da6cf2d7c4186bed0dfe925510f Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Wed, 17 Aug 2022 19:49:28 -0500 Subject: [PATCH 7/9] check for MAILSYNC_MUTE --- bin/mailsync | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 854e1d1..818158d 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\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME|MAILSYNC_MUTE\)=" \ "$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)" @@ -30,8 +30,13 @@ export GPG_TTY="$(tty)" lastrun="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" +# Mute notifications or get kernel name. # Settings are different for MacOS (Darwin) systems. -case "$(uname)" in +[ -z "$MAILSYNC_MUTE" ] && notify="$(uname)" || notify="no" +case "$notify" in + no) + notify() { echo "notifications disabled" >/dev/null ;} + ;; Darwin) notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} ;; From d2a5d06d4308e10c04e74446e56999badc2fdf38 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Thu, 18 Aug 2022 20:46:00 -0500 Subject: [PATCH 8/9] forgot escape on | to get variable; case condition s/no/mute/ --- bin/mailsync | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 818158d..d33ec23 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|MAILSYNC_MUTE\)=" \ + "^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\|MAILSYNC_MUTE\)=" \ "$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)" @@ -32,9 +32,9 @@ lastrun="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" # Mute notifications or get kernel name. # Settings are different for MacOS (Darwin) systems. -[ -z "$MAILSYNC_MUTE" ] && notify="$(uname)" || notify="no" +[ -z "$MAILSYNC_MUTE" ] && notify="$(uname)" || notify="mute" case "$notify" in - no) + mute) notify() { echo "notifications disabled" >/dev/null ;} ;; Darwin) From 1946ff8aa1dcfcec84d61389584476af7588fa12 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Thu, 18 Aug 2022 22:50:41 -0500 Subject: [PATCH 9/9] readme updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7904bb5..cb5a5d9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Get this great stuff without effort: the internet * make backups - Provides a `mailsync` script that can be scheduled to run as often as you - like, which downloads/syncs mail and notifies you when new mail has arrived. + like, which downloads/syncs mail and optionally notifies you when new mail has arrived. Specifically, this wizard: