I'm using procmail to receive email messages and then forward them on to a script for handling. Sometimes this will even mean generating an email (for example, forwarding the message to another user, or answering a query).

Needless to say, I have zero interest in loading up my server with emails from autoresponders or vacation responses, so I'm wondering if there is an easy way to filter out these messages. I am piping these to a script anyway, so I can always roll my own filter in the script, but I'd rather not reinvent the wheel.

I already know I should trash messages with Precedence: junk or Precedence: bulk. Can I just filter them like you would any other header in procmail?

link|improve this question

75% accept rate
feedback

2 Answers

up vote 4 down vote accepted

Reading the docs would be a good start. There's a mini-howto here which covers the basics. Automatically generated messages should be picked up by the FROM_DAEMON and FROM_MAILER rules. Also use X-Loop (described in doc referenced above) to avoid looping messages.

Finally, you can suppress repeat replies to the same address as demonstrated here (for the pruposes of a vacation auto-responder). So even if the remote system does not play nicely and populate the from address properly and strips out the X-Loop header, you can break the cycle.

Procmail can be used to create very sophisticated systems - it's a programming language in its own right. You might also want to have a look at:

link|improve this answer
feedback

Well, if the subject contains a standard response, then you can filter everything with "Out Of Office" (or similar) to /dev/null.

:0
* 'Out Of Office'
/dev/null
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.