summaryrefslogtreecommitdiff
path: root/checkmail
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2018-07-06 17:01:29 -0700
committerBen Sima <ben@bsima.me>2018-07-06 17:01:29 -0700
commit19339609742837c14d25ca280352df569585a26b (patch)
tree282291f09cb6bfa0716262acb117b404e0d4ad9f /checkmail
parent6c2295394ece45edd5b3012a98f8aed62c66d7a5 (diff)
Add msmtp-queue and connectivity check
Diffstat (limited to 'checkmail')
-rwxr-xr-xcheckmail13
1 files changed, 11 insertions, 2 deletions
diff --git a/checkmail b/checkmail
index 9ab4377..979942b 100755
--- a/checkmail
+++ b/checkmail
@@ -3,5 +3,14 @@
export DISPLAY=:0
echo "$(date +%Y.%m.%d..%H.%M) $(basename $0)" >> /var/log/ben.cron.log
-/usr/bin/offlineimap
-/home/ben/me/bin/eml -n
+
+# Check that we can reach the mail server first
+if ping -q -c 1 -W 1 mail.bsima.me >/dev/null
+then
+ msmtp-queue -r # outbox: send an queued mails
+ offlineimap # download new mails
+ eml -n # display new email count
+else
+ echo "Could not reach mail server."
+ exit 1
+fi