Rails 4 Net :: SMTPAuthenticationError:535#5.7.0验证失败 [英] Rails 4 Net::SMTPAuthenticationError: 535 #5.7.0 Authentication failed

查看:694
本文介绍了Rails 4 Net :: SMTPAuthenticationError:535#5.7.0验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的大学建立一个学生组织的电子邮件清单。该组织拥有约6000名成员,并且为避免使用学校电子邮件服务器的许可,并为我创建了一个帐户。



我已经测试了帐户使用我的邮件客户端,一切似乎都正常工作,但是当我尝试通过我的 Rails 4 应用程序发送错误:

  Net :: SMTPAuthenticationError:535#5.7.0验证失败

我的配置如下:



application.rb

  config.action_mailer.smtp_settings = 
{
:address => smtp.school.edu,
:port => 25,
:enable_starttls_auto => true,
:user_name => account@school.edu,
:password => mypassword,
:authentication => 'login',
:domain => 'http://myapp.herokuapp.com/'
}

所有的都是正确的,我已经通过我的邮件客户端测试了,并且还坐下来与服务器管理员,以确认一切看起来正确的配置,只要端口和凭据。



我被告知smtp服务器是对公众开放,没有任何阻止连接,我们检查了他们的日志,甚至没有看到尝试从我的应用程序连接。



任何人都有任何线索,这里出了什么问题?有没有一些我不知道可以关闭的设置?

解决方案

尝试添加 openssl_verify_mode => none到您的操作邮件设置:

  config.action_mailer.smtp_settings = 
{
:address => smtp.school.edu,
:port => 25,
:enable_starttls_auto => true,
:user_name => account@school.edu,
:password => mypassword,
:authentication => 'login',
:domain => 'http://myapp.herokuapp.com/',
:openssl_verify_mode => 'none'
}

我们使用的是Rails 3,但这对我有用。我们的问题是我们的证书是自签名的,而Rails使用的库认为这是一个问题。
这是一个文章选项。


I'm building a email list for a student organization at my University. The organization has around 6000 members and to avoid costs I've received permission to use the schools emails servers and they have created an account for me.

I have tested the the account using my mail client and everything seems to be working fine, but when I try to send through my Rails 4 app I get the error:

Net::SMTPAuthenticationError: 535 #5.7.0 Authentication failed

I have it configured like so:

application.rb

config.action_mailer.smtp_settings = 
{
    :address   => "smtp.school.edu",
    :port      => 25, 
    :enable_starttls_auto => true, 
    :user_name => "account@school.edu",
    :password  => "mypassword", 
    :authentication => 'login',
    :domain => 'http://myapp.herokuapp.com/' 
}

Again the credentials are all correct, I have tested it through my mail client and have also sat down with the server admin to confirm everything looks right in my configuration as far as port and credentials.

I've been told the smtp server is "wide open to the public" and there is nothing blocking a connection and we have checked their logs and they haven't even seen an attempt to connect from my app.

Anyone have any clue what is going wrong here? Is there some setting I dont know about that could be off?

解决方案

Try adding openssl_verify_mode => 'none' to your action mailer settings:

config.action_mailer.smtp_settings = 
{
    :address   => "smtp.school.edu",
    :port      => 25, 
    :enable_starttls_auto => true, 
    :user_name => "account@school.edu",
    :password  => "mypassword", 
    :authentication => 'login',
    :domain => 'http://myapp.herokuapp.com/',
    :openssl_verify_mode => 'none'
}

Granted, we are using Rails 3, but this worked for me. The issue for us was that our certificates are self-signed and the library Rails uses considers that to be a problem. Here is an article that talks about the option.

这篇关于Rails 4 Net :: SMTPAuthenticationError:535#5.7.0验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆