Error on fetch with IMAP without SSL
maiconzucco opened this issue · 2 comments
Hi,
I configured the plugin whit IMAP on port 143 without SSL and received the error below:
bitnami@tijuca:/opt/bitnami/apps/redmine/htdocs$ rake redmine:plugins:email_fetcher:fetch_all_emails RAILS_ENV=production
'
Loading Rails environment for Resque
rake aborted!
SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol
/opt/bitnami/apps/redmine/htdocs/lib/redmine/imap.rb:29:innew' /opt/bitnami/apps/redmine/htdocs/lib/redmine/imap.rb:29:in
check'
/opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/app/models/email_fetches.rb:91:infetch_emails' /opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/app/models/email_fetches.rb:7:in
test_and_fetch_emails'
/opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/app/models/email_configuration.rb:44:inblock in fetch_all_emails' /opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/app/models/email_configuration.rb:43:in
fetch_all_emails'
/opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/lib/tasks/email_fetcher.rake:15:inblock (4 levels) in <top (required)>' Tasks: TOP => redmine:plugins:email_fetcher:fetch_all_emails (See full trace by running task with --trace) bitnami@tijuca:/opt/bitnami/apps/redmine/htdocs$ rake redmine:plugins:email_fetcher:fetch_all_emails RAILS_ENV=production --trace Loading Rails environment for Resque ** Invoke redmine:plugins:email_fetcher:fetch_all_emails (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute redmine:plugins:email_fetcher:fetch_all_emails rake aborted! SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol /opt/bitnami/ruby/lib/ruby/1.9.1/net/imap.rb:1439:in
connect'
/opt/bitnami/ruby/lib/ruby/1.9.1/net/imap.rb:1439:instart_tls_session' /opt/bitnami/ruby/lib/ruby/1.9.1/net/imap.rb:1036:in
initialize'
/opt/bitnami/apps/redmine/htdocs/lib/redmine/imap.rb:29:innew' /opt/bitnami/apps/redmine/htdocs/lib/redmine/imap.rb:29:in
check'
/opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/app/models/email_fetches.rb:91:infetch_emails' /opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/app/models/email_fetches.rb:7:in
test_and_fetch_emails'
/opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/app/models/email_configuration.rb:44:inblock in fetch_all_emails' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/relation/delegation.rb:6:in
each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/activerecord-3.2.19/lib/active_record/relation/delegation.rb:6:ineach' /opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/app/models/email_configuration.rb:43:in
fetch_all_emails'
/opt/bitnami/apps/redmine/htdocs/plugins/redmine_email_fetcher/lib/tasks/email_fetcher.rake:15:inblock (4 levels) in <top (required)>' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in
call'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:inblock in execute' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in
each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:inexecute' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in
block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/1.9.1/monitor.rb:211:inmon_synchronize' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in
invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:ininvoke' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in
invoke_task'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:inblock (2 levels) in top_level' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in
each'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:inblock in top_level' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in
run_with_threads'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:intop_level' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in
block in run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:instandard_exception_handling' /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in
run'
/opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in<top (required)>' /opt/bitnami/ruby/bin/rake:23:in
load'
/opt/bitnami/ruby/bin/rake:23:in `
Tasks: TOP => redmine:plugins:email_fetcher:fetch_all_emails
Below my configuration:
id: 1
configuration_type: imap
host: 127.0.0.1
port: 143
ssl: 0
username: my_user
password: my_pass
folder: INBOX
move_on_success:
move_on_failure:
delete_unprocessed: 0
apop: 0
unknown_user: create
no_account_notice: 1
no_permission_check: 1
default_group:
project_id: 2
tracker_id: 3
category:
priority:
allow_override: priority
last_fetch_at:
flg_active: 1
Any idea?
Thanks.
@maiconzucco , from the log I can tell that the problem is happening in Redmine imap library, probably due to an issue I found (and corrected) in my code.
If after updating the code the error persists, and since this specific error can be caused by various reasons, send me the output of each of these commands in rails console:
require 'net/imap' (optional)
host = '127.0.0.1'
port = '143'
ssl = 0
folder = 'INBOX'
imap = Net::IMAP.new(host, port, ssl)
imap.login('my_user', 'my_pass')
imap.select(folder)
Thanks a lot!