메일 서버 · 1 min read · Oct 05, 2025
가상 도메인 및 사용자와 함께하는 전체 메일 서버 솔루션 (Debian Etch, Postfix, Mysql, Dovecot, DSpam, ClamAV, Postgrey, RBL) - 페이지 11
B. 보안 Postfix+TLS
우선, secure-mail.example.com에 postfix를 설치해야 합니다. 이 특정 설치는 쿼터 지원이 필요하지 않습니다 (로컬 배달을 처리하지 않음), 하지만 간단하게 유지하기 위해 위에서 했던 것과 같은 방법으로 설치할 것입니다:
# dpkg -i postfix_2.3.8-2_i386.deb
# dpkg -i postfix-mysql_2.3.8-2_i386.deb자동 구성 중에 설치 과정에서 postfix에 대한 질문이 있을 경우, “No Configuration”을 선택하세요.
dpkg는 Postfix의 모든 구성 파일을 /etc/postfix에 설치할 것이므로, 그곳으로 가서 main.cf 파일을 생성합니다:
# cd /etc/postfix
# touch main.cfmain.cf 파일은 두 가지 방법으로 편집할 수 있습니다. 좋아하는 텍스트 편집기를 사용할 수도 있고, 내장된 postfix 도구인 postconf을 사용할 수도 있습니다. 우리는 이미 IV.A 절에서 버전을 확인하기 위해 postconf을 한 번 사용했습니다.
postconf 도구의 실제 이점은 내장된 오류 검사가 있으며, 캐리지 리턴, 줄 바꿈, 이상한 따옴표 등으로 인한 ‘이상함’의 가능성을 제거한다는 것입니다. 이 가이드에서는 이를 사용할 것이지만, 꼭 필요한 것은 아닙니다.
기본 정보를 입력하는 것으로 시작합니다:
# postconf -e 'myhostname = secure-mail.example.com'
# postconf -e 'smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)'
# postconf -e 'biff = no'
# postconf -e 'append_dot_mydomain = no'
# postconf -e 'myorigin = example.com'
# postconf -e 'inet_interfaces = all'
# postconf -e 'local_recipient_maps ='
# postconf -e 'local_transport = error:local mail delivery is disabled'
# postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated, reject'이번에는 로컬 배달을 비활성화했음을 알 수 있습니다. 기본적으로 이것은 단순히 아웃바운드 릴레이 서버이므로, 메일을 ‘배달’하려고 하지 않고, 그냥 전달하기만 원합니다. 또한 SMTP 서버가 SASL 인증된 세션만 허용하고, 다른 세션은 거부하도록 설정했습니다.
이제 SASL (SMTP 인증)에 대한 정보를 입력해야 합니다. 이는 연결을 암호화하지 않고, 사용자에게 로그인하도록 요구합니다:
# postconf -e 'smtpd_sasl_auth_enable = yes'
# postconf -e 'smtpd_sasl_security_options = noanonymous'
# postconf -e 'broken_sasl_auth_clients = yes'
# postconf -e 'smtpd_sasl_type = dovecot'
# postconf -e 'smtpd_sasl_path = private/auth'이제 postfix 설치가 dovecot에 모든 인증 요구 사항을 쿼리하지만, 여전히 암호화되지 않았습니다. 이를 변경해 보겠습니다…
# postconf -e 'smtpd_tls_cert_file = /etc/ssl/example.com/mailserver/mail-cert.pem'
# postconf -e 'smtpd_tls_key_file = /etc/ssl/example.com/mailserver/mail-key.pem'
# postconf -e 'smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_session_cache'
# postconf -e 'smtpd_tls_security_level = encrypt'
# postconf -e 'smptd_tls_received_header = no'
# postconf -e 'smtpd_tls_loglevel = 0'
# postconf -e 'tls_random_source = dev:/dev/urandom'이제 postfix를 다시 로드합니다…
# postfix reload그리고 Dovecot을 실행해 보겠습니다…
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.