Rails 3, ActionMailer, and Google Apps for Domains (1)

Latest entry May 8, 2012

After upgrading my Redmine installation to Redmine 2 (the development branch) emails stopped being delivered.

I send emails through Google Apps for Domains, so I had the following in my configuration.yml (previously email.yml):

delivery_method: :smtp
smtp_settings:
  address: smtp.gmail.com
  port: 587
  domain: substancelab.com
  authentication: login
  user_name: "foobar@example.net"
  password: passw0rd
  tls: true

I am pretty sure it used to work before the upgrade, now; not so much.

Damn you, SSL

Alas, when I ran rake redmine:email:test I kept getting a

An error occurred while sending mail (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol)

What is TLS even?

I knew this has something to do with the TLS settings, but Google didn’t reveal any concrete, working advice. Adding enable_starttls_auto: true, which seems to be most prevalent solution didn’t change anything for me.

One or the other, but not both

Only after digging deep into ActionMailer and the Mail gem did I discover my problem.

Having tls: true in the settings was messing things up even if starttls_auto is enabled. Changing my settings to

delivery_method: :smtp
smtp_settings:
  address: smtp.gmail.com
  port: 587
  domain: substancelab.com
  authentication: login
  user_name: "foobar@example.net"
  password: passw0rd
  enable_starttls_auto: true

made my email delivery work again.

File this under “blogged so you don’t have to suffer as I did”.

Read the full entry, Software , 1 comments

Recent entry April 24, 2012

All lights are green (2)

Business, Substance Lab , 2 comments

Recent entry April 13, 2012

CSS, links, gradients, rounded corners, and IE (3)

Read the full entry, Browsers, Projects, Technology, Webdesign , 3 comments

Recent entry February 13, 2012

Fact-checking the 40% (0)

Read the full entry, Browsers, Games, Technology , 0 comments

Recent entry February 5, 2012

Flash is not the 99% (0)

Read the full entry, Browsers, Games, Technology , 0 comments

Recent entry January 2, 2012

Ruby SSL certificate verification errors (0)

Read the full entry, Programming, Technology , 0 comments

Archives

More entries in the archives »

Other people