Não testado; isso deve começar:
: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
}