domain1 unix - - n - - smtp -o smtp_bind_address=1.1.1.1 -o smtp_helo_name=mail.abc.com -o syslog_name=postfix-mail.abc.comdomain2 unix - - n - - smtp -o smtp_bind_address=2.2.2.2 -o smtp_helo_name=mail.xyz.com -o syslog_name=postfix-mail.xyz.com
以下传输器/ etc / postfix / sender_transport也在main.cf中定义:
@abc.com domain1:@xyz.com domain2:
重新启动postfix后,它停止侦听端口25:
[root@postfix-2.11.3]# telnet 1.1.1.1 25Trying 1.1.1.1...telnet: connect to address 1.1.1.1: Connection refused
但是,如果我在master.cf中使用以下行,它会在25上监听,如果我telnet,我可以看到横幅:
1.1.1.1:smtp inet n - n - - smtpd -o myhostname=mail.abc.com 2.2.2.2:smtp inet n - n - - smtpd -o myhostname=mail.xyz.com
但我想告诉我的邮件服务器,当你发送电子邮件时使用特定域名就像sender_transport一样
我做错了什么?
笔记:
我从master.cf中删除了以下行,并替换为上面的domain1和domain2:
smtp inet n - n - - smtpd解决方法 解决方案 – 需要Postfix 2.7或更高版本:
/etc/postfix/master.cf
#smtp inet n - n - - smtpd127.0.0.1:smtp inet n - n - - smtpd -o syslog_name=postfix-localhost -o smtp_helo_name=localhost -o smtp_bind_address=127.0.0.1 -o myhostname=localhost65.xxx.xxx.100:smtp inet n - n - - smtpd -o syslog_name=postfix-mail.abc.com -o smtp_helo_name=mail.abc.com -o smtp_bind_address=65.xxx.xxx.100 -o myhostname=mail.abc.com65.xxx.xxx.200:smtp inet n - n - - smtpd -o syslog_name=postfix-mail.xyz.com -o smtp_helo_name=mail.zyx.com -o smtp_bind_address=65.xxx.xxx.200 -o myhostname=mail.xyz.comabc-out unix - - n - - smtp -o smtp_bind_address=65.xxx.xxx.100 -o smtp_helo_name=mail.abc.com -o syslog_name=postfix-mail.abc.comxyz-out unix - - n - - smtp -o smtp_bind_address=65.xxx.xxx.200 -o smtp_helo_name=mail.xyz.com -o syslog_name=postfix-mail.xyz.com
/etc/postfix/main.cf中
sender_dependent_default_transport_maps = hash:/etc/postfix/sender_transport
/等/后缀/ sender_transport
# Use source IP - 65.xxx.xxx.100@abc.com abc-out:@example.com abc-out:# Use source IP - 65.xxx.xxx.200 @xyz.com xyz-out:
运行命令以生成哈希数据库
postmap hash:/etc/postfix/sender_transport
重新启动/重新加载后缀
service postfix reload
测试
[root@localhost ~]# telnet 65.xxx.xxx.200 25Trying 65.xxx.xxx.200...Connected to 65.xxx.xxx.200.Escape character is '^]'.220 mail.xyz.com ESMTP Postfix
发送电子邮件测试
[root@localhost ~]# telnet localhost 25Trying ::1...telnet: connect to address ::1: Connection refusedTrying 127.0.0.1...Connected to localhost.Escape character is '^]'.220 localhost ESMTP Postfixhelo localhost250 localhostmail from: spatel@xyz.com250 2.1.0 Okrcpt to: spatel@gmail.com250 2.1.5 Okdata354 End data with <CR><LF>.<CR><LF>Hello World!.250 2.0.0 Ok: queued as 93E708207BA
得到gmail收件箱>显示原始
Delivered-To: spatel@gmail.comReceived: by 10.xxx.xxx.xxx with SMTP ID w64csp782609qgd; Tue,9 Dec 2014 09:35:57 -0800 (PST)X-Received: by 10.xxx.xxx.xxx with SMTP ID o28mr4132552yha.168.1418146557180; Tue,09 Dec 2014 09:35:57 -0800 (PST)Return-Path: <spatel@xyz.com>Received: from mail.xyz.com ([65.xxx.xxx.200]) by mx.Google.com with ESMTPS ID n10si743294ykc.114.2014.12.09.09.35.56 for <spatel@gmail.com> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue,09 Dec 2014 09:35:56 -0800 (PST)......Message-ID: <20141209173720.93E708207BA@localhost.localdomain>Date: Tue,9 Dec 2014 12:37:11 -0500 (EST)From: spatel@xyz.comHello World!
瞧!看到它使用65.xxx.xxx.200 IP地址发送电子邮件..
Received: from mail.xyz.com ([65.xxx.xxx.200])总结
以上是内存溢出为你收集整理的linux – postfix多个IP SMTP横幅全部内容,希望文章能够帮你解决linux – postfix多个IP SMTP横幅所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)