rubyroyd blog

ar_mailer with action_mailer_optional_tls

I just stumbled upon the following problem:

1
2
3
4
5
6
7
8
9
10
11
12
ar_sendmail --batch-size 10 --delay 60 --max-age 0 --environment production \
--chdir /deployment/current
Unhandled exception wrong number of arguments (7 for 6)(ArgumentError):
/usr/local/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_sendmail.rb:408:in `start'
/usr/local/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_sendmail.rb:408:in `deliver'
/usr/local/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_sendmail.rb:500:in `run'
/usr/local/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_sendmail.rb:496:in `loop'
/usr/local/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_sendmail.rb:496:in `run'
/usr/local/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_sendmail.rb:340:in `run'
/usr/local/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/bin/ar_sendmail:5
/usr/local/bin/ar_sendmail:19:in `load'
/usr/local/bin/ar_sendmail:19

As I found out, both the ar_mailer and action_mailer_optional_tls have smtp_tls.rb and they are different. So ar_mailer includes it’s own tls file which doesn’t work. Solution was to copy vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb over to gems/ar_mailer-1.3.1/lib/smtp_tls.rb.

Post a comment


(lesstile enabled - surround code blocks with ---)

simple_captcha.jpg
(type the code from the image)