From 19339609742837c14d25ca280352df569585a26b Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 6 Jul 2018 17:01:29 -0700 Subject: Add msmtp-queue and connectivity check --- checkmail | 13 +++++++++++-- 1 file 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 -- cgit v1.2.3