summaryrefslogtreecommitdiff
path: root/checkmail
blob: c742351e5b8231483d2f188df8062bc6c903276b (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
    notmuch new    # download new mails (also runs 'mbsync --all')
    eml -n         # display new email count
else
    echo "Could not reach mail server."
    exit 1
fi