首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用Sendgrid - sender未送达通知在GCP Google Cloud VM上获取Postfix退回

使用Sendgrid - sender未送达通知在GCP Google Cloud VM上获取Postfix退回
EN

Stack Overflow用户
提问于 2018-05-05 07:44:36
回答 1查看 454关注 0票数 -1

我在GCP VM上运行Debian 8。尝试使用Sendgrid SMTP服务发送带有postfix的电子邮件,但收到退回消息,并且所有电子邮件都无法送达。

我遵循了文档和说明,但不确定问题出在哪里...

我尝试使用apikey方法和用户名/密码,但两者都不起作用。

文档:https://cloud.google.com/compute/docs/tutorials/sending-mail/using-sendgrid

下面的系统日志消息

代码语言:javascript
复制
May  4 23:30:20 elegant-dxlhoa-logintry-vm systemd[1]: Stopping System Logging Service...
May  4 23:30:20 elegant-dxlhoa-logintry-vm systemd[1]: Starting System Logging Service...
May  4 23:30:20 elegant-dxlhoa-logintry-vm systemd[1]: Started System Logging Service.
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/pickup[4953]: 9F834A0CF7: uid=0 from=<root@elegant-dxlhoa-logintry-vm.c.elegant-dxl-dream.internal>
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/cleanup[4976]: 9F834A0CF7: message-id=<20180504233031.9F834A0CF7@dxlhoa-vm.c.dxl-dream.internal>
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/qmgr[4954]: 9F834A0CF7: from=<root@elegant-dxlhoa-logintry-vm.c.elegant-dxl-dream.internal>, size=428, nrcpt=1 (queue active)
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/error[4978]: 9F834A0CF7: to=<ctg.cloudtechguy@gmail.com>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.0.0, status=bounced ([smtp.sendgrid.net]:2525)
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/cleanup[4976]: A1BA6A0D0A: message-id=<20180504233031.A1BA6A0D0A@dxlhoa-vm.c.dxl-dream.internal>
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/bounce[4980]: 9F834A0CF7: sender non-delivery notification: A1BA6A0D0A
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/qmgr[4954]: 9F834A0CF7: removed
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/qmgr[4954]: A1BA6A0D0A: from=<>, size=2434, nrcpt=1 (queue active)
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/error[4978]: A1BA6A0D0A: to=<root@elegant-dxlhoa-logintry-vm.c.elegant-dxl-dream.internal>, relay=none, delay=0.02, delays=0/0/0/0.02, dsn=5.0.0, status=bounced ([smtp.sendgrid.net]:2525)
May  4 23:30:31 elegant-dxlhoa-logintry-vm postfix/qmgr[4954]: A1BA6A0D0A: removed
?Starting                                                                                              289,56        Bot

下面的Main.cf配置

代码语言:javascript
复制
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = dxlhoa-vm.c.dxl-dream.internal
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = dxlhoa-vm.c.dxl-dream.internal, localhost.c.dxl-dream.internal, , localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
relayhost = [smtp.sendgrid.net]:2525
mtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
default_transport = error
relay_transport = error
smtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
header_size_limit = 4096000
smtp_sasl_security_options = noanonymous
bounce_template_file = /etc/postfix/bounce.cf

如果有人能帮上忙我会很感激,

感谢TP

EN

回答 1

Stack Overflow用户

发布于 2018-06-21 08:03:39

this article中所述,您可以运行以下命令来确保连接到SendGrid的SMTP中继。

代码语言:javascript
复制
telnet smtp.sendgrid.net 2525

此外,还可以访问this documentation获取在Linux机器上为SendGrid配置后缀的一些技巧。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50184347

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档