exim:远程smtp中继smarthost的不同密码

目前我有我的eximconfiguration设置为使用外部SMTP服务器发送所有电子邮件。 所有用户使用本地密码对我的exim服务器进行身份validation,然后将发送的消息通过智能主机中继到远程SMTP服务器,该服务器与连接到我的exim服务器(运行cPanel)的用户直接使用不同的login名, 。 这是当前的configuration:

remote_route: driver = manualroute domains = !+local_domains transport = remote_transport route_list = * remotesmtpserver.com remote_transport: driver = smtp port = 587 hosts_require_auth = <; $host_address hosts_require_tls = <; $host_address remote_login: driver = plaintext public_name = LOGIN hide client_send = : remote_username : remote_password 

这一切都运作良好,并按预期。

问题是我想为选定的一组用户/发件人使用不同的remote_username和remote_password。 login名(对于我的exim服务器)是完整的电子邮件地址,所以我已经将这些电子邮件地址添加到文件/ etc / differentlogin(即由新行分隔的电子邮件地址列表)。

然后我尝试在remote_login部分进行以下设置:

 remote_login: driver = plaintext public_name = LOGIN hide client_send = ${lookup{$authenticated_id}lsearch{/etc/differentlogin}{: different_username : different_passsword}{: remote_username : remote_password} 

但是当试图发送电子邮件时,这给我以下EXIM错误:

  == [email protected] R=remote_route T=remote_transport defer (-48): expansion of "${lookup{$authenticated_id}lsearch{/etc/differentlogin}{" failed in mandrill_login authenticator: missing } at end of string 

我尝试使用$ sender_address而不是$ authenticated_id,但是这给了我相同的结果。

我也尝试更换variables来search一个string,即:

 remote_login: driver = plaintext public_name = LOGIN hide client_send = ${lookup{[email protected]}lsearch{/etc/differentlogin}{: different_username : different_passsword}{: remote_username : remote_password} 

但我仍然得到相同的错误。

要检查我的条件的语法,我尝试添加以下内容到我的remote_transport:

 headers_add = X-SenderTest: ${lookup{$authenticated_id}lsearch{/etc/differentlogin}{different}{normal}} 

这可按预期工作,并在从/ etc / differentlogin列表中列出的地址/login名发送电子邮件时添加以下标题

 X-SenderTest: different 

有小费吗?

非常感谢

此问题的原因是client_send值是冒号分隔列表中的一些值。 问题的解决scheme因此通过格式化值来修复,如下所示:

 ${lookup{$authenticated_id}lsearch{/etc/differentlogin}{remote_username}{different_username}} : ${lookup{$authenticated_id}lsearch{/etc/differentlogin}{remote_password}{different_passsword}}