我已将服务器配置为通过专业的 Google 帐户发送邮件,使用 smtp.gmail.com 作为 Postfix 中继,但有些邮件在交付时被标记为垃圾邮件。这也取决于日期。有时,我会测试向我的专业帐户发送邮件,但确实会被阻止。但是,今天,它没有被标记为垃圾邮件。我如何才能减少或提高我的邮件不被标记为垃圾邮件的可能性?- 我曾考虑要求我的用户将我的域名列入白名单,但这似乎有点不专业,尽管我在收到的合法邮件中多次看到这种情况。
**** 更新 1:
这是已发送但未被标记为垃圾邮件的邮件的日志示例:
Dec 9 13:48:00 ns3106841 postfix/anvil[20199]: statistics: max connection rate 1/60s for (smtp:<my.server.ip.address>) at Dec 9 13:43:25
Dec 9 13:48:00 ns3106841 postfix/anvil[20199]: statistics: max connection count 1 for (smtp:<my.server.ip.address>) at Dec 9 13:43:25
Dec 9 13:48:00 ns3106841 postfix/anvil[20199]: statistics: max cache size 1 at Dec 9 13:43:25
Dec 9 13:48:53 ns3106841 postfix/pickup[20170]: C9B15202C7: uid=0 from=<root>
Dec 9 13:48:53 ns3106841 postfix/cleanup[20359]: C9B15202C7: message-id=<[email protected]>
Dec 9 13:48:53 ns3106841 postfix/qmgr[20171]: C9B15202C7: from=<[email protected]>, size=318, nrcpt=1 (queue active)
Dec 9 13:48:54 ns3106841 postfix/smtp[20361]: C9B15202C7: to=<[email protected]>, relay=smtp.gmail.com[108.177.15.109]:587, delay=1.1, delays=0.01/0.01/0.22/0.91, dsn=2.0.0, status=sent (250 2.0.0 OK 1575899334 i16sm13715549wmb.36 - gsmtp)
Dec 9 13:48:55 ns3106841 postfix/cleanup[20359]: F3F60202C8: message-id=<[email protected]>
Dec 9 13:48:55 ns3106841 postfix/bounce[20364]: C9B15202C7: sender delivery status notification: F3F60202C8
Dec 9 13:48:55 ns3106841 postfix/qmgr[20171]: F3F60202C8: from=<>, size=2269, nrcpt=1 (queue active)
Dec 9 13:48:55 ns3106841 postfix/qmgr[20171]: C9B15202C7: removed
Dec 9 13:48:56 ns3106841 postfix/smtp[20361]: F3F60202C8: to=<[email protected]>, relay=smtp.gmail.com[108.177.15.109]:587, delay=1.1, delays=0.01/0/0.19/0.86, dsn=2.0.0, status=sent (250 2.0.0 OK 1575899336 w17sm27693730wrt.89 - gsmtp)
Dec 9 13:48:56 ns3106841 postfix/qmgr[20171]: F3F60202C8: removed
Dec 9 13:48:56 ns3106841 postfix/smtpd[20365]: connect from mail-wm1-f44.google.com[209.85.128.44]
Dec 9 13:48:56 ns3106841 postfix/smtpd[20365]: NOQUEUE: reject: RCPT from mail-wm1-f44.google.com[209.85.128.44]: 454 4.7.1 <[email protected]>: Relay access denied; from=<> to=<[email protected]> proto=ESMTP
helo=<mail-wm1-f44.google.com>
Dec 9 13:48:56 ns3106841 postfix/smtpd[20365]: disconnect from mail-wm1-f44.google.com[209.85.128.44] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 quit=1 commands=5/7
**** 更新2:
我将 main.cf 中的“myorigin”更改为我的 FQDN - 到目前为止,拒绝消息不再出现,但是:
我收到了发送到我的邮件帐户的邮件,并且我注意到在我的 Exchange 服务器(Office365)上这些邮件被随机地拒绝了:
Reason: [{LED=550 4.3.2 QUEUE.TransportAgent; message deleted by transport agent};{MSG=};{FQDN=};{IP=};{LRT=}]
这是不一致的,因为有些电子邮件似乎被过滤为垃圾邮件,而一小时后的下一封邮件可能不会。
**** 更新 3:
主配置文件
myorigin = <server.FQDN>
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
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# 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 = <server.FQDN>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#myorigin = /etc/mailname
mydestination = <server.FQDN>, localhost.<server.FQDN>, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
smtp_connection_cache_on_demand = yes
smtp_connect_timeout = 20
smtp_helo_timeout = 40
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
inet_protocols = ipv4
#inet_interfaces = loopback-only
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
smtp_sasl_security_options = noanonymous