Defect #2814

Mail with swedish chars fails to get added as issue

Added by Fredrik Frodlund over 8 years ago. Updated almost 8 years ago.

Status:ClosedStart date:2009-02-23
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:0.8.2
Resolution:Fixed Affected version:0.8.1

Description

I just noticed that Redmine no longer can add issues from mail that contain swedish chars (Å, Ä and Ö as well as å, ä and ö) in the beginning of the subject.

A sample of such a mail in raw:

MIME-Version: 1.0
From: supportform@domain.se
To: support@domain.se
Date: 23 Feb 2009 17:31:39 +0100
Subject: =?utf-8?B?w4XDhMOWIGkgYsO2cmphdCAodGVzdCBudW1tZXIgMjAp?=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64

U3ZlbnNrYSB0ZWNrZW4gaSBiw7ZyamFuIGF2IHN1YmplY3QNCg0KaHR0cDovL3d3dy5uZXRy
ZWxhdGlvbnMuc2Uvc3VwcG9ydC9hcmVuZGVuL25ldHJlbGF0aW9ucy8wOTAyMjMtMTczMTM5
LWFhby1pLWJvcmphdC10ZXN0LW51bW1lci0yMC8NCg0KUHJvamVjdDoga29udDUwMDENClBy
aW9yaXRldDogS3JpdGlza3Q=

I ran a rake --trace redmine:email:receive_imap via console:

rake --trace redmine:email:receive_imap \
host=domainname \
port=993 \
ssl=1 \
username=**** \
password=**** \
move_on_success=success \
move_on_failure=failed \
RAILS_ENV="production" 

and this was the result:

(in /home/username/www-rails/redmine)
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
private method `gsub!' called for nil:NilClass
/home/username/www-rails/redmine/app/models/mail_handler.rb:171:in `get_keyword'
/home/username/www-rails/redmine/app/models/mail_handler.rb:114:in `target_project'
/home/username/www-rails/redmine/app/models/mail_handler.rb:78:in `receive_issue'
/home/username/www-rails/redmine/app/models/mail_handler.rb:62:in `dispatch'
/home/username/www-rails/redmine/app/models/mail_handler.rb:51:in `receive'
/usr/lib/ruby/gems/1.8/gems/actionmailer-2.1.2/lib/action_mailer/base.rb:404:in `receive'
/home/username/www-rails/redmine/app/models/mail_handler.rb:37:in `receive'
/home/username/www-rails/redmine/lib/redmine/imap.rb:35:in `check'
/home/username/www-rails/redmine/lib/redmine/imap.rb:32:in `each'
/home/username/www-rails/redmine/lib/redmine/imap.rb:32:in `check'
/home/username/www-rails/redmine/lib/tasks/email.rake:111
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Platform version information

MySQL: 5.0.51a-3ubuntu5.4-log
Ruby: ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
Rails: Rails 2.2.2
Redmine: Redmine 0.8.1.stable.2519

Additional information

Another issue managed to get added via email, but I noticed that those swedish chars (Å,Ä and Ö) got replaced with 奪 辰 and 旦. Quite weird.

Associated revisions

Revision 2520
Added by Jean-Philippe Lang over 8 years ago

Fixed that MailHandler#plain_text_body was returning nil if there was nothing to strip (#2814).

History

#1 Updated by Fredrik Frodlund over 8 years ago

I forgot to mention that this worked perfectly i 0.7.x.

#2 Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from New to Closed
  • Target version set to 0.8.2
  • Affected version (unused) set to 0.8.1
  • Resolution set to Fixed
  • Affected version set to 0.8.1

There was an awful bug in the mail handler. It's fixed in r2520 and merged in 0.8 branch in r2521.
Thanks for pointing this out.

#3 Updated by Jean-Philippe Lang almost 8 years ago

  • Category changed from Email notifications to Email receiving

Also available in: Atom PDF