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
link|improve this question
feedback

migrated from stackoverflow.com Dec 22 '09 at 4:34

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

1 Answer

Untested; this should get you started:

:0 
* ^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
}
link|improve this answer
Thanks a lot. Will test. – Anonymous Nov 3 '09 at 18:58
feedback

Your Answer

 
or
required, but never shown

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