summaryrefslogtreecommitdiffstats
path: root/config/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/10-patches.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index e0559903b..06edc943a 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -107,6 +107,20 @@ end
require 'mail'
+module Mail
+ class SubjectField
+ # Fixed that the issue subject may be broken if the subject field in the
+ # receiving email is split into multiple lines
+ def initialize(value = nil, charset = 'utf-8')
+ if mime_encode = /^(=\?\S+\?\S\?)/.match(value).to_a[1]
+ value.gsub!(/\?=\s+#{Regexp.escape(mime_encode)}/, '')
+ end
+ self.charset = charset
+ super(CAPITALIZED_FIELD, value, charset)
+ end
+ end
+end
+
module DeliveryMethods
class TmpFile
def initialize(*args); end