mod_email: Allow sender to override content-type
authorMatthew Wild <mwild1@gmail.com>
Sun, 05 Jan 2020 10:48:23 +0000
changeset 3840 070faeaf51bc
parent 3839 5258f0afa8b4
child 3841 7440cffe30e2
mod_email: Allow sender to override content-type
mod_email/mod_email.lua
--- a/mod_email/mod_email.lua	Sat Jan 04 19:48:35 2020 +0100
+++ b/mod_email/mod_email.lua	Sun Jan 05 10:48:23 2020 +0000
@@ -14,7 +14,9 @@
 		};
 	end
 	headers.To = to;
-	headers["Content-Type"] = 'text/plain; charset="utf-8"';
+	if not headers["Content-Type"] then
+		headers["Content-Type"] = 'text/plain; charset="utf-8"';
+	end
 	local message = smtp.message{
 		headers = headers;
 		body = content;