-- Definitions of header regexps local reconf = config['regexp'] metrics['default']['BAYES_SPAM'] = { weight = 6.0, description = 'Bayes spam probability: ' } metrics['default']['BAYES_HAM'] = { weight = -5.0, description = 'Bayes ham probability: ' } metrics['default']['R_SPF_ALLOW'] = { weight = -1.0, description = 'Sender domain designates sender host address as permitted sender' } metrics['default']['R_TO_SEEMS_AUTO'] = { weight = 2.0, description = 'To header seems to be autogenerated' } metrics['default']['MISSING_MIMEOLE'] = { weight = 4.0, description = 'Mime-OLE is needed but absent (e.g. fake Outlook or fake Exchange)' } -- Detects bad content-transfer-encoding for text parts -- For text parts (text/plain and text/html mainly) local r_ctype_text = 'content_type_is_type(text)' -- Content transfer encoding is 7bit local r_cte_7bit = 'compare_transfer_encoding(7bit)' -- And body contains 8bit characters local r_body_8bit = '/[^\\x01-\\x7f]/Pr' reconf['R_BAD_CTE_7BIT'] = string.format('(%s) & (%s) & (%s) & (%s)', r_ctype_text, r_cte_7bit, r_body_8bit, 'raw_header_exists(Content-Transfer-Encoding)') metrics['default']['R_BAD_CTE_7BIT'] = { weight = 5.0, description = 'Detects bad Content-Transfer-Encoding for text parts' } reconf['R_MISSING_CTE'] = string.format('(%s) & (%s) & (%s) & !(%s)', r_ctype_text, 'raw_header_exists(Content-Type)', r_cte_7bit, 'raw_header_exists(Content-Transfer-Encoding)') metrics['default']['R_MISSING_CTE'] = { weight = 3.0, description = 'Detects missing Content-Transfer-Encoding for text parts' } -- Detects missing To header -- reconf['MISSING_TO']= '!raw_header_exists(To)'; -- metrics['default']['MISSING_TO'] = { weight = 2.0, description = 'To header is missing' } reconf['EMPTY_TO'] = string.format('!(%s) & !(%s)', reconf['MISSING_TO'], 'header_exists(To)') metrics['default']['EMPTY_TO'] = { weight = 2.5, description = 'To header is empty' } -- Detects undisclosed recipients reconf['R_UNDISC_RCPT'] = 'To=/^