Try fetchmail and procmail . You periodically poll the mail server (every minute if necessary) and use fetchmail to download from the IMAP server. Configure the procmail rule to run an email notification application that matches your selection criteria.
Any of the scripting languages (perl, python, tcl / tk, etc.) has good, mature and easy-to-use email handler libraries (you can actually get these things for most lanaguages), so this should be pretty simple write a handler in one of them.
source
share