Erro to receive e-mail from IMAP.
Added by Targino Silveira over 11 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=xxxxx@host.com 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 11 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 11 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 about 11 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...Gem list details...
actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
ansi (1.4.3)
arel (3.0.2)
aws-sdk (1.8.3.1)
bcrypt-ruby (3.0.1 x86-mingw32)
bigdecimal (1.1.0)
bluecloth (2.1.0 x86-mingw32)
builder (3.0.0)
bundler (1.3.5)
coderay (1.0.9)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
crack (0.3.1)
daemons (1.1.8)
diff-lcs (1.1.3)
erubis (2.7.0)
eventmachine (1.0.0 x86-mingw32)
execjs (1.4.0)
fastercsv (1.5.4)
hike (1.2.1)
hoe (3.0.6)
hpricot (0.8.5)
httparty (0.8.3)
i18n (0.6.1)
io-console (0.3)
journey (1.0.4)
jquery-rails (2.1.3, 2.0.3)
json (1.7.7, 1.5.4)
mail (2.5.3)
metaclass (0.0.1)
mime-types (1.19, 1.18)
mini_magick (3.4)
mini_portile (0.3.0)
minitest (2.5.1)
mocha (0.12.3)
multi_json (1.3.6)
multi_xml (0.5.1)
mustache (0.99.4)
mysql2 (0.3.11 x86-mingw32, 0.2.18)
net-ldap (0.3.1)
nokogiri (1.5.5 x86-mingw32, 1.4.7 x86-mingw32)
polyglot (0.3.3)
prototype-rails (3.2.1)
rack (1.4.5)
rack-cache (1.2)
rack-mount (0.8.3)
rack-openid (1.3.1)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.13)
railties (3.2.13)
rake (0.9.2.2)
rake-compiler (0.8.1)
rdiscount (1.6.8)
rdoc (3.12, 3.9.4)
RedCloth (4.2.9 x86-mingw32)
rmagick (2.13.1)
ronn (0.7.3)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.2)
rspec-mocks (2.11.1)
ruby-openid (2.1.8)
rubygems-update (1.8.24)
rvm (1.11.3.5)
sass (3.1.20)
sass-rails (3.2.5)
sprockets (2.4.5, 2.2.1, 2.1.3, 2.1.2)
sqlite3 (1.3.6 x86-mingw32)
sqlite3-ruby (1.3.2 x86-mingw32)
subexec (0.2.2)
test-unit (2.5.2)
thin (1.3.1)
thor (0.15.4, 0.14.6)
tilt (1.3.3)
treetop (1.4.10)
turn (0.9.6)
tzinfo (0.3.33)
uglifier (1.2.6)
uuidtools (2.1.3)
yard (0.8.1)
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 almost 11 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
Hope this helps.
-jb