]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] DKIM signing: lower-case both of envelope/header domains 1533/head
authorAndrew Lewis <nerf@judo.za.org>
Fri, 17 Mar 2017 11:44:29 +0000 (13:44 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 17 Mar 2017 11:50:27 +0000 (13:50 +0200)
src/plugins/lua/dkim_signing.lua

index 2efae06254d670dee92a65f2febce0dae2882ddf..8777afe9318a3570eacd0d180e2e77fde39f413a 100644 (file)
@@ -79,6 +79,12 @@ local function dkim_signing_cb(task)
   local dkim_domain
   local hdom = ((hfrom or E)[1] or E).domain
   local edom = ((efrom or E)[1] or E).domain
+  if hdom then
+    hdom = hdom:lower()
+  end
+  if edom then
+    edom = edom:lower()
+  end
   if settings.use_domain == 'header' then
     dkim_domain = hdom
   else
@@ -87,8 +93,6 @@ local function dkim_signing_cb(task)
   if not dkim_domain then
     rspamd_logger.debugm(N, task, 'could not extract dkim domain')
     return false
-  else
-    dkim_domain = dkim_domain:lower()
   end
   if settings.use_esld then
     dkim_domain = rspamd_util.get_tld(dkim_domain)