_init('aw_hdu3/gateway_mail_rejectPattern'); } /** * @param AW_Helpdesk3_Model_Gateway_Mail $mail * * @return bool */ public function match($mail) { foreach ($this->getTypes() as $type) { if ($type == AW_Helpdesk3_Model_Source_Gateway_Mail_RejectPattern::HEADER_VALUE) { if (@preg_match($this->getPattern(), $mail->getHeaders())) { return true; } } if ($type == AW_Helpdesk3_Model_Source_Gateway_Mail_RejectPattern::SUBJECT_VALUE) { if (@preg_match($this->getData('pattern'), $mail->getSubject())) { return true; } } if ($type == AW_Helpdesk3_Model_Source_Gateway_Mail_RejectPattern::BODY_VALUE) { if (@preg_match($this->getData('pattern'), $mail->getBody())) { return true; } } } return false; } }