def check(header): if sent_by_addresses(header, senders_of_spam()): return True spams = [" [fF]ree ", " career ", " degree "] if any([has_subject_with(header, re.compile(_)) for _ in spams]): if sent_to_address(header, personal.employer_email("webmaster")): return True if only_sent_to_address(header, personal.spam_recipient()): return True return False
def check(header): meetingrooms = re.compile(personal.employer_email("meetingroom[0-9]")) return sent_to_address(header, meetingrooms)