Postfix SMTP中继服务器

我使用Gmail从我的Gmail地址和我自己的域名接收电子邮件,但是Gmail不再允许您从自己的域名发送电子邮件,除非您提供自己的SMTP服务器通过发送。

因此,我正在尝试在Ubuntu服务器上configurationPostfix,以将来自任何远程设备的电子邮件转发到电子邮件上的目标电子邮件地址。 我只希望服务器从mydomain中继电子邮件(只有在经过身份validation的情况下),并且不要在用户邮箱中保留服务器上的任何电子邮件。

目前,我已经能够从一个特定的源地址转发电子邮件,但是发送到Gmail地址的电子邮件在中继时被反弹。 如果我从服务器本身使用sendmail,gmail不会反弹,certificategmail很乐意从我的服务器收到电子邮件。 但是当电子邮件被中继时,我从gmail收到以下消息:

status=bounced (host gmail-smtp-in.l.google.com[2a00:1450:400c:c00::1a] said: 550-5.7.1 [2001:41d0:a:f9a0::1 12] Our system has detected that this 550-5.7.1 message is likely unsolicited mail. To reduce the amount of spam sent 550-5.7.1 to Gmail, this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. n6si25532296wjy.39 - gsmtp (in reply to end of DATA command)) 

我也尝试使用标题检查去除所有显示该电子邮件是从另一个客户端到达服务器之前的头。 但是这并没有帮助。

我发现的大部分信息是关于通过gmail传递我不想做的所有电子邮件。 我只是服务器,作为最终的MTA,将电子邮件直接发送到收件人的邮件服务器,而不被视为垃圾邮件。

我目前的后缀configuration:

 # 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 (Ubuntu) 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 = {@mydomain.com} alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = {@mydomain.com}, {server_hostname}, localhost relayhost = mynetworks = {my_ip_address} 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all # Strip received from headers to hide original remote client address mime_header_checks = regexp:/etc/postfix/header_checks header_checks = regexp:/etc/postfix/header_checks smtp_header_checks = regexp:/etc/postfix/header_checks 

几乎肯定会遇到不匹配的DNS条目。 在使用IPv6传输的情况下,AAAA和PTRlogging必须匹配MTA的源地址,并且与您声称的EHLO名称相匹配。