web-dev-qa-db-ja.com

Postfix-Dovecot-メールを送信できるが受信できない-NOQUEUE-リレーアクセスが拒否されました

私はubuntuにメールサーバーをセットアップしました。

ポートが開いていることを確認し、すべての構成ファイルを再確認し、見つかったすべてのGoogle検索結果を確認しました。同様の投稿のほとんどには、私がすでに行ったより複雑なログと概要の手順があります。

サーバーからのメールは問題なく送信できますが、受信できません。

大学のメールと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]

自分にメールを送信したときにログに記録します。

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をリロードするだけです。

4
Michael Hampton

何を間違えたのかわかりませんが、セットアップをやり直すと問題が解決しました。興味のある方のためのガイド。 https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql#postfix