]> source.dussan.org Git - redmine.git/commitdiff
Reverts r18245 (#31582, #31365).
authorGo MAEDA <maeda@farend.jp>
Thu, 20 Jun 2019 06:57:45 +0000 (06:57 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 20 Jun 2019 06:57:45 +0000 (06:57 +0000)
Issue subjets are truncated in some cases when they are created via email.

git-svn-id: http://svn.redmine.org/redmine/trunk@18269 e93f8b46-1217-0410-a6f0-8f06a7374b81

config/initializers/10-patches.rb
test/fixtures/mail_handler/ticket_with_split_bytes_subject.eml [deleted file]
test/unit/mail_handler_test.rb

index 06edc943ae52eb2e984e44862880a383db03a2e2..e0559903b21618d8a235b3d3ca7bbdb25b4f3106 100644 (file)
@@ -107,20 +107,6 @@ 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
diff --git a/test/fixtures/mail_handler/ticket_with_split_bytes_subject.eml b/test/fixtures/mail_handler/ticket_with_split_bytes_subject.eml
deleted file mode 100644 (file)
index 52b8099..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Date: Mon, 13 May 2019 13:39:29 +0900
-Message-ID: <CALXUZfgwpW-hizEabSAjjkykQGV6-V6bwKu693Cr7cDH6DR7pQ@mail.gmail.com>
-Subject: =?utf-8?B?zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Cz4PPhM+Fz4bP?=
-        =?utf-8?B?h8+Iz4k=?=
-From: <foo@example.com>
-To: <baz@example.com>
-Content-Type: text/plain
-
-Split bytes subject.
index ed064f6f7a2ece7a9e5f69d65640cddcb45e7410..469722a3709beb9a4ccb4ca4677f9ce72e309ae5 100644 (file)
@@ -1147,17 +1147,6 @@ class MailHandlerTest < ActiveSupport::TestCase
     assert_equal issue.subject, 'New ticket on a given project with a very long subject line which exceeds 255 chars and should not be ignored but chopped off. And if the subject line is still not long enough, we just add more text. And more text. Wow, this is really annoying. Especially, if you have nothing to say...'[0,255]
   end
 
-  def test_email_with_split_bytes_subject
-    issue = submit_email(
-              'ticket_with_split_bytes_subject.eml',
-              :issue => {:project => 'ecookbook'},
-              :no_permission_check => '1',
-              :unknown_user => 'accept'
-            )
-    assert issue.is_a?(Issue)
-    assert_equal 'αβγδεζηθικλμνξοπρςστυφχψω', issue.subject
-  end
-
   def test_first_keyword_should_be_matched
     issue = submit_email('ticket_with_duplicate_keyword.eml', :allow_override => 'priority')
     assert issue.is_a?(Issue)