(match-all (header-contains "From" ${sender})) The From address matches sender(s). (match-all (header-contains "To" ${receipient})) The To address matches receipients. (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 receipient. (match-all (not (body-contains ${words}))) The body does not contain words.