编辑
让我们忽略一下我写下的所有内容,然后重新提出问题:如果您有自己的域名,并且想要将该域名的电子邮件发送到Gmail收件箱(而不是Google Apps),那么您将如何执行此操作? 最好只使用SMTP,而不使用POP3。
原文问题:
amedee.be 。 大多数电子邮件到达都很好,这与ServerFaultbuild议的“类似问题”不同,它只是全部或全部。 但更多的时候比我想(约20),我得到这在/var/log/mail.log :
Nov 30 15:01:39 ip-172-31-51-67 postfix/smtp[29724]: 4B72563149: to=<amedee.vangasse@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.22.26]:25, delay=2657, delays=2657/0.2/0.07/0.18, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[74.125.22.26] said: 550-5.7.1 [52.0.177.1037] Our system has detected that this message is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please visit 550 5.7.1 https://support.google.com/mail/answer/188131 for more information. y66si45484104qhc.73 - gsmtp (in reply to end of DATA command))
我已经证实,这绝对不是垃圾邮件。 当相同的邮件直接发送到Gmail,它到达。
我不知道这是不是巧合,但是当我将服务器从Hetzner移到AWS时,我开始注意到这一点。 我一直在使用这个设置几年,只是在过去的两个月,电子邮件迷路了。 奇怪的是,我的新老服务器上的Postfix和Procmailconfiguration是相同的。
其他相关的问题提到了DKIM和SPF,我将要去调查这些字母的意思,但是过去我没有用过它,它起作用,所以首先我想排除其他明显的原因。
/etc/postfix/main.cf
alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases append_dot_mydomain = no biff = no body_checks = regexp:/etc/postfix/checks/body_checks broken_sasl_auth_clients = yes disable_vrfy_command = yes header_checks = regexp:/etc/postfix/checks/header_checks home_mailbox = Maildir/ inet_interfaces = all inet_protocols = ipv4 local_destination_concurrency_limit = 1 mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 # If you can't deliver it in two hours - it can't be delivered! #bounce_queue_lifetime = 2h #maximal_queue_lifetime = 3h #queue_run_delay = 3m #minimal_backoff_time = 5m #maximal_backoff_time = 10m message_size_limit = 0 mime_header_checks = regexp:/etc/postfix/checks/mime_header_checks mydestination = styx, styx.amedee.be, ip-172-31-51-67.ec2.internal, localhost.ec2.internal, localhost, intrepid, intrepid.exabyte.be, intrepid.amedee.be, mail.amedee.be, mx.amedee.be, localhost.localdomain, localhost.amedee.be, amedee.be, amed.ee, vangasse.eu, vangas.se, dhertefelt.be, dhertefe.lt, pcrobots.amedee.be, nowww.be mydomain = amedee.be myhostname = styx.amedee.be mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/8 myorigin = /etc/mailname readme_directory = no recipient_delimiter = - relayhost = smtp_destination_concurrency_limit = 1 smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name. All Your Spam Are Belong To Us! smtpd_client_connection_count_limit = 5 smtpd_client_restrictions = # reject_invalid_hostname, permit smtpd_error_sleep_time = 10 smtpd_hard_error_limit = 5 smtpd_helo_required = yes smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, # reject_invalid_hostname, permit smtpd_junk_command_limit = 3 smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, # reject_invalid_hostname, reject_multi_recipient_bounce, reject_non_fqdn_recipient, # reject_non_fqdn_sender, reject_unauth_destination, reject_unauth_pipelining, reject_unknown_recipient_domain, reject_unlisted_recipient, permit smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination #smtpd_sasl_auth_enable = yes #smtpd_sasl_local_domain = $myhostname #smtpd_sasl_path = private/auth #smtpd_sasl_security_options = noanonymous #smtpd_sasl_type = dovecot smtpd_sender_restrictions = # reject_unknown_sender_domain, permit smtpd_soft_error_limit = 2 smtpd_timeout = 120 smtpd_tls_cert_file = /etc/postfix/tls/mail.cert smtpd_tls_key_file = /etc/postfix/tls/mail.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes #virtual_alias_domains = /etc/postfix/maps/virtual_alias_domains virtual_alias_maps = hash:/etc/postfix/maps/virtual_alias_maps
/etc/postfix/master.cf
smtp inet n - - - - smtpd -o content_filter=spamassassin submission inet n - - - - smtpd -o content_filter=spamassassin pickup unix n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr unix n - n 300 1 qmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp relay unix - - - - - smtp showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache maildrop unix - nn - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} uucp unix - nn - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - nn - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - nn - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix - nn - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} mailman unix - nn - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} spamassassin unix - nn - - pipe user=debian-spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
/home/amedee/.procmailrc
UMASK=007 PATH=/usr/bin:/usr/local/bin MAILDIR=$HOME/Maildir LOGFILE=$HOME/log/procmail.log SHELL=/bin/bash VERBOSE=no SED=/bin/sed SENDER=`formail -c -x Return-Path` SENDMAILFLAGS="-oi -f $SENDER" [email protected] #From the manpages: prevent duplicate mails :0 Wh: msgid.lock | formail -D 8192 msgid.cache :0 * ^Subject: Undelivered Mail Returned to Sender /dev/null :0 * .* ! $GMAIL
我的问题:我需要做什么才能使Gmail不会再popup我转发的合法电子邮件?
编辑:有人标记我的问题作为这个问题的重复: 如何发送电子邮件,并避免他们被列为垃圾邮件? 但是,我的问题不是关于发送电子邮件作为原始发件人,我的问题是关于转发别人发送的电子邮件。 在我发布我的问题2分钟之后,还没有完成标记,所以我认为这是一个对angular线阅读的情况。 不要感到不好,我们都希望得到StackExchange的声望。
我将继续编辑这个问题,因为我从疑似重复的地方处理每个点,直到我毫无疑问地certificate它不是重复的。
编辑:DNSconfiguration:
* 300 IN A 52.0.177.103 @ 300 IN A 52.0.177.103 styx 300 IN A 52.0.177.103 @ 300 IN MX 1 styx.amedee.be. @ 300 IN SPF "v=spf1 ip4:52.0.177.103 ptr ?all" @ 300 IN TXT "v=spf1 ip4:52.0.177.103 ptr ?all"
编辑:根据mxtoolbox.com,我的反向DNS不匹配我的SMTP横幅。 所以我在/etc/postfix/main.cf更改了我的SMTP横幅:
#smtpd_banner = $myhostname ESMTP $mail_name. All Your Spam Are Belong To Us! smtpd_banner = ec2-52-0-177-103.compute-1.amazonaws.com
并确认Postfix重新加载后的变化:
admin@ip-172-31-51-67:~$ telnet 127.0.0.1 25 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. 220 ec2-52-0-177-103.compute-1.amazonaws.com quit 221 2.0.0 Bye Connection closed by foreign host.
所以,据我所知, 52.0.177.103的反向域名是ec2-52-0-177-103.compute-1.amazonaws.com ,以及ec2-52-0-177-103.compute-1.amazonaws.com的IP地址ec2-52-0-177-103.compute-1.amazonaws.com 52.0.177.103是52.0.177.103 。 相当不幸的是,我更希望主机名styx.amedee.be和反向DNS是相同的,但我认为这是我无法控制的。
单独使用SMTP是不可能的。 您必须在个人邮件服务器(例如Dovecot)上configurationPOP3服务,然后将Gmailconfiguration为使用POP3获取邮件。 用任何其他方法,你将失去电子邮件的风险。