Project

General

Profile

redmine:email:receive_imap fails when feching emails from Gmail

Added by Jose Gonzalez about 12 years ago

Hi there, I'm creating new ISSUES on redmine using:

rake redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com port=993 ssl=1 username=mail@gmail.com password=xxxx folder=INBOX move_on_success=SUCCESS allow_override=tracker,priority,category,status --trace

This process fails when there are more than 30 unread emails on the INBOX, throwing this exception:

rake aborted!
undefined method `[]' for nil:NilClass
/home/ec2-user/redmine-2.1.4/lib/redmine/imap.rb:33:in `check'
/home/ec2-user/redmine-2.1.4/lib/redmine/imap.rb:32:in `each'
/home/ec2-user/redmine-2.1.4/lib/redmine/imap.rb:32:in `check'
/home/ec2-user/redmine-2.1.4/lib/tasks/email.rake:133
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/task.rb:227:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/task.rb:227:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/task.rb:222:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/task.rb:222:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/task.rb:166:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/task.rb:152:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:141:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:99:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:99:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:99:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:108:in `run_with_threads'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:93:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:71:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:68:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.2/bin/rake:37
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

My System Information (I'm running Redmine on a EC2 instance):

Environment:
  Redmine version                          2.1.4
  Ruby version                             1.9.3 (i686-linux)
  Rails version                            2.3.5
  Environment                              production
  Database adapter                         Mysql2

Any help appreciated.

Regards
Jose Gonzalez


Replies (2)

RE: redmine:email:receive_imap fails when feching emails from Gmail - Added by Alexey Kireev about 11 years ago

Server imap.yandex.ru with empty mailbox:

sudo -u redmine bundle exec rake -f /var/lib/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.yandex.ru ssl=YES username=username@dezigner.ru password=password project=project1 no_permission_check=1 unknown_user=accept port=993 --trace
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
undefined method `[]' for nil:NilClass
/usr/lib64/ruby/1.9.1/net/imap.rb:1332:in `block in search_internal'
/usr/lib64/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/lib64/ruby/1.9.1/net/imap.rb:1326:in `search_internal'
/usr/lib64/ruby/1.9.1/net/imap.rb:757:in `uid_search'
/var/lib/redmine/lib/redmine/imap.rb:32:in `check'
/var/lib/redmine/lib/tasks/email.rake:141:in `block (3 levels) in <top (required)>'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/lib64/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/bin/rake:23:in `load'
/var/lib/redmine/vendor/bundle/ruby/1.9.1/bin/rake:23:in `<main>'
Tasks: TOP => redmine:email:receive_imap

Configuration:

Environment:
  Redmine version                2.3.3.stable
  Ruby version                   1.9.3-p448 (2013-06-27) [x86_64-linux]
  Rails version                  3.2.13
  Environment                    production
  Database adapter               Mysql2
Redmine plugins:
  no plugin installed

    (1-2/2)