
방금 postfix 2.6.6과 dovecot을 사용하여 메일 서버를 설정했습니다.
아래와 같이 main.cf에 인증 관련 구성이 있습니다.
smtpd_tls_cert_file=/etc/httpd/ssl/mail.crt
smtpd_tls_key_file=/etc/httpd/ssl/mail.key
smtpd_use_tls=yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
이제 내 도메인과 외부에서 정상적으로 이메일을 보내고 받을 수 있습니다.
그런데 아래와 같이 telnet을 이용하면 원격에서 인증 없이 쉽게 메일을 보낼 수 있다는 것을 알게 되었는데, 이는 다른 사람이 쉽게 내 도메인에 스팸 메일을 보낼 수 있다는 것을 의미합니다.
Myhost:~/ z$ telnet mail.example.com 25
Trying 232.96.23.130...
Connected to mail.example.com.
Escape character is '^]'.
220 mail.example.com ESMTP Postfix
ehlo mail.example.com
250-mail.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:[email protected]
250 2.1.0 Ok
rcpt to: [email protected]
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject:how much dust?
fdhjaklf
fdsahjk;
fdajshk
.
250 2.0.0 Ok: queued as 08B2C5883481
postfix를 보호하고 다른 사람이 인증 없이 메일을 보낼 수 없도록 하려면 어떻게 해야 합니까?
답변1
일반적으로 메일 서버에는 두 가지 목적이 있습니다.
- 사용자가 인터넷의 다른 메일 서버로 메일을 보낼 수 있도록 허용합니다. 이 부분은 당신이 해야 할 대로 수행했습니다.
- 서비스를 제공할 도메인의 사용자에 대한 메일 수신.
서버를 보내는 메일 전송에만 사용하고 들어오는 메일 수신에는 사용하지 않으려면 mydestination
main.cf의 매개변수를 변경하고 제거 해야 합니다 $mydomain
. 그렇게 하면 귀하의 도메인으로 주소가 지정된 이메일은 허용되지 않습니다. 자세한 내용은postfix 문서 사이트.