Project

General

Profile

Erro to receive e-mail from IMAP.

Added by Targino Silveira over 10 years ago

Hello,

I'm having a problem to fech e-mail from IMAP, I'm following documentation on Redmine Wiki, but always getting error.

I'm ussing this command line
rake Rakefile --trace redmine:email:receive_imap RAILS_ENV="production" host=imap.host.com port=993 username= password=********* ssl=1 folder=INBOX/

And got this error:

  • Invoke Rakefile (first_time, not_needed)
  • Invoke redmine:email:receive_imap (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute redmine:email:receive_imap
    rake aborted!
    SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
    /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/imap.rb:1439:in `connect'
    /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/imap.rb:1439:in `start_tls_session'
    /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/imap.rb:1036:in `initialize'
    /opt/apps/redmine/lib/redmine/imap.rb:29:in `new'
    /opt/apps/redmine/lib/redmine/imap.rb:29:in `check'
    /opt/apps/redmine/lib/tasks/email.rake:125:in `block (3 levels) in <top (required)>'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
    /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/bin/rake:19:in `load'
    /usr/local/rvm/gems/ruby-1.9.3-p448@global/bin/rake:19:in `<main>'
    /usr/local/rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
    /usr/local/rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'
    Tasks: TOP => redmine:email:receive_imap

If I remove ssl=1 it's stay receving e-mail for ever and never receive a message

  • Invoke Rakefile (first_time, not_needed)
  • Invoke redmine:email:receive_imap (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute redmine:email:receive_imap

Some one here knows some thing about this ?

Regards,

Targino Silveira


Replies (4)

RE: Erro to receive e-mail from IMAP. - Added by jerome l over 10 years ago

hi Targino,

my command is as follow:

rake -f /var/www/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com username=usergmail.com password=****** port=993 ssl=1 project=**** --trace

are you sure your mail server supports ssl ?
don't hesitate to open another account (on gmail for example), to debug your query.
try to check the log in production.log if you can have more details.

RE: Erro to receive e-mail from IMAP. - Added by Targino Silveira over 10 years ago

I have own mail server, and when I try to connect with mail client it's says that I need to accept the risk because certificate is not valid.

I think this is a problem for receive e-mail by redmine.

Some has some help to me?

Regards

RE: Erro to receive e-mail from IMAP. - Added by Heron Aguiar over 10 years ago

Hi all!!!

I also have this problem in Redmine 2.3.2.

My log:

C:\BitNami\redmine-2.3.2-0\apps\redmine\htdocs>rake -f Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com username=****@gmail.com password=**** port=993 ssl=1 project=p022 allow_override=project unknown_user=accept no_permission_check=1 --trace
  • Invoke redmine:email:receive_imap (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute redmine:email:receive_imap

rake aborted!
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/1.9.1/net/imap.rb:1439:in `connect'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/1.9.1/net/imap.rb:1439:in `start_tls_session'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/1.9.1/net/imap.rb:1036:in `initialize'
C:/BitNami/redmine-2.3.2-0/apps/redmine/htdocs/lib/redmine/imap.rb:29:in `new'
C:/BitNami/redmine-2.3.2-0/apps/redmine/htdocs/lib/redmine/imap.rb:29:in `check'
C:/BitNami/redmine-2.3.2-0/apps/redmine/htdocs/lib/tasks/email.rake:141:in `block (3 levels) in <top(required)>'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
C:/BitNami/redmine-2.3.2-0/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
C:/BitNami/redmine-2.3.2-0/ruby/bin/rake:23:in `load'
C:/BitNami/redmine-2.3.2-0/ruby/bin/rake:23:in `<main>'
Tasks: TOP => redmine:email:receive_imap


  • Gem list details...

Running the same command on an earlier version of Redmine (1.3.1) it works. But in version 2.3.2 it gives this error.
I checked the production.log file but don't have record this error.

Is there a solution for my problem?

Regards.

RE: Erro to receive e-mail from IMAP. - Added by Jonathan Sherry about 10 years ago

In migrating Bitnmai_Redmine from an old Mac Mini to a Windows 2008R2 VM, I ran into exactly the same error. I found the solution here:
http://community.bitnami.com/t/recieve-email-on-redmine-bitnami-stack-using-imap-and-google-mail-gives-error-ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificate-verify-failed/9381

I've re-produced the answer here for your convenience. *********
Create the file:
<installdir>/apps/redmine/htdocs/config/initializers/avoid_ssl_verification.rb

And add this content:

require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

You will also need to restart the apache service.

Hope this helps.
-jb

    (1-4/4)