
Cloudflare를 설정한 후 이메일을 보낼 수 없습니다. A 레코드 mail.example.com과 MX 레코드를 example.com으로 만들었습니다. 이메일을 받으면 잘 작동하지만 서버에서 이메일을 보내면 오류가 발생합니다.
to=<[email protected]>, relay=ASPMX.L.GOOGLE.COM[74.125.205.26]:25, delay=0.58, delays=0.05/0.01/0.45/0.07, dsn=5.1.1, status=bounced (host ASPMX.L.GOOGLE.COM[74.125.205.26] said: 550-5.1.1 The email account that you tried to reach does not exist.
그런데 이상한 점은 To-field에 Gmail 주소조차 포함되어 있지 않다는 것입니다. 그렇다면 Google은 왜 Gmail 사용자에게 문제를 해결하려고 시도합니까? 이 문제의 문제점은 무엇입니까? DNS 설정 및 Postfix?
Gmail 계정으로 이메일을 보내면 정상적으로 작동합니다. 그러나 다른 도메인의 경우 Google은 Gmail 주소를 기대하기 때문에 이를 반송하는 것 같습니다.
편집하다:
main.cf(서버를 식별할 수 있는 편집 값):
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
disable_vrfy_command = yes
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = $myhostname, mail.example.com, localhost.example.com, localhost, $mydomain
mydomain = example.com
myhostname = mail.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 xxx.xxx.xxx.xx
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
relayhost = myhost.com
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_helo_required = yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
master.cf:
smtp inet n - y - - smtpd
pickup unix n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - y 1000? 1 tlsmgr
rewrite unix - - y - - trivial-rewrite
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
trace unix - - y - 0 bounce
verify unix - - y - 1 verify
flush unix n - y 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - y - - smtp
relay unix - - y - - smtp
showq unix n - y - - showq
error unix - - y - - error
retry unix - - y - - error
discard unix - - y - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - y - - lmtp
anvil unix - - y - 1 anvil
scache unix - - y - 1 scache
maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}
답변1
이 설정을 사용하면 relayhost = host.example.com
로컬이 아닌 메일의 다음 홉 대상을 설정할 수 있습니다. 즉, 이메일 메시지를 대상으로 직접 전달하는 대신 postfix에 모든 메시지를 간단히 전달할 수 있도록 지시합니다.릴레이 서버(때때로"스마트 호스트") 실제 배송이 수행되어야 합니다.
기본적으로는 relayhost
설정되어 있지 않으며 postfix는 메일을 수신자에게 직접 전달하려고 시도합니다.
일반적으로 Postfix 서버가 메시지를 수락하려면 먼저 릴레이 호스트의 승인을 받아야 합니다. 해당 인증은 IP 주소 기반 화이트리스트인 경우가 많으며 자격 증명을 제공해야 합니다.
메일이 반송되면 릴레이 호스트에 대한 권한이 없거나 해당 릴레이 호스트가 올바르게 구성되지 않았습니다.