mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Update mail and use fork (#10639)
Version 2.8 brings some changes to how address fields are handled and this commits updates that and should also include a fix which handles encoded attachment filenames. The fork contains a bugfix to correctly decode mail attachments.
This commit is contained in:
@@ -646,6 +646,14 @@ describe Email::Receiver do
|
||||
MD
|
||||
end
|
||||
|
||||
it "can decode attachments" do
|
||||
SiteSetting.authorized_extensions = "pdf"
|
||||
Fabricate(:group, incoming_email: "one@foo.com")
|
||||
|
||||
process(:encoded_filename)
|
||||
expect(Upload.last.original_filename).to eq("This is a test.pdf")
|
||||
end
|
||||
|
||||
context "when attachment is rejected" do
|
||||
it "sends out the warning email" do
|
||||
expect { process(:attached_txt_file) }.to change { EmailLog.count }.by(1)
|
||||
|
||||
@@ -18,7 +18,7 @@ def EmailFabricator(options)
|
||||
email += "Cc: #{options[:cc]}\n" if options[:cc]
|
||||
email += "In-Reply-To: #{options[:in_reply_to]}\n" if options[:in_reply_to]
|
||||
email += "References: #{options[:in_reply_to]}\n" if options[:in_reply_to]
|
||||
email += "Message-ID: #{options[:message_id]}\n" if options[:message_id]
|
||||
email += "Message-ID: <#{options[:message_id]}>\n" if options[:message_id]
|
||||
email += "Subject: #{options[:subject] || "This is a test email subhect"}\n"
|
||||
email += "Mime-Version: 1.0\n"
|
||||
email += "Content-Type: #{options[:content_type] || "text/plain;\n charset=UTF-8"}\n"
|
||||
|
||||
Reference in New Issue
Block a user