后缀 – Dovecot – 可以发送电子邮件,但不会收到 – NOQUEUE – 中继访问被拒绝

我在Ubuntu上build立了一个邮件服务器。

我查了端口打开,我已经双重检查所有的configuration文件,检查每一个谷歌search结果,我可以find。 大多数类似的post有更复杂的日志和我已经采取的大纲步骤。

我可以从我的服务器发送电子邮件没有问题,但我不能接收它们。

尝试从我的大学电子邮件和我的gmail电子邮件中收到电子邮件后,这里是邮件日志:

Jan 3 19:02:03 li740-32 postfix/smtpd[19816]: connect from mail-by2on0070.outbound.protection.outlook.com[207.46.100.70] Jan 3 19:02:04 li740-32 postfix/smtpd[19816]: NOQUEUE: reject: RCPT from mail-by2on0070.outbound.protection.outlook.com[207.46.100.70]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<na01-by2-obe.outbound.protection.outlook.com> Jan 3 19:02:04 li740-32 postfix/smtpd[19816]: disconnect from mail-by2on0070.outbound.protection.outlook.com[207.46.100.70] Jan 3 19:02:32 li740-32 postfix/smtpd[19816]: connect from mail-vc0-f178.google.com[209.85.220.178] Jan 3 19:02:33 li740-32 postfix/smtpd[19816]: NOQUEUE: reject: RCPT from mail-vc0-f178.google.com[209.85.220.178]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-vc0-f178.google.com> Jan 3 19:02:33 li740-32 postfix/smtpd[19823]: connect from mail-vc0-f172.google.com[209.85.220.172] Jan 3 19:02:34 li740-32 postfix/smtpd[19816]: disconnect from mail-vc0-f178.google.com[209.85.220.178] Jan 3 19:02:34 li740-32 postfix/smtpd[19823]: NOQUEUE: reject: RCPT from mail-vc0-f172.google.com[209.85.220.172]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-vc0-f172.google.com> Jan 3 19:02:35 li740-32 postfix/smtpd[19823]: disconnect from mail-vc0-f172.google.com[209.85.220.172] 

logging当我发送电子邮件给自己:

 Jan 3 20:31:41 li740-32 postfix/smtpd[20703]: connect from CPE-121-208-28-184.bxny1.woo.bigpond.net.au[121.208.28.184] Jan 3 20:31:43 li740-32 postfix/smtpd[20703]: 0AB1FE675: client=CPE-121-208-28-184.bxny1.woo.bigpond.net.au[121.208.28.184], sasl_method=LOGIN, [email protected] Jan 3 20:31:43 li740-32 postfix/cleanup[20715]: 0AB1FE675: message-id=<[email protected]> Jan 3 20:31:43 li740-32 postfix/qmgr[20683]: 0AB1FE675: from=<[email protected]>, size=2731, nrcpt=1 (queue active) Jan 3 20:31:45 li740-32 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=121.208.28.184, lip=106.185.34.32, mpid=20718, TLS, session=<9uuNWMULlQB50By4> Jan 3 20:31:46 li740-32 postfix/smtpd[20703]: disconnect from CPE-121-208-28-184.bxny1.woo.bigpond.net.au[121.208.28.184] Jan 3 20:31:50 li740-32 postfix/smtp[20716]: 0AB1FE675: to=<[email protected]>, relay=none, delay=7.5, delays=0.67/0.01/6.8/0, dsn=5.4.6, status=bounced (mail for vapsterthekoala.com loops back to myself) Jan 3 20:31:50 li740-32 postfix/cleanup[20715]: 5D12FE677: message-id=<20150103203150.5D12FE677@makaveli> Jan 3 20:31:50 li740-32 postfix/qmgr[20683]: 5D12FE677: from=<>, size=4510, nrcpt=1 (queue active) Jan 3 20:31:50 li740-32 postfix/bounce[20719]: 0AB1FE675: sender non-delivery notification: 5D12FE677 Jan 3 20:31:50 li740-32 postfix/qmgr[20683]: 0AB1FE675: removed Jan 3 20:31:50 li740-32 postfix/smtp[20716]: 5D12FE677: to=<[email protected]>, relay=none, delay=0, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for vapsterthekoala.com loops back to myself) Jan 3 20:31:50 li740-32 postfix/qmgr[20683]: 5D12FE677: removed Jan 3 20:32:21 li740-32 dovecot: imap([email protected]): Disconnected: Logged out in=2989 out=1780 Jan 3 20:32:23 li740-32 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=121.208.28.184, lip=106.185.34.32, mpid=20722, TLS, session=<fCbHWsULnwB50By4> Jan 3 20:32:43 li740-32 dovecot: imap([email protected]): Connection closed in=498 out=4241 

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 (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 smtpd_tls_cert_file=/etc/dovecot/dovecot.pem smtpd_tls_key_file=/etc/dovecot/private/dovecot.pem smtpd_use_tls=yes smtpd_tls_auth_only = yes #Enabling SMTP for authenticated users, and handing off authentication to Dovecot smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes #smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination # 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 = makaveli alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname #mydestination = vapsterthekoala.com, makaveli, localhost.localdomain, localhost mydestination = localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all #Handing off local delivery to Dovecot's LMTP, and telling it where to store mail virtual_transport = lmtp:unix:private/dovecot-lmtp 

您的mydestination不包含您自己的域名,因此Postfix不知道它是为了在本地发送邮件。 这就是为什么你看到错误,如“继电器访问被拒绝”和“邮件循环回自己”。

看来你已经设置好了,但已经评论了。

 #mydestination = vapsterthekoala.com, makaveli, localhost.localdomain, localhost mydestination = localhost 

只需将您的域名添加到mydestination并重新加载Postfix。

我不知道我做错了什么,但重新设置了一遍又一遍解决了这个问题。 对那些有兴趣的人的指南。 https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql#postfix