Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

SSL problem with SMTP in 2.2.2

#1491

When I try to send mail using SMTP in Rails 2.2.2 I get the following error (full trace attached):

hostname was not match with the server certificate

When I set the RAILS_GEM_VERSION to 2.2.0 in environment.rb the mail sends without problem.

Here are my smtp_settings:

ActionMailer::Base.smtp_settings = { :address => 'mail.514design.com', :port => 26, :domain => '514design.com', :user_name => 'xxxxxxx@514design.com', :password => 'xxxxxxxx', :authentication => 'login' }

Reported by rssaddict · November 28th, 2008 @ 03:49 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. rssaddict
    rssaddict

    Also, this post on the Slicehost forums seems to relate to the same bug:

    http://forum.slicehost.com/comme...

    November 28th, 2008 @ 03:51 PM

  2. Dan Ryan
    Dan Ryan

    You'll see this error if your mailserver has an SSL certificate set up for a hostname other than the one to which you are trying to connect. I was experiencing the same error, until I changed my smtp_settings to reflect the hostname of the associated SSL cert.

    November 29th, 2008 @ 03:44 AM

  3. Dan Ryan
    Dan Ryan

    Created a patch that adds an :ssl true/false option to the smtp_settings hash to toggle whether ssl is used. Defaults to true.

    November 29th, 2008 @ 04:26 AM

  4. Michael Koziarski
    Michael Koziarski

    Instead of == false, just use the unless !options[:ssl]

    That'll let people set it to nil, and is a little more readable.

    Also, there are no tests for this patch. You'd probably need to use mocha. Care to take a stab at those?

    November 29th, 2008 @ 12:27 PM

  5. Dan Ryan
    Dan Ryan

    I like that idea much better. I'll write tests for it and upload those soon

    November 29th, 2008 @ 01:50 PM

  6. Ken Liu
  7. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to resolved

    August 3rd, 2009 @ 02:28 PM