Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question

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

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

add comment

1 Answer 1

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
}
share|improve this answer
    
Thanks a lot. Will test. –  Anonymous Nov 3 '09 at 18:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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