2016-09-15 2 views
0

VPS에서 내 개인 이메일을 관리하기 위해 일부 컨테이너를 설정하려고합니다.호스트의 도커와 일치하지 않는 IP 주소

postfix 서버에 대해 TLS 암호화를 설정했습니다. 위조 이메일을 감지하는 SPF를 설정하는 동안, 나는 암호화를 사용하는 경우 보고 된 IP가 따라 동일하지 않습니다 것을 발견 :

어떤 사람이 보낸 이메일 수신 :

Received: from zproxy.mydomain.com (zproxy110.mydomain.com [137.**.**.**]) 
    by localhost (Postfix) with ESMTP id 5250459F 

하는 이메일을 수신 내 Gmail 계정 (TLS가 사용) :

Received: from mail-lf0-x241.google.com (dockerhost [172.18.0.1]) 
    (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) 
    (No client certificate requested) 
    by localhost (Postfix) with ESMTPS id 2EDEF59F 

다른 네트워크에서 이메일을 수신 :

보고 된 IP가 Docker 호스트의 IP 인 것처럼 보입니다 ... 랜덤, IP 172.18.0.1을 사용합니다. 자체적으로 문제가되는 것 외에도 IP가 허용되지 않기 때문에 Google의 이메일에 SoftFail이라는 태그가 지정되어 있기 때문에 SPF에도 영향을 미칩니다.

일부 서버 (항상)가 ​​dockerhost IP를보고하는 이유와 일부 서버가 이해하지 못하는 이유는 무엇입니까? 처음부터 TLS 암호화와 관련이 없습니다.

# appending .domain is the MUA's job. 
append_dot_mydomain = no 

# Uncomment the next line to generate "delayed mail" warnings 
#delay_warning_time = 4h 

readme_directory = no 

# TLS parameters 
smtpd_tls_cert_file = /etc/ssl/certs/postfix-cert.pem 
smtpd_tls_key_file = /etc/ssl/private/postfix-cert.key 
smtpd_use_tls=yes 
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache 
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache 

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for 
# information on enabling SSL in the smtp client. 

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination check_policy_service unix:private/policy-spf 
myhostname = localhost 
alias_maps = hash:/etc/aliases 
alias_database = hash:/etc/aliases 
mydestination = /etc/mailname, 11687faae091, localhost.localdomain, localhost 
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 
mailbox_size_limit = 0 
recipient_delimiter = + 
inet_interfaces = all 
inet_protocols = all 
virtual_gid_maps = static:5000 
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf 
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf 
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf 
virtual_transport = dovecot 
dovecot_destination_recipient_limit = 1 
smtpd_tls_loglevel = 1 
smtpd_tls_received_header = yes 
smtpd_tls_security_level = may 
smtpd_tls_protocols = !SSLv2,!SSLv3,TLSv1,TLSv1.1,TLSv1.2 
smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3,TLSv1,TLSv1.1,TLSv1.2 
smtpd_tls_mandatory_exclude_ciphers = aNULL,MD5,RC4 
smtpd_tls_mandatory_ciphers = high 
smtp_tls_security_level = may 
smtp_tls_loglevel = 1 
smtp_tls_mandatory_protocols = !SSLv2,!SSLv3,TLSv1,TLSv1.1,TLSv1.2 
smtp_tls_protocols = !SSLv2,!SSLv3,TLSv1,TLSv1.1,TLSv1.2 
smtp_tls_mandatory_exclude_ciphers = aNULL,MD5,RC4 
policy-spf_time_limit = 3600s 

그리고 내 main.cnf 파일 : 여기

master.cnf 파일이 동작에서 온 않고 내가보고 된 IP는 실제 하나입니다 그래서 패치 할 수있는 방법

smtp  inet n  -  n  -  -  smtpd 
pickup  unix n  -  n  60  1  pickup 
cleanup unix n  -  n  -  0  cleanup 
qmgr  unix n  -  n  300  1  qmgr 
tlsmgr  unix -  -  n  1000? 1  tlsmgr 
rewrite unix -  -  n  -  -  trivial-rewrite 
bounce  unix -  -  n  -  0  bounce 
defer  unix -  -  n  -  0  bounce 
trace  unix -  -  n  -  0  bounce 
verify  unix -  -  n  -  1  verify 
flush  unix n  -  n  1000? 0  flush 
proxymap unix -  -  n  -  -  proxymap 
proxywrite unix -  -  n  -  1  proxymap 
smtp  unix -  -  n  -  -  smtp 
relay  unix -  -  n  -  -  smtp 
showq  unix n  -  n  -  -  showq 
error  unix -  -  n  -  -  error 
retry  unix -  -  n  -  -  error 
discard unix -  -  n  -  -  discard 
local  unix -  n  n  -  -  local 
virtual unix -  n  n  -  -  virtual 
lmtp  unix -  -  n  -  -  lmtp 
anvil  unix -  -  n  -  1  anvil 
scache  unix -  -  n  -  1  scache 
maildrop unix -  n  n  -  -  pipe flags=DRhu 
    user=vmail argv=/usr/bin/maildrop -d ${recipient} 
uucp  unix -  n  n  -  -  pipe flags=Fqhu 
    user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) 
ifmail  unix -  n  n  -  -  pipe flags=F user=ftn 
    argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) 
bsmtp  unix -  n  n  -  -  pipe flags=Fq. 
    user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient 
scalemail-backend unix - n  n  -  2  pipe flags=R 
    user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} 
    ${user} ${extension} 

mailman unix -  n  n  -  -  pipe flags=FR 
    user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} 
    ${user} 
dovecot unix -  n  n  -  -  pipe 
    flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${recipient} 
submission inet n  -  -  -  -  smtpd 
    -o smtpd_tls_security_level=encrypt 
    -o smtpd_sasl_auth_enable=yes 
    -o smtpd_client_restrictions=permit_sasl_authenticated,reject 
policy-spf unix -  n  n  -  -  spawn 
    user=nobody argv=/usr/bin/policyd-spf 

?

편집 : OK, 난 그냥 다른 업체에서 테스트하고 그것과 아무 상관이 없을 수 암호화처럼 보인다는 :

Received: from o1.30e.fshared.sendgrid.net (o1.30e.fshared.sendgrid.net [167.89.55.41]) 
    (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) 

답변

1

이 현재의 알려진 버그 (2016년 10월 10일를)입니다 도커 버전 : 사용자 영역 프록시는 컨테이너 포트를 호스트 포트에 바인딩하는 데 사용되지만 사용자가 경험 한 불일치가 있습니다. 나도 똑같은 문제가있다.

참고 :

  • https://github.com/docker/docker/issues/15086 - 노력이 만들어집니다 - 기본 문제 문제를 에 대한이 최선의 해결책은 유저 랜드 프록시 을 비활성화하고 경로 대신 포트 (들)
  • https://github.com/docker/docker/issues/14856을 iptables를 사용하는 것입니다 제안 ~ 기본적으로 userland 프록시를 비활성화하지만 현재 차단되어 있습니다. 아래 내용을 참조하십시오.
  • "--userland-proxy = false"를 사용하면 호스트 네트워킹에 심각한 문제가 발생할 수 있으므로 현재 권장되지 않습니다. 도커 문제 # 5618
+0

답변 해 주셔서 감사합니다. 나는 버그의 근본 원인을 식별 할 수 없었고, 지금 무슨 일이 벌어지고 있는지 알고있다. :) –