]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Couple of fixes for DKIM signing module
authorAndrew Lewis <nerf@judo.za.org>
Mon, 6 Mar 2017 16:00:20 +0000 (18:00 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 6 Mar 2017 16:00:20 +0000 (18:00 +0200)
src/plugins/lua/dkim_signing.lua

index 7f3d1ffccc2198c7af58906453bb151f216236b8..d439c5e586015ae36a4041f498c16bf075f15cc0 100644 (file)
@@ -78,13 +78,13 @@ local function dkim_signing_cb(task)
   end
   if settings.use_esld then
     dkim_domain = rspamd_util.get_tld(dkim_domain)
-    if settings.use_domain == 'envelope' then
+    if settings.use_domain == 'envelope' and hdom then
       hdom = rspamd_util.get_tld(hdom)
-    elseif settings.use_domain == 'header' then
+    elseif settings.use_domain == 'header' and edom then
       edom = rspamd_util.get_tld(edom)
     end
   end
-  if not settings.allow_hdrfrom_mismatch and hdom ~= edom then
+  if edom and hdom and not settings.allow_hdrfrom_mismatch and hdom ~= edom then
     rspamd_logger.debugm(N, task, 'domain mismatch not allowed: %1 != %2', hdom, edom)
     return false
   end