History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CCRB-187
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Michael Kintzer
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
CruiseControl.rb

smtp_tls.rb incompatible with ruby 1.8.7

Created: 30/Sep/08 05:59 PM   Updated: 18/Dec/09 05:27 AM
Component/s: Builder
Affects Version/s: 1.3
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment:
ruby 1.8.7 (2008-08-11 patchlevel 72) [powerpc-darwin9]


 Description  « Hide
Configured the ActionMailer::Base.smtp_settings in site_config.rb to use authentication against a TLS SMTP. When build failed, the email plugin reported this error:
  wrong number of arguments (3 for 2) at ./script/../config/../lib/smtp_tls.rb:7:in `check_auth_args'

After some digging into net/smtp.rb in my Ruby distro, I patched smtp_tls.rb:7 as follows:
  > authenticate user, secret, authtype if user or secret
  ---
  < check_auth_args user, secret, authtype if user or secret

The 'wrong number of args...' error went away, but then received:
    undefined method `writeline' for nil:NilClass at /opt/local/lib/ruby/1.8/net/smtp.rb:904:in `get_response'

It looks like the email plugin is not compatible with the net/smtp.rb in Ruby 1.8.7.

 All   Comments   Work Log   Change History      Sort Order:
Michael Kintzer [16/Oct/08 06:20 PM]
I was able to resolve this with the following workaround:

1. remove lib/smtp_tls.rb
2. install the action_mailer_optional_tls plugin from:

script/plugin install http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tls

3. edit vendor/plugin/action_mailer_optional_tls/lib/smtp_tls.rb and change line 33:

# check_auth_args user, secret, authtype if user or secret
    check_auth_args user, secret if user or secret # Ruby 1.8.7 FIX

4. restart cruise

Michael Kintzer [16/Oct/08 06:26 PM]
Forgot to mention that you need to add:

:tls => "true"

to

 ActionMailer::Base.smtp_settings = {
   :tls => "true",
  ...
 }

in ./cruise/site_config.rb

Artem Vasiliev [18/Dec/09 05:27 AM]
Thanks Michael, this solved my issue perfectly too.
Small update: now action_mailer_optional_tls plugin is at http://github.com/collectiveidea/action_mailer_optional_tls, and it doesn't need patching.