Pyramid_exclog : SMTPAuthenticationError: (530, 'Must issue a STARTTLS command first')
Pyramid_exclog : SMTPAuthenticationError: (530, 'Must issue a STARTTLS command first')
我正在使用 pyramid_exclog 记录异常并将这些异常作为电子邮件发送。我正在使用 Amazon aws SMTP 发送电子邮件。但我收到以下错误:
SMTPAuthenticationError: (530, 'Must issue a STARTTLS command first')
这是我使用的代码:
[handler_email_exc_handler]
class = handlers.SMTPHandler
args = (('email-smtp.us-east-1.amazonaws.com', 587), 'no-reply@company.com', ['me@company.com'], 'Company Exception' ,('<username>','<user_key>'),None)
level = ERROR
formatter = exc_formatter
据我所知,aws 凭据没有任何问题,因为我使用它们通过 Thunderbird 发送邮件。
这不是凭据,至少根据此错误消息不是。您正在尝试在不使用 TLS 的情况下与 SES 进行 SMTP 通信——您正在尝试通过未加密的连接验证您自己的身份。这不安全,因为它可能会导致您的凭据泄露,因此不受支持。
The Amazon SES SMTP endpoint requires that all connections be encrypted using Transport Layer Security (TLS). (Note that TLS is often referred to by the name of its predecessor protocol, SSL.) Amazon SES supports two mechanisms for establishing a TLS-encrypted connection: STARTTLS and TLS Wrapper. Check the documentation for your software to determine whether it supports STARTTLS, TLS Wrapper, or both.
If your software does not support STARTTLS or TLS Wrapper, you can use the open source stunnel program to set up an encrypted connection (called a "secure tunnel"), then use the secure tunnel to connect to the Amazon SES SMTP endpoint.
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
我不是 Python 人,但对 Google 机器的快速检查表明:
To specify the use of a secure protocol (TLS), pass in a tuple to the secure argument. This will only be used when authentication credentials are supplied. The tuple should be either an empty tuple, or a single-value tuple with the name of a keyfile, or a 2-value tuple with the names of the keyfile and certificate file. (This tuple is passed to the smtplib.SMTP.starttls() method.)
啊哈,它甚至提到 "starttls."
如果我找到了正确的参考,也许你的最后一个参数应该是 ()
而不是 None
,因为你不需要密钥文件或证书文件。
我正在使用 pyramid_exclog 记录异常并将这些异常作为电子邮件发送。我正在使用 Amazon aws SMTP 发送电子邮件。但我收到以下错误:
SMTPAuthenticationError: (530, 'Must issue a STARTTLS command first')
这是我使用的代码:
[handler_email_exc_handler]
class = handlers.SMTPHandler
args = (('email-smtp.us-east-1.amazonaws.com', 587), 'no-reply@company.com', ['me@company.com'], 'Company Exception' ,('<username>','<user_key>'),None)
level = ERROR
formatter = exc_formatter
据我所知,aws 凭据没有任何问题,因为我使用它们通过 Thunderbird 发送邮件。
这不是凭据,至少根据此错误消息不是。您正在尝试在不使用 TLS 的情况下与 SES 进行 SMTP 通信——您正在尝试通过未加密的连接验证您自己的身份。这不安全,因为它可能会导致您的凭据泄露,因此不受支持。
The Amazon SES SMTP endpoint requires that all connections be encrypted using Transport Layer Security (TLS). (Note that TLS is often referred to by the name of its predecessor protocol, SSL.) Amazon SES supports two mechanisms for establishing a TLS-encrypted connection: STARTTLS and TLS Wrapper. Check the documentation for your software to determine whether it supports STARTTLS, TLS Wrapper, or both.
If your software does not support STARTTLS or TLS Wrapper, you can use the open source stunnel program to set up an encrypted connection (called a "secure tunnel"), then use the secure tunnel to connect to the Amazon SES SMTP endpoint.
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
我不是 Python 人,但对 Google 机器的快速检查表明:
To specify the use of a secure protocol (TLS), pass in a tuple to the secure argument. This will only be used when authentication credentials are supplied. The tuple should be either an empty tuple, or a single-value tuple with the name of a keyfile, or a 2-value tuple with the names of the keyfile and certificate file. (This tuple is passed to the smtplib.SMTP.starttls() method.)
啊哈,它甚至提到 "starttls."
如果我找到了正确的参考,也许你的最后一个参数应该是 ()
而不是 None
,因为你不需要密钥文件或证书文件。