configurationexim使用远程smtp与authentication

我有一个专门的服务器与它的进出口。 我还在hostgator上有一个正式的共享主机帐户(“sharedhostingdomain.com”)。 我想configurationexim总是使用hostgator的smtp服务器(“mail.sharedhostingdomain.com”)来发送邮件。

问题是,hostgator的smtp服务器显然需要身份validation,并在不同的端口(26)。 由于我确实拥有合法帐户,所以我拥有访问凭据,但是我不知道如何强制使用exim来始终使用该SMTP服务器,而不是直接连接到收件人的smtp服务器,以及在哪里指定访问凭据。

正如Daniel所说,你需要将eximconfiguration为一个智能主机。 这意味着像这样定义一个路由器( 注意分隔主机名和端口号的双冒号 ):

send_to_smarthost: debug_print = "R: smarthost for $local_part@$domain" driver = manualroute domains = ! +local_domains transport = remote_smtp_smarthost route_list = * smarthost.example.com::26 host_find_failed = defer no_more 

然后是一个可以促使authentication的运输工具:

 remote_smtp_smarthost: debug_print = "T: remote_smtp_smarthost for $local_part@$domain" driver = smtp hosts_require_auth = smarthost.example.com 

对于很多发行版,现在可以将host:username:password三元组放在/etc/exim/passwd.client ,这应该是正常的。

我相信,不要在路由器中指定端口,而可以在传输中使用port命令。 理论上都应该有效。

我已经做了一些对eximconfiguration感兴趣的东西,但是我可以给你一些基本的指导。 这也取决于你正在运行的是哪个版本的exim,以及哪个发行版本(例如,debian有一个元configuration文件,它为你抽象了很多)。

基本上,你会想configuration一个智能主机,设置为hostgator的SMTP服务器的exim。 (这在过去被称为“路由器”,我认为它仍然是)。

您的路由器configuration的传输将需要被告知使用端口26,而不是端口25.(有一个“端口”variables可以设置)

您还需要设置exim客户端身份validation(例如, 在这里检查“通过一个exim客户端身份validation”

对不起,我不能比这更具体,但希望这足以让你在你的路上。