Patch #37993

Update Mail gem to 2.8

Added by Pavel Rosický about 1 month ago. Updated 22 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Gems support
Target version:5.1.0

Description

https://github.com/mikel/mail/blob/2-8-stable/CHANGELOG.rdoc#label-Version+2.8.0+-283-Dec-2022-29

diff --git a/Gemfile b/Gemfile
index 79275f83a..c7b9da727 100644
--- a/Gemfile
+++ b/Gemfile
@@ -10,7 +10,7 @@ gem 'mini_mime', '~> 1.1.0'
 gem "actionpack-xml_parser" 
 gem 'roadie-rails', '~> 3.0.0'
 gem 'marcel'
-gem "mail", "~> 2.7.1" 
+gem "mail", "~> 2.8.0" 
 gem 'csv', '~> 3.2.0'
 gem 'nokogiri', '~> 1.13.6'
 gem "rexml", require: false if Gem.ruby_version >= Gem::Version.new('3.0')
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 8f7cef691..ece770baa 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -523,12 +523,7 @@ class MailHandler < ActionMailer::Base
       part.attachment?
     end
     parts.map do |p|
-      body_charset =
-        if Mail::RubyVer.respond_to?(:pick_encoding)
-          Mail::RubyVer.pick_encoding(p.charset).to_s
-        else
-          p.charset
-        end
+      body_charset = Mail::Utilities.pick_encoding(p.charset).to_s
       body = Redmine::CodesetUtil.to_utf8(p.body.decoded, body_charset)
       # convert html parts to text
       p.mime_type == 'text/html' ? self.class.html_body_to_text(body) : self.class.plain_text_body_to_text(body)

History

#1 Updated by Go MAEDA about 1 month ago

  • Subject changed from Mail 2.8.0 to update Mail to 2.8
  • Target version set to 5.1.0

Setting the target version to 5.1.0.

#2 Updated by Marius BALTEANU about 1 month ago

  • Subject changed from update Mail to 2.8 to Update Mail gem to 2.8

#3 Updated by Holger Just about 1 month ago

Note that there is currently an open issue on the mail gem which prevents its usage on some setups (namely where the bundle install happens with a different user than that of the running Redmine): https://github.com/mikel/mail/issues/1516

I'd prefer that we only update the gem version if this issue is resolved upstream (and to the fixed version at least).

#4 Updated by Thomas Löber 22 days ago

There is also an issue (ArgumentError) when using mail 2.8.0 with the sendmail delivery method: https://github.com/mikel/mail/issues/1541

Also available in: Atom PDF