Pascal - 2016-09-12

As a work-around, I added "SetupPolicyScript /etc/opendkim/setup.lua" to /etc/opendkim.conf and put the below in /etc/opendkim/setup.lua. It skips adding a signature if it finds a DKIM v1 signature in a message without any Received headers.

dkim = odkim.get_header(ctx, "DKIM-Signature", 0)
if (dkim ~= nil) and (string.find(dkim, "v=1;") == 1) then
if odkim.get_header(ctx, "Received", 0) == nil then
odkim.set_result(ctx, SMFIS_ACCEPT)
end
end
return nil