commit 38f50a6ce02eaaa0041407e149a7480fc04cea70
parent bcf87a864c5543ee5daf459fd9466b5d92b57da4
Author: Dan Callaghan <djc@djc.id.au>
Date: Sun, 11 Oct 2026 16:32:24 +1100
always set MIME-Version header on outgoing mails
Sup unconditionally fills Content-Type and Content-Transfer-Encoding
headers and these are supposedly MIME headers, and thus a corresponding
MIME-Version header is also required.
Rspamd applies a penalty to mails originating from Sup because of the
missing MIME-Version header.
Add MIME-Version unconditionally.
Also move the Content-Type header down lower to sit alongside
Content-Transfer-Encoding, rather than at the very top of the message,
just for tidiness' sake.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/sup/modes/edit_message_mode.rb b/lib/sup/modes/edit_message_mode.rb
@@ -553,7 +553,6 @@ protected
def build_message date
m = RMail::Message.new
- m.header["Content-Type"] = "text/plain; charset=#{$encoding}"
m.body = @body.join("\n")
m.body += "\n" + sig_lines.join("\n") unless @sig_edited
## body must end in a newline or GPG signatures will be WRONG!
@@ -601,8 +600,9 @@ protected
m.header["Date"] = date.rfc2822
m.header["Message-Id"] = @message_id
m.header["User-Agent"] = "Sup/#{Redwood::VERSION}"
+ m.header["Content-Type"] = "text/plain; charset=#{$encoding}"
m.header["Content-Transfer-Encoding"] ||= +"8bit"
- m.header["MIME-Version"] = +"1.0" if m.multipart?
+ m.header["MIME-Version"] = +"1.0"
m
end