2016-09-15 5 views
0

VPSで自分のメールを管理するためにいくつかのコンテナを設定しようとしています。ホストからのドッカーと矛盾したIPアドレス

私はpostfixサーバ用にTLS暗号化を設定しました。

いくつかの送信者からのメールを受信した場合::

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

私からのメールを受信した場合、偽造電子メールを検出するために、SPFを設定している間、私は、暗号化がを使用している場合報告IPが応じて、同じではないことを発見しました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 

いくつかの他のネットワークからのメールを受信:

Received: from cabale.usenet-fr.net (dockerhost [172.18.0.1]) 
    by localhost (Postfix) with ESMTP id 834F8520 

報告されたIPがDockerホストのIPアドレス... ランダムベース、IP 172.18.0.1を使用しているようです。それ自体で問題があるだけでなく、SPFにも影響します。なぜなら、Googleからの電子メールはIPが許可されていないSoftFailとしてタグ付けされているからです。

一部のサーバー(常に)がdockerhost IPを報告する理由と、一部のサーバーではない理由を理解できませんでした。これはTLS暗号化とは関係ありませんが、最初はそうです。ここで

は私master.cnfファイルです:

# 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ファイル:

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 

この動作はから来ないと報告されたIPが実際のものとなるように、どのように私はそれにパッチを適用することができますどこに?

EDIT: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 - 問題に関する基本問題、提案最善の解決策は、ユーザランドプロキシ を無効にし、ルーティングする代わりに、ポート(複数可)のiptablesを使用することです
  • https://github.com/docker/docker/issues/14856 - 努力がなされています〜 デフォルトでuserlandプロキシを無効にしますが、現在ブロックされています。下記を参照してください。
  • "--userland-proxy = false"を使用すると、ホストネットワーキングに重大な問題が発生する可能性があります。ドッカーの問題#5618
+0

ありがとうございました!私はバグの原因を特定できませんでしたが、今は何が起こっているのか知っています:) –