我是新的postfix,直到现在我用exim工作,我不能做一个configuration上的后缀,我设法做到与exim
我有3个域名,每个域名有5个电子邮件地址
domain1.com与[email protected],[email protected] … [email protected] domain2.com与[email protected],[email protected] … [email protected] domain3.com与[email protected],[email protected] … [email protected]
并为每个用户我想具体一个独特的IP发送电子邮件。 他将连接到smtpXX.domainX.com,我希望传出的电子邮件是来自smtpXX.domainX.com的IP,也是邮件HELO是smtpXX.domainX.com,
我尝试到现在在不同的解决scheme和最后一个https://serverfault.com/a/650326/443941但仍然没有成功:
smtplogin正在使用端口587
我也设置:
31.xx.xx.xx:submission inet n - n - - smtpd
我尝试从家里的路由器后面的计算机连接,我尝试连接到smtp11.domain1.com其中ip是31.xx.xx.189收到的标题设置它由我的后缀是好的,但接收器服务器看到主机名我的服务器(server.hostname.com),也是服务器的主要IP …下面是我得到:
Received: from [31.xx.xx.85] (port=47010 helo=server.hostname.com) by host.some-server.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from <[email protected]>) id 1eEJd3-0004bH-0B for [email protected]; Mon, 13 Nov 2017 20:38:41 +0200 Received: from [lo.cal.ip.add] (unknown [some.router.ip.addres]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) by smtp11.domain1.com (Postfix) with ESMTPSA id 0ABB627AXXXX for <[email protected]>; Mon, 13 Nov 2017 20:37:43 +0200 (EET)
有人可以帮助我吗? 我使用的是Centos 7,postfix 2.10,virtualmin(我也试过CWP,结果相同)
UPDATE
main.cf
queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix inet_interfaces = all inet_protocols = all mydestination = $myhostname, localhost.$mydomain, localhost, server.myhostnamedomain.com, $mydomain unknown_local_recipient_reject_code = 550 alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.10.1/samples readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES virtual_alias_maps = hash:/etc/postfix/virtual sender_bcc_maps = hash:/etc/postfix/bcc sender_dependent_default_transport_maps = hash:/etc/postfix/dependent mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME home_mailbox = Maildir/ smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtp_tls_security_level = may mailbox_size_limit = 0 allow_percent_hack = no milter_default_action = accept milter_protocol = 2 smtpd_milters = inet:localhost:8891 non_smtpd_milters = inet:localhost:8891 debug_peer_list = my-domain-1
master.cf
127.0.0.1:smtp inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o smtp_helo_name=localhost -o smtp_bind_address=127.0.0.1 -o myhostname=localhost 31.xx.xx.85:smtp inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o smtp_helo_name=smtp1.my-domain-1.com -o smtp_bind_address=31.xx.xx.85 -o myhostname=smtp1.my-domain-1.com 31.xx.xx.189:smtp inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o smtp_helo_name=smtp12.my-domain-1.com -o smtp_bind_address=31.xx.xx.189 -o myhostname=smtp12.my-domain-1.com 127.0.0.1:submission inet n - n - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtp_helo_name=localhost -o smtp_bind_address=127.0.0.1 -o myhostname=localhost -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING 31.xx.xx.85:submission inet n - n - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtp_helo_name=smtp1.my-domain-1.com -o smtp_bind_address=31.xx.xx.85 -o myhostname=smtp1.my-domain-1.com -o smtpd_reject_unlisted_recipient=no -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING 31.xx.xx.189:submission inet n - n - - smtpd -o smtp_helo_name=smtp12.my-domain-1.com -o smtp_bind_address=31.xx.xx.189 -o myhostname=smtp12.my-domain-1.com -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING 127.0.0.1:smtps inet n - n - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtp_helo_name=localhost -o smtp_bind_address=127.0.0.1 -o myhostname=localhost -o smtpd_reject_unlisted_recipient=no -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING 31.xx.xx.85:smtps inet n - n - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtp_helo_name=smtp1.my-domain-1.com -o smtp_bind_address=31.xx.xx.85 -o myhostname=smtp1.my-domain-1.com -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING 31.xx.xx.189:smtps inet n - n - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtp_helo_name=smtp12.my-domain-1.com -o smtp_bind_address=31.xx.xx.189 -o myhostname=smtp12.my-domain-1.com -o smtpd_reject_unlisted_recipient=no -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING 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 relay unix - - n - - smtp showq unix n - n - - showq error unix - - n - - error retry unix - - n - - error discard unix - - n - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache smtp-151060553215710 unix - - n - - smtp -o smtp_bind_address=31.xx.xx.189
依赖文件
@smtp12.my-domain-1.com smtp-151060553215710
电子邮件标题
Return-Path: <[email protected]> Delivered-To: [email protected] Received: from host.host-for-reciving.com by host.host-for-reciving.com with LMTP id eCEjEXO1Clq9TQAAIPTFlQ for <[email protected]>; Tue, 14 Nov 2017 11:20:51 +0200 Return-path: <[email protected]> Envelope-to: [email protected] Delivery-date: Tue, 14 Nov 2017 11:20:51 +0200 Received: from [31.xx.xx.85] (port=48868 helo=server.localdomain) by host.host-for-reciving.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from <[email protected]>) id 1eEXOl-0002TT-76 for [email protected]; Tue, 14 Nov 2017 11:20:51 +0200 Received: from [192.168.10.11] (unknown [external personal ip]) by smtp12.my-domain-1.com (Postfix) with ESMTPA id D56F32835F1C for <[email protected]>; Tue, 14 Nov 2017 09:19:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp12.my-domain-1.com D56F32835F1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=my-domain-1.com; s=default; t=1510651190; bh=VazKNaSjnZAeKOSBMBWmlM99/xJ8HmJ4H2d+B/wNoE8=; h=To:From:Subject:Date:From; b=uaD3aX+xsVAqKjaqqZrcfG+83gR+nxdHicjxN48IpubMvfbOLR/+i3Mz6Gr2OBFAq XRrSrxTe4LyM6V3mcY2sUo3i2f9LXS4Zktka1jsGI+IoduGvzTaa6c8pF0yn8u6N4a xupaom0/++cCovIFUG03XCl+A4belApaM0nb7JfpLhkR9Q36BWkePdDLNPYe5/GjYN noZTAZzPs9mYD8yc52l7NLpY+vxGr828649Yio8UAwKmzJirORBGKXeFoxvALtSi7z klYtu+ZA+2TlekgWZHQvHbseAAH6XF8NQGYX9IE2kQ+fSEFOG6psqz1vzE/IRj/ZiT G3oQzy02F/KFw== To: [email protected] From: Some Name <[email protected]> Subject: sdadf Message-ID: <[email protected]> Date: Tue, 14 Nov 2017 11:19:49 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US sdfasdfasdf
看看Postfix体系结构概述 。 在您的master.cf您已经使用不同的设置(包括IP和协议)configuration了多个smtpd来接收邮件。 但是,Postfix使用不同的组件传递邮件: smtp 。
您需要在master.confconfiguration其他SMTP客户端(传出传输 ):
smtp1-out unix - - n - - smtp -o smtp_bind_address=31.xx.xx.85 -o smtp_helo_name=smtp1.example.com -o syslog_name=postfix-smtp1 smtp12-out unix - - n - - smtp -o smtp_bind_address=31.xx.xx.189 -o smtp_helo_name=smtp12.example.com -o syslog_name=postfix-smtp12
然后,您需要在main.cfconfiguration发件人相关的传输地图:
sender_dependent_default_transport_maps = hash:/etc/postfix/sender_transport
在这个/etc/postfix/sender_transport你需要将你的域映射到传输:
# Use source IP - 31.xx.xx.85 @example.com smtp1-out: # Use source IP - 31.xx.xx.189 @example.net smtp12-out:
由于这是一个hash: type 查找表 ,所以sudo postmap /etc/postfix/sender_transport 。