(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 (header-contains "CC" ${self-email})) I am in the cc list. (match-all (not (header-contains "To" ${self-email}))) I am the receipient.