From: Vsevolod Stakhov Date: Fri, 25 Oct 2019 10:24:28 +0000 (+0100) Subject: [Minor] Cleanup crap X-Git-Tag: 2.1~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7603ac88ab8c9ccc44223c3580d857033457d5d8;p=rspamd.git [Minor] Cleanup crap --- diff --git a/.luacheckrc b/.luacheckrc index 871aa4811..1af61bfda 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -15,7 +15,6 @@ globals = { 'classifiers', 'config', 'confighelp', - 'kmail_msgid', 'rspamd_classifiers', 'rspamd_config', 'rspamd_count_metatokens', diff --git a/rules/regexp/headers.lua b/rules/regexp/headers.lua index dfd18f7df..1b76b6f36 100644 --- a/rules/regexp/headers.lua +++ b/rules/regexp/headers.lua @@ -415,23 +415,6 @@ reconf['FORGED_MUA_THEBAT_MSGID_UNKNOWN'] = { local kmail_mua = 'User-Agent=/^\\s*KMail\\/1\\.\\d+\\.\\d+/H' -- KMail common Message-ID template local kmail_msgid_common = 'Message-Id=/^?$/mH' -function kmail_msgid (task) - local regexp_text = '<(\\S+)>\\|(19[789]\\d|20\\d\\d)(0\\d|1[012])([012]\\d|3[01])([0-5]\\d)([0-5]\\d)\\.\\d+\\.\\1$' - local re = rspamd_regexp.create_cached(regexp_text) - local header_msgid = task:get_header('Message-Id') - if header_msgid then - local header_from = task:get_header('From') - if header_from and re:match(header_from.."|"..header_msgid) then return true end - end - return false -end --- Summary rule for forged KMail Message-ID header -reconf['FORGED_MUA_KMAIL_MSGID'] = { - re = string.format('(%s) & (%s) & !(%s) & !(%s)', kmail_mua, kmail_msgid_common, 'kmail_msgid', unusable_msgid), - score = 3.0, - description = 'Message pretends to be send from KMail but has forged Message-ID', - group = 'mua' -} -- Summary rule for forged KMail Message-ID header with unknown template reconf['FORGED_MUA_KMAIL_MSGID_UNKNOWN'] = { re = string.format('(%s) & !(%s) & !(%s)', kmail_mua, kmail_msgid_common, unusable_msgid),