Defect #1598
closedr1643 broke action_mailer_optional_tls
100%
Description
Hi,
I am tracking the trunk and have just upgraded my redmine installation to r1643.
After upgrading from r1410 (and reinstalling this plugin of course), gmail smtp support no longer works. I was using the solution from here: http://douglasfshearer.com/blog/gmail-smtp-with-ruby-on-rails-and-actionmailer and it has been working fine when I was still in r1410.
I noted that it is necessary to place the smtp settings in a separate file named email.yml under the config folder and I have done just that. However, the same error occurs even after restarting the redmine instance.
The error message I get when sending a test mail is "An error occurred while sending mail (wrong number of arguments (3 for 2))".
Hope you can look into it.
Thank you.
       Updated by Jean-Philippe Lang over 17 years ago
      Updated by Jean-Philippe Lang over 17 years ago
      
    
    redmine.org runs latest trunk and uses gmail + action_mailer_optional_tls.
Could you post your email.yml ?
       Updated by Victor Palma over 17 years ago
      Updated by Victor Palma over 17 years ago
      
    
    I'm running version 0.7.3 and it works fine. You might need to install the plugin again i ran the following command and it worked for me.
 ./script/plugin install http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tl again.
Regards
       Updated by Burt Culver over 17 years ago
      Updated by Burt Culver over 17 years ago
      
    
    Hi,
I am on the tip of the trunk as well and tried reinstalling action_mailer_optional_tls as suggested but still get the "An error occurred while sending mail (wrong number of arguments (3 for 2))" error.
rails 2.1.0
ruby 1.8.7
gem 1.2.0
My email.yml file:
production:
  delivery_method: :smtp
  smtp_settings:
    address: smtp.google.com
    port: 587
    domain: example.com
    authentication: :login
    user_name: redmine@example.com
    password: XXXXX
    tls: true
Thanks for any help.
Burt
       Updated by Calvin Cheng over 17 years ago
      Updated by Calvin Cheng over 17 years ago
      
    
    Burt Culver wrote:
Hi,
I am on the tip of the trunk as well and tried reinstalling action_mailer_optional_tls as suggested but still get the "An error occurred while sending mail (wrong number of arguments (3 for 2))" error.
rails 2.1.0
ruby 1.8.7
gem 1.2.0My email.yml file:
production:
delivery_method: :smtp
smtp_settings:
address: smtp.google.com
port: 587
domain: example.com
authentication: :login
user_name: redmine@example.com
password: XXXXX
tls: trueThanks for any help.
Burt
Hi,
My versions are similar:
rails 2.1.0
ruby 1.8.7
gem 1.2.0
I have tried using Burt's email settings above as well and instead of authentication: :login, I also tried out authentication: :plain. Both gave the same error.
       Updated by Burt Culver over 17 years ago
      Updated by Burt Culver over 17 years ago
      
    
    I added a raise of the error to app/controllers/admin_controller.rb in order to get a stack trace. Here it is:
ArgumentError (wrong number of arguments (3 for 2)):
    /vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb:33:in `check_auth_args'
    /vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb:33:in `do_tls_start'
    /vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb:18:in `send'
    /vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb:18:in `start'
    /vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb:10:in `start'
    /vendor/plugins/action_mailer_optional_tls/lib/action_mailer_tls.rb:9:in `perform_delivery_smtp'
    /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/action_mailer/base.rb:508:in `__send__'
    /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/action_mailer/base.rb:508:in `deliver!'
    /app/models/mailer.rb:154:in `deliver!'
    /usr/local/lib/ruby/gems/1.8/gems/actionmailer-2.1.0/lib/action_mailer/base.rb:383:in `method_missing'
    /app/controllers/admin_controller.rb:68:in `test_email'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in `process_client'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `process_client'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
    /usr/local/bin/mongrel_rails:19:in `load'
    /usr/local/bin/mongrel_rails:19
       Updated by Burt Culver over 17 years ago
      Updated by Burt Culver over 17 years ago
      
    
    removing authtype from the call to check_auth_args on line 33 of vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb fixes the problem. Looks like a bug in action_mailer_optional_tls rather than redmine.
Looks like Net::SMTP changed the function signature for check_auth_args. Bad programmer - no red bull for you.
Burt
       Updated by Calvin Cheng over 17 years ago
      Updated by Calvin Cheng over 17 years ago
      
    
    Perfect!
Thanks for the solution Burt.
       Updated by Calvin Cheng over 17 years ago
      Updated by Calvin Cheng over 17 years ago
      
    
    - Status changed from New to Resolved
- % Done changed from 0 to 100
       Updated by Jean-Philippe Lang over 17 years ago
      Updated by Jean-Philippe Lang over 17 years ago
      
    
    - Status changed from Resolved to Closed
- Affected version (unused) deleted (devel)