Defect #12396

Error when receiving an email without subject header

Added by Jürgen Hörmann about 5 years ago. Updated almost 5 years ago.

Status:ClosedStart date:
Priority:HighDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Email receiving
Target version:2.1.4
Resolution:Fixed Affected version:2.1.3

Description

Hello.

Because we did not find a solution for this problem in the forum I will open a ticket for this.

My system information:

Environment:
  Redmine version                          2.1.3.stable
  Ruby version                             1.9.3 (i686-linux)
  Rails version                            3.2.8
  Environment                              production
  Database adapter                         Mysql2
Redmine plugins:
  no plugin installed

The system does send mail out without any issue. Sending over TLS (GMail) is working properly.

If I try to generate redmine tickets from an IMAP inbox with the command:

rake -f /var/www/clients/client1/web11/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com \
ssl=1 port=993 username=XXX password=XXX folder=Labor move_on_success="[Google Mail]/All Mail" \
move_on_failure="[Google Mail]/All Mail" tracker=support project=support allow_override=tracker,project --trace

The login to the IMAP server can be established and mails get flagged as read, but whenever an unread mail is in the inbox, I get the following error:

** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
undefined method `match' for nil:NilClass
/var/www/clients/client1/web11/redmine/app/models/mail_handler.rb:135:in `dispatch'
/var/www/clients/client1/web11/redmine/app/models/mail_handler.rb:116:in `receive'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionmailer-3.2.8/lib/action_mailer/base.rb:404:in `block in receive'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionmailer-3.2.8/lib/action_mailer/base.rb:401:in `receive'
/var/www/clients/client1/web11/redmine/app/models/mail_handler.rb:44:in `receive'
/var/www/clients/client1/web11/redmine/lib/redmine/imap.rb:35:in `block in check'
/var/www/clients/client1/web11/redmine/lib/redmine/imap.rb:32:in `each'
/var/www/clients/client1/web11/redmine/lib/redmine/imap.rb:32:in `check'
/var/www/clients/client1/web11/redmine/lib/tasks/email.rake:133:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/task.rb:227:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/task.rb:227:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/task.rb:222:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/task.rb:222:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/task.rb:159:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/task.rb:152:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:141:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:99:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:99:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:99:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:108:in `run_with_threads'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:93:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:71:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:158:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/lib/rake/application.rb:68:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.1/bin/rake:37:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => redmine:email:receive_imap

Any help appreciated.

Associated revisions

Revision 10850
Added by Jean-Philippe Lang about 5 years ago

Fixed that MailHandler raises an error when email has no subject header (#12396).

Revision 10861
Added by Jean-Philippe Lang almost 5 years ago

Merged r10850 from trunk (#12396).

History

#1 Updated by Jean-Philippe Lang about 5 years ago

It looks like the email you're receiving does have any subject. Could you attach the raw email here?

#2 Updated by Jean-Philippe Lang about 5 years ago

This should be fixed by r10850. Can you give it a try?

#3 Updated by Jürgen Hörmann about 5 years ago

  • Status changed from New to Resolved

Installed the trunk last night.
Issue seems to be fixed now.

Thank you very much.

#4 Updated by Jean-Philippe Lang almost 5 years ago

  • Subject changed from Polling IMAP folder fails. to Error when receiving an email without subject header
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.1.4
  • Resolution set to Fixed

Thanks for the feedback.

#5 Updated by Jean-Philippe Lang almost 5 years ago

  • Status changed from Resolved to Closed

Merged in 2.1-stable.

Also available in: Atom PDF