action_mailer_tls and Ruby 1.8.7

If you are using action_mailer_tls rails pluin and you shifted to Ruby 1.8.7, your app might break. I recently ran into this problem, coz my host providers shifted to Ruby 1.8.7 and I started getting errors when I was trying to send emails. The problem is because the check_auth_args function has changed in Ruby 1.8.7. Now it requires only 2 args as opposed to 3. The action_mailer_tls plugin uses this function but uses three arguments. So, to get back running again, make the following changes:

1).  Go to your action_mailer_tls plugin installation
2). Inside the do_start function, replace the call to "check_auth_args" with the following snippet:

 
no_args = method(:check_auth_args).arity
if no_args == 2
  check_auth_args user, secret if user or secret
else
  check_auth_args user, secret, authtype if user or secret
end
 
Bookmark and Share

4 Comments »

  1. Craig Jolicoeur Said,

    April 25, 2009 @ 6:35 pm

    Awesome, thanks so much. This helped me make a quick fix to my app.

  2. Arpan Said,

    June 15, 2009 @ 9:53 am

    Thanks. Got stuck in the same place and this was very helpful.

  3. brennan Said,

    August 11, 2009 @ 1:27 am

    Super helpful, thanks!

  4. chad/rubyrescue Said,

    November 18, 2009 @ 8:14 am

    Perfect just what was happening to us… thanks!

Leave a Comment