Discussion: Lecture 11

November 13th, 2009 Leave a comment Go to comments

Add comments here with questions and notes regarding Lecture 11.

  1. Peter H
    December 13th, 2009 at 11:21 | #1

    I went through the screencast from last year on the gmail receiving. It seemed that the tls separate library is now built into 1.9 so it's not necessary. However, I couldn't get it to work.

    In the IncomingBookHandler check_mail method, the initialization

    imap = Net::IMAP.new(IMAP_SETTINGS[:host], IMAP_SETTINGS[:port], true)

    returns a "SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify fialed (OpenSSL::SSL::SSLError) ...from imap.rb1320 in 'start_tls_session'

    I'm apparently not the first as there is a lot of stuff online describing difference of Ruby 1.8 and 1.9 but couln't find an obvious solution.

    I was wondering if anyone else has run into this?

  2. December 13th, 2009 at 14:33 | #2

    @Peter H

    I just tried it under Ruby 1.9.1, and it seems to work fine - I received an e-mail with no problem (at least I was able to dump out the subject).

    Double-check your settings. Here's what mine look like (in environments/development.rb):

    config.action_mailer.perform_deliveries = true
    config.action_mailer.raise_delivery_errors = true
    config.action_mailer.default_charset = 'utf-8'
    config.action_mailer.delivery_method = :smtp
    
    config.action_mailer.smtp_settings = {
      :address        => 'smtp.gmail.com',
      :port           => 587,
      :authentication => :plain,
      :enable_starttls_auto => true,
      :user_name      => 'john.g.norman@gmail.com',
      :password       => 'PASSWORD'
    }
    
    config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
    
    IMAP_SETTINGS = {
      :host => 'imap.gmail.com',
      :port => 993,
      :user => 'john.g.norman@gmail.com',
      :password => 'PASSWORD'
    }
    
  1. No trackbacks yet.