Project

General

Profile

Error when try to fetch unread emails via IMAP

Added by Eduardo HM almost 2 years ago

Good,

We have the following environment mounted for Redmine:

Environment:
Redmine version 4.1.0.stable
Ruby version 2.5.7-p206 (2019-10-01) [x86_64-linux]
Rails version 5.2.4.1
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp

The problem comes when you want to create incidents through email.

When the following command is executed

rake redmine:email:receive_imap RAILS_ENV="production" host=srvmail.domain.com username= password=***** --trace*

It gives us the following output:


** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
/opt/redmine/config/initializers/bypass_ssl_verification.rb:2: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER
(erubis):1: warning: encountered \r in middle of line, treated as a mere space
(erubis):16: warning: encountered \r in middle of line, treated as a mere space
(erubis):21: warning: encountered \r in middle of line, treated as a mere space
(erubis):24: warning: encountered \r in middle of line, treated as a mere space
(erubis):27: warning: encountered \r in middle of line, treated as a mere space
(erubis):31: warning: encountered \r in middle of line, treated as a mere space
(erubis):34: warning: encountered \r in middle of line, treated as a mere space
(erubis):42: warning: encountered \r in middle of line, treated as a mere space
(erubis):46: warning: encountered \r in middle of line, treated as a mere space
** Execute redmine:email:receive_imap
rake aborted!
Net::IMAP::NoResponseError: failed: Re-Authentication Failure
/usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/2.5.0/net/imap.rb:1217:in `get_tagged_response'
/usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/2.5.0/net/imap.rb:1271:in `block in send_command'
/usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/2.5.0/monitor.rb:235:in `mon_synchronize'
/usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/2.5.0/net/imap.rb:1253:in `send_command'
/usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/2.5.0/net/imap.rb:441:in `login'
/opt/redmine/lib/redmine/imap.rb:36:in `check'
/opt/redmine/lib/tasks/email.rake:121:in `block (4 levels) in <top (required)>'
/opt/redmine/app/models/mailer.rb:630:in `with_synched_deliveries'
/opt/redmine/lib/tasks/email.rake:120:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.5.7/lib/ruby/2.5.0/monitor.rb:235:in `mon_synchronize'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/usr/local/rvm/gems/ruby-2.5.7/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.5.7/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-2.5.7/bin/rake:23:in `<main>'
/usr/local/rvm/gems/ruby-2.5.7/bin/ruby_executable_hooks:24:in `eval'
/usr/local/rvm/gems/ruby-2.5.7/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => redmine:email:receive_imap

It has been verified that the credentials are correct, since they are the same ones that are used to send notifications that work correctly.

It has also been configured in a mail client (outlook) to see the mail from this account, through IMAP, and it connects correctly and you can see the mail that arrives without problem.

What causes this error when launching the "receive_imap" task from the Redmine command line?

Thank you very much in advance.