Skip to content

Instantly share code, notes, and snippets.

@brablc
Last active August 29, 2015 14:17
Show Gist options
  • Save brablc/4494714130d9a9f40459 to your computer and use it in GitHub Desktop.
Save brablc/4494714130d9a9f40459 to your computer and use it in GitHub Desktop.
KeyTable.lua for opendkim
-- If there is no "@dkim" it means we did not get X-DKIM-Sender header, but From instead.
if query == nil or string.find( query, "@dkim$" ) == nil then
query = "default=news.shoptet.cz@dkim"
end
signer = string.gsub( query, "@.*", "")
-- Before =
s = string.gsub( signer, "=.*", "")
-- After =
d = string.gsub( signer, ".*=", "")
-- Remove dots from selector
s = string.gsub( s, "%.", "_")
return d, s, "/etc/opendkim/shoptet.private"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment