#!/usr/bin/env bash

export DISPLAY=:0

echo "$(date +%Y.%m.%d..%H.%M) $(basename $0)" >> /var/log/ben.cron.log

# Check that we can reach the mail server first
if ping -q -c 1 -W 1 mail.bsima.me >/dev/null
then
    notmuch new
else
    echo "Could not reach mail server."
    exit 1
fi