gpt4 book ai didi

ruby-on-rails - :tls => true do in SMTP settings in Rails 5? 是什么意思

转载 作者:行者123 更新时间:2023-12-04 10:24:00 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





How do I set the SSL protocol needed for ActionMailer to use a TLS connection?

(2 个回答)


2年前关闭。




我在 Rails 5.2 应用程序上使用 Sendgrid 并且得到了Net::ReadTimeout尝试发送电子邮件时出错。这里的帖子
https://github.com/mikel/mail/issues/639#issuecomment-29016055建议添加:tls => true到 SMTP 设置。这行得通,但它似乎是一个旧的解决方案,我想了解它在做什么以及它为什么起作用。

这是我的 SMTP 设置,它给出了 Net::ReadTimeout错误:

ActionMailer::Base.smtp_settings = {
:user_name => 'username',
:password => 'password',
:domain => 'mydomain.com',
:address => 'smtp.sendgrid.net',
:port => 465,
:authentication => :plain,
:enable_starttls_auto => true
}

这是正在运行的更新。
ActionMailer::Base.smtp_settings = {
:user_name => 'username',
:password => 'password',
:domain => 'mydomain.com',
:address => 'smtp.sendgrid.net',
:port => 465,
:authentication => :plain,
:enable_starttls_auto => true,
# this line added
:tls => true
}

最佳答案

Email is effectively a plaintext communication sent from email clients to receiving email servers or from one server to another. This design limitation leaves the content of a message in transit open for anyone to eavesdrop; from a wireless hotspot at the airport or coffee shop to your ISP and internet backbone providers that carry your messages throughout the world.

Transport Layer Security (TLS) helps solve this issue by offering encryption technology for your message while it is “in transit” from one secure email server to another. That is, TLS helps prevent eavesdropping on email as it is carried between email servers that have enabled TLS protections for email. Just as TLS can be used to secure web communications (HTTPS), it can secure email transport. In both applications, TLS has similar strengths and weaknesses. To maximize the content security and privacy, TLS is required between all the servers that handle the message including hops between internal and external servers.

Key features of TLS includes:

  • Encrypted messages: TLS uses Public Key Infrastructure (PKI) to encrypt messages from mail server to mail server. This encryption makes it more difficult for hackers to intercept and read messages.

  • Authentication: TLS supports the use of digital certificates to authenticate the receiving servers. Authentication of sending servers is optional. This process verifies that the receivers (or senders) are who they say they are, which helps to prevent spoofing.



For reference

关于ruby-on-rails - :tls => true do in SMTP settings in Rails 5? 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60710396/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com