Postfix가 AUTH 명령을 실행하지 않습니다.

Postfix가 AUTH 명령을 실행하지 않습니다.

내 서버에서 Postfix를 통해 이메일을 보내려고 하는데 작동하지 않습니다. 외부 SMTP 서버를 릴레이 호스트로 사용하고 있습니다. 이것은 다음과 관련된 부분입니다 /etc/postfix/main.cf.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
relayhost = [mail.myISP.nl]:submission
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
debug_peer_list=mail.myISP.nl
debug_peer_level=5

libsasl2-2, libsasl2-modules및 을 설치했습니다 sasl2-bin. 에서 /etc/postfix/sasl_password유효한 자격 증명을 입력했습니다.

[mail.myISP.nl]:587     myuserid:mypassword

그런 다음 텍스트 파일을 .db파일로 변환하는 명령을 실행했습니다.

postmap /etc/postfix/sasl_password

Postfix 구성을 다시 로드했습니다.

sudo systemctl reload postfix

그러나 실제로는 메일이 전송되지 않습니다. 다음 명령으로 TCP 덤프를 실행했습니다.

echo "This is a test" | mail -s "Testing" [email protected]

결과는 원격 서버와의 다음 교환이었습니다.

(S) srv17610.myISP.nl ESMTP Exim 4.86.2 Wed, 28 Dec 2016 11:06:24 +0100
(C) EHLO hostname
(S) 250-srv17610.myISP.nl Hello my.canonical.name.nl [xxx.xxx.xxx.xxx]
(S) 250-SIZE 20971520
(S) 250-8BITMIME
(S) 250-PIPELINING
(S) 250-AUTH PLAIN LOGIN
(S) 250-STARTTLS
(S) 250 HELP
(C) MAIL FROM:<[email protected]> SIZE=310
(C) RCPT TO:<[email protected]>
(C) DATA
(S) 250 OK
(S) 550 relay not permitted, authentication required
(S) 503-All RCPT commands were rejected with this error:
(S) 503-relay not permitted, authentication required
(S) 503 Valid RCPT command must precede DATA
(C) RSET
(C) QUIT
(S) 250 Reset OK
(S) 221 srv17610.myISP.nl closing 

(C)는 Postfix이고 (S)는 원격 서버입니다. AUTH 명령을 실행하지 않고 자격 증명을 제공하지 않으므로 메일이 거부되는 것을 볼 수 있습니다. 간단 /var/log/mail.log하게 메일이 전송됐다고 나옵니다. 무엇이 잘못되었나요?

답변1

구성이 합법적인 것처럼 보이지만 postfix에서는 smtp_sasl_password_maps 파일이 실제로 일반 텍스트가 아닌 최적화된 방식으로 저장되어야 합니다.

해당 파일이 없다면

명령을 실행합니다:

포스트맵 /etc/postfix/sasl_password

sasl_password.db를 생성합니다.

서비스 접미사 다시 로드

변경 사항을 적용하려면

관련 정보