<p>If my email id receives an email from a particular sender, can I ask sendmail to trigger a different program and pass on the newly arrived email to it for further processing? This is similar to filters in gmail. Wait for some email to arrive, see if it matches the criteria and take some action if it does.</p>

[{'answer_id': 81619, 'author': 'ColinYounger', 'author_id': 1223, 'author_profile': 'https://Stackoverflow.com/users/1223', 'pm_score': 0, 'selected': False, 'text': "<p>We handle this by having a cron process running on the mail server which watches the inbox directory and scans any new messages (files) every 10 minutes or so.</p>\n\n<p>When the process finds an email of interest, it fires the information off to another process which then reacts to the new message (and, in our case, removes the message from the inbox).</p>\n\n<p>--edit--</p>\n\n<p>Finding the email inbox depends on your implementation - check the 'manual' your version of sendmail for details - we direct incoming email to a special directory or have parameters to work out the inbox details. I don't feel it would be useful to be more specific as the answer to 'where is the inbox' is 'it depends'.</p>\n\n<p>As for the pattern to search for - we decode the email message (a text file) into a DOM that we can manipulate. For example, we can then look for specific words in property 'subject'.</p>\n"}, {'answer_id': 81620, 'author': 'Shoban', 'author_id': 12178, 'author_profile': 'https://Stackoverflow.com/users/12178', 'pm_score': 0, 'selected': False, 'text': '<p>are you talking about email clients? If so then you can set rules in outlook and I am sure there mustbe ways in other email cleints too!! If u are asking something else. sorry</p>\n'}, {'answer_id': 81625, 'author': 'JBB', 'author_id': 12332, 'author_profile': 'https://Stackoverflow.com/users/12332', 'pm_score': 2, 'selected': False, 'text': "<p>This is what Procmail is for.</p>\n\n<p>Set Sendmail up to use procmail as the mail delivery agent (MDA), or set up your .forward to pipe stuff through procmail. (See the man page.)</p>\n\n<p>Then you can write your .procmailrc to do all sorts of things along these lines.</p>\n\n<p>This filter predates gmail. Still useful if you're running a mail server.</p>\n"}, {'answer_id': 82096, 'author': 'Shoban', 'author_id': 12178, 'author_profile': 'https://Stackoverflow.com/users/12178', 'pm_score': 0, 'selected': False, 'text': '<p>ok. then I suggest Colins method.. I use cron to monitor emails (for a particluar domain) and send text messages as alerts!. Similar to what you are asking!</p>\n'}]
['https://Stackoverflow.com/questions/81591', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11107/']