PostFix 문제 - MailHog를 작동시키려는 중

PostFix 문제 - MailHog를 작동시키려는 중

그래서 이상하게도 이전에 작업했던 MailHog가 오늘 아침 Mac Mojave에서 작동을 멈췄습니다.

MailHog를 실행하기 위해 이 게시물의 단계를 따랐습니다.https://www.joshstauffer.com/send-test-emails-on-a-mac-with-mailhog/

Postfix 로그 파일 출력: (log stream --predicate '(process == "smtp") || (process == "smtp")' --info) Postfix 로그 파일 출력

내 /etc/hosts 파일에는 127.0.0.1 localhost에 대한 항목이 포함되어 있습니다.

또한 다음을 수행하면 다음과 같은 결과를 얻습니다(관련이 있는지 확실하지 않음).

[12:26:22][~]#nslookup localhost  
Server:     192.168.0.1 
Address:    192.168.0.1#53

** server can't find localhost: NXDOMAIN

etc/postfix/main.cf 구성 파일의 마지막 섹션(이전에는 모두 변경되지 않음):

#inet_protocols = all
inet_protocols = ipv4
message_size_limit = 10485760
mailbox_size_limit = 0
biff = no
mynetworks = 127.0.0.0/8, [::1]/128
smtpd_client_restrictions = permit_mynetworks permit_sasl_authenticated permit
recipient_delimiter = +
tls_random_source = dev:/dev/urandom
smtpd_tls_ciphers = medium
inet_interfaces = loopback-only

# Adding this doesnt work:
#mydestination = localhost

# For MailHog
myhostname = localhost
relayhost = [localhost]:1025
compatibility_level = 2

다음에 따라 inet_protocols = ipv4를 추가해 보았습니다.이 게시물.

도움을 주시면 감사하겠습니다!

답변1

기본적으로 Postfix는 DNS만 사용하여 이름을 확인하고 시스템 확인 구성(호스트 파일, LDAP 등)을 우회합니다. 기본 시스템 해석을 사용하려면 다음 구성 옵션을 설정하십시오.

smtp_host_lookup=native

또는 DNS에서 레코드를 찾을 수 없는 경우 기본 옵션으로 대체합니다.

smtp_host_lookup=dns,native

루트 DNS 서버는 예약되어 있으므로 localhost에 대한 레코드를 반환할 수 없습니다. 그러나 온프레미스 DNS 솔루션이나 ISP에 따라 이에 대한 기록을 얻을 수도 있습니다.

관련 정보