(match-all (header-contains "From" ${sender})) The From address matches sender(s). (match-all (or (header-contains "To" ${recipient}) (header-contains "Cc" ${recipient}))) The To or Cc address matches recipients. (match-all (header-contains "Subject" ${words})) The Subject contains words. (match-all (body-contains ${words})) The body contains words. (match-all (header-contains "CC" ${self-email})) I am in the cc list. (match-all (not (header-contains "To" ${self-email}))) I am the recipient. (match-all (not (body-contains ${words}))) The body does not contain words.