mirror of
https://github.com/chatmail/relay.git
synced 2026-05-13 01:24:36 +00:00
OpenDKIM configuration has two Lua scripts defining strict DKIM policy. screen.lua filters out signatures that do not correspond to the From: domain so they are not even checked. final.lua rejects mail if it is not outgoing and has no valid DKIM signatures. OpenDKIM is configured as a milter on port 25 smtpd to check DKIM signatures and on mail reinjecting smtpd to sign outgoing messages with DKIM signatures.
22 lines
386 B
Lua
22 lines
386 B
Lua
-- Ignore signatures that do not correspond to the From: domain.
|
|
|
|
from_domain = odkim.get_fromdomain(ctx)
|
|
if from_domain == nil then
|
|
return nil
|
|
end
|
|
|
|
n = odkim.get_sigcount(ctx)
|
|
if n == nil then
|
|
return nil
|
|
end
|
|
|
|
for i = 1, n do
|
|
sig = odkim.get_sighandle(ctx, i - 1)
|
|
sig_domain = odkim.sig_getdomain(sig)
|
|
if from_domain ~= sig_domain then
|
|
odkim.sig_ignore(sig)
|
|
end
|
|
end
|
|
|
|
return nil
|