summaryrefslogtreecommitdiff
path: root/checkmail
diff options
context:
space:
mode:
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