diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-10-23 12:35:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-23 12:35:14 +0100 |
commit | b2a56e306a69aac37ecbd092706568f27f94282b (patch) | |
tree | 38608fc146d2f8136be04ca280b6c1ac09df699e | |
parent | 0d916d0c7a636fcd72d80f73193d8543a1e6dcd3 (diff) | |
parent | d80afefcbf9a4afbab4704d9533e7ecb4d85fa3f (diff) | |
download | rspamd-b2a56e306a69aac37ecbd092706568f27f94282b.tar.gz rspamd-b2a56e306a69aac37ecbd092706568f27f94282b.zip |
Merge pull request #3111 from philr/fix_dmarc_report_sending
[Fix] Fix issues sending DMARC reports
-rw-r--r-- | src/plugins/lua/dmarc.lua | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index ab8a3bf53..eab87c85a 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -46,14 +46,14 @@ local report_settings = { retries = 2, from_name = 'Rspamd', } -local report_template = [[From: "{% from_name %}" <{% from_addr %}> -To: {% rcpt %} -Subject: Report Domain: {% reporting_domain %} - Submitter: {% submitter %} - Report-ID: {% report_id %} -Date: {% report_date %} +local report_template = [[From: "{= from_name =}" <{= from_addr =}> +To: {= rcpt =} +Subject: Report Domain: {= reporting_domain =} + Submitter: {= submitter =} + Report-ID: {= report_id =} +Date: {= report_date =} MIME-Version: 1.0 -Message-ID: <{% message_id %}> +Message-ID: <{= message_id =}> Content-Type: multipart/mixed; boundary="----=_NextPart_000_024E_01CC9B0A.AFE54C00" @@ -63,17 +63,17 @@ This is a multipart message in MIME format. Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit -This is an aggregate report from {% submitter %}. +This is an aggregate report from {= submitter =}. -Report domain: {% reporting_domain %} -Submitter: {% submitter %} -Report ID: {% report_id %} +Report domain: {= reporting_domain =} +Submitter: {= submitter =} +Report ID: {= report_id =} ------=_NextPart_000_024E_01CC9B0A.AFE54C00 Content-Type: application/gzip Content-Transfer-Encoding: base64 Content-Disposition: attachment; - filename="{% submitter %}!{% reporting_domain %}!{% report_start %}!{% report_end %}.xml.gz" + filename="{= submitter =}!{= reporting_domain =}!{= report_start =}!{= report_end =}.xml.gz" ]] local report_footer = [[ @@ -912,6 +912,8 @@ if opts['reporting'] == true then else send_report_via_email(xmlf, retry + 1) end + else + get_reporting_domain() end end @@ -946,9 +948,9 @@ if opts['reporting'] == true then report_end = report_end }, true) local message = { - rhead:gsub("\n", "\r\n"), + (rhead:gsub("\n", "\r\n")), encoded, - report_footer:gsub("\n", "\r\n") + (report_footer:gsub("\n", "\r\n")) } local lua_smtp = require "lua_smtp" |