GhettoPush with new features

November 14th, 2009 | Categories: CLI, IMAP, Linux, MacOSX, Mail, Mobile | Tags: ,

Martin's GhettoPush, which I talked about recently is being heavily used here. So much, that I've implemented some changes, that Martin has kindly merged back into his master repository.

The two additions I submitted to the code are both very similar — almost identical. They enable us to exclude certain e-mail messages from being Prowl'ed. You can use two files containing regular expressions for doing this, by defining them in imapidle2prowl's configuration:

# Optionally, specify the name of a file containing
# a list of regular expressions of From addresses
# to ignore (i.e. these will *not* be PROWled).
from_regex = noprowl.regexps

# Optionally, specify the name of a file containing
# a list of regular expressions of Subject lines
# to ignore (i.e. these will *not* be PROWled).
subj_regex = noprowl-subj.regexps

The first is matched case-insensitively against the From: header (not the envelope sender) of the message, and the second set of regular expressions match (also case-insensitively) against the Subject header. If a match is found on either, Prowl is not notified.

As an example, consider the following file I could use for subject-regular expressions:

# This is a comment. Empty lines are ignored.

v.*i.*a.*g.*r.*a
^cron
spam:

This allows me (and you of course) to exclude messages from mailing lists, messages flagged as spam, as well as e-mails from SWMBO reminding you to take out the rubbish. ;-)