2

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

1 Answer 1

2

Untested; this should get you started:

:0 
* ^Subject:.*AAA.*                 # subject condition
* !^X-Loop: [email protected]  # 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: [email protected]" ; echo "This is my reply") | $SENDMAIL -t
}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .