From bad6305f6f173ec9a12d0992ca1956b51e650e27 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 2 Aug 2016 17:06:29 +0100 Subject: [PATCH] [Fix] Add spaces to dkim signature to allow folding --- src/libserver/dkim.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 16cb7f371..057d7b33b 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -2066,19 +2066,19 @@ rspamd_dkim_sign (struct rspamd_task *task, } hdr = g_string_sized_new (255); - rspamd_printf_gstring (hdr, "v=1;a=rsa-sha256;c=%s/%s;d=%s;s=%s;", + rspamd_printf_gstring (hdr, "v=1; a=rsa-sha256; c=%s/%s; d=%s; s=%s; ", ctx->common.header_canon_type == DKIM_CANON_RELAXED ? "relaxed" : "simple", ctx->common.body_canon_type == DKIM_CANON_RELAXED ? "relaxed" : "simple", domain, selector); if (expire > 0) { - rspamd_printf_gstring (hdr, "x=%t;", expire); + rspamd_printf_gstring (hdr, "x=%t; ", expire); } if (len > 0) { - rspamd_printf_gstring (hdr, "l=%z;", len); + rspamd_printf_gstring (hdr, "l=%z; ", len); } - rspamd_printf_gstring (hdr, "t=%t;h=", time (NULL)); + rspamd_printf_gstring (hdr, "t=%t; h=", time (NULL)); /* Now canonize headers */ for (i = 0; i < ctx->common.hlist->len; i++) { @@ -2101,7 +2101,7 @@ rspamd_dkim_sign (struct rspamd_task *task, EVP_DigestFinal_ex (ctx->common.body_hash, raw_digest, NULL); b64_data = rspamd_encode_base64 (raw_digest, dlen, 0, NULL); - rspamd_printf_gstring (hdr, "bh=%s;b=", b64_data); + rspamd_printf_gstring (hdr, " bh=%s; b=", b64_data); g_free (b64_data); if (ctx->common.header_canon_type == DKIM_CANON_RELAXED) { -- 2.39.5