postfix_-_sasl_authentification_설정

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
postfix_-_sasl_authentification_설정 [2016/08/26 02:29] – 만듦 koovpostfix_-_sasl_authentification_설정 [2016/08/26 11:16] (현재) – [참조링크] koov
줄 7: 줄 7:
  
 ===== main.cf 내용 수정 ===== ===== main.cf 내용 수정 =====
 +==== localhost 발송 전용 ====
  
 아래 내용을 /etc/postfix/main.cf 에 추가 아래 내용을 /etc/postfix/main.cf 에 추가
줄 13: 줄 14:
 smtpd_sasl_path = smtpd smtpd_sasl_path = smtpd
 smtpd_sasl_auth_enable = yes smtpd_sasl_auth_enable = yes
 +</code>
 +</WRAP>
 +
 +==== 어떤곳에서든 접속해서 어느곳으로나 보내길 원할때 ====
 +아래 설정상 mynetworks가 any이므로 스팸메일이나 무작위 릴레이 서버로 이용될 수 있으므로
 +restrictions 설정을 통해 sasl 인증받은 요청에 한해서만 허용하며 나머지는 모두 거부하는 형태로 설정
 +
 +<WRAP prewrap>
 +<code vim /etc/postfix/main.cf>
 +smtpd_sasl_path = smtpd
 +smtpd_sasl_auth_enable = yes
 +
 +smtpd_client_restrictions = permit_sasl_authenticated, reject
 +smtpd_relay_restrictions = permit_sasl_authenticated, reject
 +
 +mynetworks = 0.0.0.0/0
 </code> </code>
 </WRAP> </WRAP>
줄 40: 줄 57:
 ===== 서비스 확인 ===== ===== 서비스 확인 =====
  
 +==== 로그인 테스트 방법 1 ====
 <WRAP prewrap> <WRAP prewrap>
 <code bash> <code bash>
줄 60: 줄 78:
 </WRAP> </WRAP>
  
 +로그인 테스트를 위한 BASE64 인코딩 문자열 만드는 방법은 아래의 방법을 이용
 +<WRAP prewrap>
 +<code bash>
 +echo -ne '\0username\0password' | base64
 +</code>
 +</WRAP>
  
 +==== 로그인 테스트 방법 2 ====
 +
 +로그인 부분을 아래와 같이 AUTH LOGIN 으로 진행하는 방법
 +처음 입력 부분은 ID, 두번째 입력 부분은 PASSWORD 의 BASE64 encode 문자열이다.
 +<WRAP prewrap>
 +<code bash>
 +AUTH LOGIN
 +334 VXNlcm5hbWU6
 +amJvc3M=
 +334 UGFzc3dvcmQ6
 +Q2xvdWQxMiMk
 +235 2.7.0 Authentication successful
 +</code>
 +</WRAP>
 +
 +===== 오류 해결 =====
 +
 +<WRAP prewrap>
 +<code bash>
 +$ telnet server.test.com 25
 +. . .
 +220 server.test.com ESMTP Postfix
 +EHLO client.test.com
 +250-server.test.com
 +250-PIPELINING
 +250-SIZE 10240000
 +250-VRFY
 +250-ETRN
 +250-AUTH PLAIN LOGIN
 +250-ENHANCEDSTATUSCODES
 +250-8BITMIME
 +250 DSN
 +AUTH PLAIN AGpib3NzAENsb3VkMTIjJA==
 +535 5.7.8 Error: authentication failed: bad protocol / cancel
 +</code>
 +</WRAP>
  
 +위와같이 테스트 하는데 bad protocol / cancel 이라고 나오는경우는 거의 아이디/암호가 잘못되어 나오는 경우이다.
 +BASE64 인코딩시에 주의 하여 재시도 해보거나 AUTH LOGIN방식으로 하나씩 테스트 해보는게 좋다.
 ===== 참조링크 ===== ===== 참조링크 =====
   * https://access.redhat.com/articles/10656   * https://access.redhat.com/articles/10656
 +  * http://www.postfix.org/SMTPD_ACCESS_README.html
  
  • postfix_-_sasl_authentification_설정.1472178587.txt.gz
  • 마지막으로 수정됨: 2016/08/26 02:29
  • 저자 koov