mailcow/data/conf/rspamd/local.d/dkim.conf

20 lines
747 B
Plaintext
Raw Normal View History

2016-12-10 03:39:02 +08:00
sign_condition =<<EOD
return function(task)
local from = task:get_from('smtp')
if from and from[1]['addr'] then
lastAtSymbol = from[1]['addr']:find("[^%@]+$")
local domain = from[1]['addr']:sub(lastAtSymbol, #from[1]['addr'])
local keyfile = io.open("/etc/rspamd/dkim/keys/" .. domain .. ".default")
if keyfile then
keyfile:close()
return {
key = "/etc/rspamd/dkim/keys/" .. domain .. ".default",
domain = domain,
selector = "default"
}
end
end
return false
end
EOD;