diff --git a/Gemfile b/Gemfile
index 0b3f89a6ad5..0c531ded924 100644
--- a/Gemfile
+++ b/Gemfile
@@ -24,7 +24,7 @@ else
gem 'seed-fu'
end
-gem 'mail', require: false
+gem 'mail', '2.7.1.rc1', require: false
gem 'mini_mime'
gem 'mini_suffix'
diff --git a/Gemfile.lock b/Gemfile.lock
index 2ff7ea8552a..5ab2e6f7e8a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -161,14 +161,14 @@ GEM
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lru_redux (1.1.0)
- mail (2.7.0)
+ mail (2.7.1.rc1)
mini_mime (>= 0.1.1)
memory_profiler (0.9.10)
message_bus (2.1.4)
rack (>= 1.1.3)
metaclass (0.0.4)
method_source (0.8.2)
- mini_mime (0.1.3)
+ mini_mime (1.0.0)
mini_portile2 (2.3.0)
mini_racer (0.1.15)
libv8 (~> 6.3)
@@ -436,7 +436,7 @@ DEPENDENCIES
logstash-logger
logster
lru_redux
- mail
+ mail (= 2.7.1.rc1)
memory_profiler
message_bus
mini_mime
diff --git a/spec/components/email/receiver_spec.rb b/spec/components/email/receiver_spec.rb
index ef1f2f161c2..153d9a39569 100644
--- a/spec/components/email/receiver_spec.rb
+++ b/spec/components/email/receiver_spec.rb
@@ -183,7 +183,7 @@ describe Email::Receiver do
it "works" do
expect { process(:text_reply) }.to change { topic.posts.count }
- expect(topic.posts.last.raw).to eq("This is a text reply :)")
+ expect(topic.posts.last.raw).to eq("This is a text reply :)\n\nEmail parsing should not break because of a UTF-8 character: ’")
expect(topic.posts.last.via_email).to eq(true)
expect(topic.posts.last.cooked).not_to match(/
, wrote' quoting line" do
diff --git a/spec/fixtures/emails/forwarded_email_3.eml b/spec/fixtures/emails/forwarded_email_3.eml
index 549dd44a68b..d09f9e063e6 100644
--- a/spec/fixtures/emails/forwarded_email_3.eml
+++ b/spec/fixtures/emails/forwarded_email_3.eml
@@ -9,7 +9,7 @@ Subject: Fwd: Ça Discourse ?
Objet: Ça Discourse ?
Date: 2017-01-04 11:27
De: Un Français
-À: ba@bar.com
+A: ba@bar.com
Bonjour,
diff --git a/spec/fixtures/emails/text_reply.eml b/spec/fixtures/emails/text_reply.eml
index 1d295a3f233..a3c6ab57140 100644
--- a/spec/fixtures/emails/text_reply.eml
+++ b/spec/fixtures/emails/text_reply.eml
@@ -3,8 +3,8 @@ From: Foo Bar
To: reply+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com
Date: Fri, 15 Jan 2016 00:12:43 +0100
Message-ID: <15@foo.bar.mail>
-Mime-Version: 1.0
Content-Type: text/plain
-Content-Transfer-Encoding: 7bit
This is a text reply :)
+
+Email parsing should not break because of a UTF-8 character: ’