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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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