Incoming mail usually gets processed and distributed by 'procmail'. It uses a configuration file which consists of one or more 'recipes', or routing based on about anything you like. Personally I would let Procmail only do the grepping and handing over the result and let an external script do any further processing. It minimises the time Procmail spends processing (speed) and it allows you to manage / minimise risks by having it run under an unprivileged ID and introducing checks in the external script you wouldn't do in a procmail recipe.
|