if node[:exim][:dkim_selectors]
keys = data_bag_item("exim", "dkim")
+ template "/etc/exim4/dkim-domains" do
+ owner "root"
+ source "dkim-domains.erb"
+ group "Debian-exim"
+ mode 0o644
+ end
+
template "/etc/exim4/dkim-selectors" do
owner "root"
source "dkim-selectors.erb"
--- /dev/null
+<% node[:exim][:dkim_selectors].each do |domain, _selector| -%>
+*.<%= domain %>: <%= domain %>
+<% end -%>
signed_smtp:
driver = smtp
- dkim_domain = ${lc:${domain:$h_from:}}
+ dkim_domain = ${lookup{${domain:$h_from:}}partial-lsearch{/etc/exim4/dkim-domains}{$value}}
dkim_selector = ${lookup{$dkim_domain}lsearch{/etc/exim4/dkim-selectors}{$value}}
dkim_private_key = /etc/exim4/dkim-keys/${dkim_domain}
dkim_identity = ${lc:${address:$h_from:}}