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

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

问题描述

我正在为我所在大学的一个学生组织建立一个电子邮件列表.该组织有大约 6000 名成员,为了避免费用,我获得了使用学校电子邮件服务器的许可,他们为我创建了一个帐户.

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.

我已经使用我的邮件客户端测试了该帐户,一切似乎都运行良好,但是当我尝试通过我的 Rails 4 应用程序发送时,出现错误:

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

我是这样配置的:

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.

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

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?

推荐答案

尝试添加 openssl_verify_mode =>'无' 到您的操作邮件程序设置:

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'
}

当然,我们正在使用 Rails 3,但这对我有用.我们的问题是我们的证书是自签名的,Rails 使用的库认为这是一个问题.这是一篇关于该选项的文章.

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天全站免登陆