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:
: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 }