Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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:

share|improve this answer

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

* 'Out Of Office'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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