通过 exim4 指定用于邮件的远程端口
我有一个 Debian Etch 系统,使用 Exim4。 这些域大部分是本地的,但也有一些是远程的。 为了处理远程邮件的传递,我使用 Debian 配置文件:
/etc/exim4/hubbed_hosts
该文件列出了域名和要传递到的远程 MX 计算机。 例如:
example.org: mx.example.com
example.com: mx2.example.com
查看 exim4 配置文件,我发现它的使用方式如下:
hubbed_hosts:
debug_print = "R: hubbed_hosts for $domain"
driver = manualroute
domains = "${if exists{CONFDIR/hubbed_hosts}\
{partial-lsearch;CONFDIR/hubbed_hosts}\
fail}"
route_data = ${lookup{$domain}partial-lsearch{CONFDIR/hubbed_hosts}}
transport = remote_smtp
我遇到的问题是我正在使用的一些主机需要将其邮件传递到非标准端口。 不幸的是,如果我尝试更改 Debian hubbed_hosts 文件以包含端口,则该文件无法工作:
example.org: mx1.example.org:2525
example.com: 1.2.3.4.2525
Is it possible todynamicly allowed the port to be specified?
I've got a stock Debian Etch system, using Exim4. The domains are mostly local but there are some that are remote. To handle the delivery of remote mail I use the Debian configuration file:
/etc/exim4/hubbed_hosts
This file lists the domain names, and remote MX machines to deliver to. For example:
example.org: mx.example.com
example.com: mx2.example.com
Looking at the exim4 configuration file I see that this used as follows:
hubbed_hosts:
debug_print = "R: hubbed_hosts for $domain"
driver = manualroute
domains = "${if exists{CONFDIR/hubbed_hosts}\
{partial-lsearch;CONFDIR/hubbed_hosts}\
fail}"
route_data = ${lookup{$domain}partial-lsearch{CONFDIR/hubbed_hosts}}
transport = remote_smtp
The issue I have is that some of the hosts I'm using need to have their mail delivered to a non-standard port. Unfortunately the Debian hubbed_hosts file doesn't work if I try to change it to include a port:
example.org: mx1.example.org:2525
example.com: 1.2.3.4.2525
Is it possible to dynamically allow the port to be specified?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这实际上是默认支持的,无需对 exim4 配置进行任何更改。
在 hubbed_hosts 中,您可以使用冒号分隔主机,并使用双冒号指定端口号。
例如:
有关更多信息,请查看 http:// www.exim.org/exim-html-current/doc/html/spec_html/ch20.html#SECID122
This is actually supported by default without any changes to your exim4 config.
In hubbed_hosts, you separate hosts with a colon, and you specify a port number with a double-colon.
EX:
For more info check out http://www.exim.org/exim-html-current/doc/html/spec_html/ch20.html#SECID122
我希望有一些更动态的东西 - 这个解决方案有效:
然后一个简单的文件可能有每个域的端口列表:
I was hoping for something a little more dynamic - and this solution works:
Then a simple file may have a list of ports on a per-domain basis:
您可以使用 ${extract} 运算符来组合端口号和主机名,就像原始问题中的示例一样。
像(未经测试)的东西:
You could probably use the ${extract} operator to let you combine the port numbers and host names, like in the example in your original question.
Something like (untested):
创建指定端口的新传输
,然后为需要非标准传输的域创建路由器
make a new transport that specifies the port
and then create a router for the domains needing non-standard delivery