
내 도메인의 메일을 처리하기 위해 postfix와 dovecot 설정이 있습니다. imap은 로컬 메일을 읽을 때 제대로 작동하는 것처럼 보이지만 localhost 및 smtp 포트를 사용하여 텔넷을 사용하여 이메일을 보내려고 하면 릴레이 액세스 거부 오류가 발생합니다.
[root@vps69576 ~]# telnet localhost smtp
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail.domain.net ESMTP Postfix
ehlo domain.net
250-mail.domain.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail to:
501 5.5.4 Syntax: MAIL FROM:<address>
mail from:[email protected]
250 2.1.0 Ok
rcpt [email protected]
554 5.7.1 <[email protected]>: Relay access denied
main.cf 파일의 내용은 다음과 같습니다.
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail.domain.net
mydomain = domain.net
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8, <site IP>
relay_domains =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks, reject_unauth_destination
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
답변1
IPv6(::1)을 통해 localhost에 연결하고 있지만 해당 주소는 "mynetworks" 목록에 포함되어 있지 않습니다. 다음으로 변경하세요.
mynetworks = 127.0.0.0/8, <사이트 IP>, [::1]/128
그리고 그것은 작동해야합니다.