我在GCP VM上运行Debian 8。尝试使用Sendgrid SMTP服务发送带有postfix的电子邮件,但我收到了反弹,没有收到任何电子邮件。
我遵循了文档和说明,但不确定问题出在哪里......
我尝试使用apikey方法以及用户名/密码,但两者都没有用。
文档:https://cloud.google.com/compute/docs/tutorials/sending-mail/using-sendgrid
下面的Syslog消息
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配置
# 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
答案 0 :(得分:0)
如this article中所述,您可以运行以下命令以确保与SendGrid的SMTP中继之间存在连接。
telnet smtp.sendgrid.net 2525
另外,请访问this documentation,以获得有关Linux计算机上SendGrid的Postfix配置的一些提示。