Project

General

Profile

Actions

Patch #37993

closed

Update Mail gem to 2.8

Added by Pavel Rosický over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Gems support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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)


Related issues

Related to Redmine - Defect #39154: MailhandlerNeeds feedback

Actions
Actions #1

Updated by Go MAEDA over 1 year 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.

Actions #2

Updated by Marius BĂLTEANU over 1 year ago

  • Subject changed from update Mail to 2.8 to Update Mail gem to 2.8
Actions #3

Updated by Holger Just over 1 year 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).

Actions #4

Updated by Thomas Löber over 1 year 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

Actions #5

Updated by Pavel Rosický about 1 year ago

2.8.1 is out. Both issues are resolved there.

Actions #6

Updated by Go MAEDA about 1 year ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you.

Actions #7

Updated by Go MAEDA 7 months ago

Actions

Also available in: Atom PDF