AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 737641
Accepted
Jacob
Jacob
Asked: 2015-11-20 12:06:37 +0800 CST2015-11-20 12:06:37 +0800 CST 2015-11-20 12:06:37 +0800 CST

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

  • 772

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

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。登录名(对于我的 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,但这给了我相同的结果。

我还尝试用字符串替换要搜索的变量,即:

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 列表中记录的地址/登录名发送电子邮件时添加以下标题

X-SenderTest: different

有小费吗?

非常感谢

smtp
  • 1 1 个回答
  • 753 Views

1 个回答

  • Voted
  1. Best Answer
    Jacob
    2015-12-24T08:16:00+08:002015-12-24T08:16:00+08:00

    此问题的原因是 client_send 值是冒号分隔列表中的多个值。因此,通过将值格式化如下来解决问题的解决方案:

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

相关问题

  • Postfix 或 exim:自动/程序化和转发电子邮件设置

  • 如何将 SMTP 直接从 IIS 6.0 服务器中继到 Exchange 2003 服务器

  • 使用 telnet 或 netcat 发送带有附件的电子邮件

  • 我应该使用什么策略在 linux 上安装 smtp 服务器?用于多线程服务

  • 适用于 Linux 的 SMTP 服务器,配置简单

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve