Blog IndexPosts by TagHome

Speaking email notifications

Posted <2017-03-23 Thu 15:39> by Aaron S. Jackson.

Just a bit of fun:

#!/bin/bash

base=~/Maildir/nottingham/INBOX/new
inotifywait -m $base -e create -e moved_to |
    while read path action file; do
    from=$(grep ^From: "$base/$file" \
         | head -n1 \
         | cut -d':' -f2 \
         | cut -d'<' -f1)
    echo "You have an email from $from" | espeak
    done

Related posts:

Tags: linux

Blog IndexPosts by TagHome

You can verify this page with the following command:
gpg --verify <(curl -s http://aaronsplace.co.uk/blog/2017-03-23-speaking-email-notifications.asc) <(curl -s http://aaronsplace.co.uk/blog/2017-03-23-speaking-email-notifications.html)

Copyright 2007-2018 Aaron S. Jackson (compiled: Sun 3 Jun 13:24:44 BST 2018)