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

How would I set up procmail so it replies to all emails with a standard message, provided the emails:

  • Have the word "AAA" in the subject
  • Have the word "BBB" in the text
  • Do not have the words "CCC" or "DDD" in the text
share|improve this question

migrated from Dec 22 '09 at 4:34

This question came from our site for professional and enthusiast programmers.

Untested; this should get you started:

* ^Subject:.*AAA.*                 # subject condition
* !^X-Loop: your@own.mail.address  # prevent mail loops
   :0 c B     # c: make sure you still receive the mail, B: check body instead of header
   * BBB      # body conditions
   * !CCC
   * !DDD
   | (formail -r -A"X-Loop: your@own.mail.address" ; echo "This is my reply") | $SENDMAIL -t
share|improve this answer
Thanks a lot. Will test. – Anonymous Nov 3 '09 at 18:58

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.