]> source.dussan.org Git - rspamd.git/commitdiff
[Fix|Breaking change] Use standard rules for non-oversigned headers
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 3 Apr 2018 14:37:53 +0000 (15:37 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 3 Apr 2018 14:37:53 +0000 (15:37 +0100)
Issue: #2136

src/libserver/dkim.c

index f2914535ffab772faa2edbe7b8b08d776220fa2c..3f22a4777874ab6fe785452d5ff649c9f6adb9fa 100644 (file)
@@ -2868,22 +2868,24 @@ rspamd_dkim_sign (struct rspamd_task *task, const gchar *selector,
                        }
                }
                else {
-                       if (hstat.s.count > 0) {
+                       if (g_hash_table_lookup (task->raw_headers, dh->name)) {
+                               if (hstat.s.count > 0) {
 
-                               cur_len = (strlen (dh->name) + 1) * (hstat.s.count);
-                               headers_len += cur_len;
-                               if (headers_len > 70 && i > 0 && i < ctx->common.hlist->len - 1) {
-                                       rspamd_printf_gstring (hdr, "  ");
-                                       headers_len = cur_len;
-                               }
+                                       cur_len = (strlen (dh->name) + 1) * (hstat.s.count);
+                                       headers_len += cur_len;
+                                       if (headers_len > 70 && i > 0 && i < ctx->common.hlist->len - 1) {
+                                               rspamd_printf_gstring (hdr, "  ");
+                                               headers_len = cur_len;
+                                       }
 
-                               for (j = 0; j < hstat.s.count; j++) {
-                                       rspamd_printf_gstring (hdr, "%s:", dh->name);
+                                       for (j = 0; j < hstat.s.count; j++) {
+                                               rspamd_printf_gstring (hdr, "%s:", dh->name);
+                                       }
                                }
-                       }
 
-                       if (g_hash_table_lookup (task->raw_headers, dh->name)) {
-                               rspamd_dkim_canonize_header (&ctx->common, task, dh->name, dh->count,
+
+                               rspamd_dkim_canonize_header (&ctx->common, task,
+                                               dh->name, dh->count,
                                                NULL, NULL);
                        }
                }