summaryrefslogtreecommitdiff
path: root/checkmail
blob: 979942b95424df7e40ccde63c1dd91d5a3a70f51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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
    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