Last active
May 29, 2024 08:57
-
-
Save fatalbanana/76ec8617a46583cfa6dde35a0f7441d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- /etc/rspamd/rspamd.local.lua | |
local lua_maps = require 'lua_maps' | |
local rspamd_util = require 'rspamd_util' | |
local dn_to_email_map = rspamd_config:add_map{ | |
type = "map", | |
url = '/etc/rspamd/restricted_dn.map', | |
--[[#example map content: | |
"Foo Bar" [email protected] | |
]]-- | |
} | |
rspamd_config.DN_RESTRICTION = { | |
callback = function(task) | |
local mfrom = task:get_from('mime') | |
if not mfrom and mfrom[1] then return end | |
local want_mail = dn_to_email_map:get_key(mfrom[1].name) | |
if not want_mail then return end | |
return not rspamd_util.strequal_caseless(mfrom[1].addr:lower(), want_mail) | |
end, | |
score = 10.0, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment