--[[ Copyright (c) 2022, Vsevolod Stakhov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ]]-- if confighelp then return end -- Module for checking mail list headers local N = 'maillist' local symbol = 'MAILLIST' local lua_util = require "lua_util" -- EZMLM -- Mailing-List: .*run by ezmlm -- Precedence: bulk -- List-Post: = 1 then if check_ml_ezmlm(task) then task:insert_result(symbol, 1, 'ezmlm') elseif check_ml_mailman(task) then task:insert_result(symbol, 1, 'mailman') elseif check_ml_googlegroup(task) then task:insert_result(symbol, 1, 'googlegroups') elseif check_ml_cgp(task) then task:insert_result(symbol, 1, 'cgp') else if score > 2 then score = 2 end task:insert_result(symbol, 0.5 * score, 'generic') end end end -- Configuration local opts = rspamd_config:get_all_opt('maillist') if opts then if opts['symbol'] then symbol = opts['symbol'] rspamd_config:register_symbol({ name = symbol, callback = check_maillist, flags = 'nice' }) end end