5

我有一個VPS與Ubuntu 10.04。我打算安裝一個rails 3應用程序 如果我嘗試從終端測試sendmail命令,它的工作原理。sendmail:OpenSSL :: SSL :: SSLError:主機名不匹配

在我的應用程序,用於郵件,我都插在application.rb中的文件:

config.action_mailer.delivery_method = :sendmail 
    config.action_mailer.sendmail_settings = { 
     :location  => '/usr/sbin/sendmail', 
     :arguments  => '-i -t' 
    } 

但如果我嘗試與軌道發送一封電子郵件我收到此錯誤:

OpenSSL::SSL::SSLError: hostname was not match with the server certificate 
    from /opt/ruby/lib/ruby/1.8/openssl/ssl-internal.rb:123:in `post_connection_check' 

我能怎麼做?

感謝

回答

0

只需添加到您的enviroment.rb

module OpenSSL 
    module SSL 
    remove_const :VERIFY_PEER 
    end 
end 
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE 
相關問題