exim 에 spf, srs 적용하기
unfix 서버를 구축할 땐 postfix 를 사용했지만 postfix 에선 srs 를 사용할 수가 없었기 때문에 새로 설치하게 된 서버들에선 exim 을 시도 중이다.
그런데 exim 을 사용하려고 하니 문제가 하나 있는데, 구글에서 검색을 해도 원하는 결과가 잘 나오질 않는다는 점이 바로 그것! exim 에는 spf 와 srs 등을 사용하기 위해서는 따로 패치가 필요 없이 그저 EXPERIMENTAL_SPF=yes EXPERIMENTAL_SRS=yes 이 두 가지 환경변수를 세팅한 채로 빌드를 진행하면 된다.
그 이후 어떻게 해야하는 지에 대한 설명이 없어서 한참 헤맸는데 exim 과 함께 설치되는 문서를 확인해야하는 것이었다. -_-; 보면 domain key 등도 위에서와 같이 환경변수만 세팅해주면 사용이 가능해진다.
doc/exim-4.68/experimental-spec.txt.bz2
문서를 확인해보니 이제 해야할 일은 spf 와 srs 설정을 추가해주는 것 뿐 후훗!
SPF 는 global 섹션에서 acl_smtp_rcpt 로 등록되어 있는 것에 다음과 같은 설정을 넣어주면 된다.
# Query the SPF information for the sender address domain, if any,
# to see if the sending host is authorized to deliver its mail.
# If not, reject the mail.
#
deny
message = [SPF] $sender_host_address is not allowed to send mail \
from $sender_address_domain
log_message = SPF check failed.
spf = fail
# Add a SPF-Received: header to the message
warn
message = $spf_received
젠투에선 acl_smtp_rcpt = acl_check_rcpt 와 같이 되어 있기 떄문에 acl_check_rcpt 에 위와같은 설정을 추가해줬다. 만약 아래 warn message = $spf_received 를 넣어주지 않으면 spf 결과를 헤더에 추가해주지 않게된다. 생색을 내기 위해선 뭔가 출력될 필요가 있으므로 -_-! 난 헤더를 추가하도록 설정해줬다.
하지만 위에 대로만 할 경우 내가 메일을 보낼 경우에도 SPF-Received 헤더가 붙는 문제가 생긴다. smtp auth 를 설정해놓은 상황에서 이 서버를 통해 메일을 보낼려면 인증이 되어있어야 할테니 아래와 같이 수정해서 이런 문제를 피해주자.
# Add a SPF-Received: header to the message
warn
message = $spf_received
!authenticated = *
그리고 그 담은 SRS 복잡하게 하려면 복잡하겠지만 다 귀찮아서 hash 용 secretkey 하나만 넣어서 설정해버렸다. 아래 설정은 global 섹션에 들어가면 된다. (domainlist 같은게 들어가는 곳) 실제로 somesecretkey 를 적어주는건아니고 그냥 원하는 단어 하나를 적어주면 된다.
srs_config = somesecretkey
그 다음엔 userforward 트랜스포트에 srs 를 적용하도록 해주자 srs = forward 만이 내가 추가해준 부분;;
userforward:
driver = redirect
srs = forward
check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
file = $home/.forward
# allow_filter
no_verify
no_expn
check_ancestor
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
이제 끝!!!
얼마 받지도 못하는 웍스테이션 조굔지 뭔지 때문에 지난 며칠간 고생한걸 생각하면 흑흑 ㅠ.ㅠ
p.s) exim 에 spf 적용하기와 관련해서 따라하기 편한 문서가 있는데 페이지 랭크가 낮은거 같아서 링크
http://slett.net/spam-fil...ring-for-mx/exim-spf.html
Related Posts
This entry was posted by 정태영 on Saturday, February 16th, 2008 at 4:34 PM and is taged under Computer, email, exim, mta, sender policy framework, sender rewrite scheme, spam filter, spf, srs. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.