1

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
user36547
  • 111
  • 2

1 Answers1

2

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
}
Heinzi
  • 2,138
  • 5
  • 30
  • 51