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 / 问题 / 747568
Accepted
mikhailian
mikhailian
Asked: 2016-01-09 00:31:10 +0800 CST2016-01-09 00:31:10 +0800 CST 2016-01-09 00:31:10 +0800 CST

如何根据 From:Debian 上 exim4 中的地址选择智能主机

  • 772

我想路由带有 From: through 的电子邮件和带有 From: .*@host1.comthrough的smtp.server1.com电子邮件。.*@host2.comsmtp.server2.com

目前,我已将 smarthost 配置为dpkg-reconfigure exim4-config包含update-exim4.conf.conf该行 dc_smarthost='smtp.server1.com::587'。也就是说,一切都通过smtp.server1.com.

我尝试在配置文件中的定义之前添加另一个路由器smarthost:,设置senders = .*@host2.com

smarthost_server2:
  debug_print = "R: smarthost_server2 for $local_part@$domain"
  driver = manualroute
  domains = ! +local_domains
  transport = remote_smtp_smarthost
  senders = .*@host2.com
  route_list = * smtp.server2.com byname
  host_find_failed = ignore
  same_domain_copy_routing = yes
no_more

但 exim 仍然通过smtp.server1.com. 我senders是否正确使用条件?

AFAIU,对于有电子邮件的人来说,这应该是一个相当常见的设置。@google.com 和 . @gmail.com 不想在他们的@gmail.com 电子邮件标题中透露他们也是谷歌员工的事实,所以路由应该不同。

smtp exim smarthost
  • 1 1 个回答
  • 2161 Views

1 个回答

  • Voted
  1. Best Answer
    mikhailian
    2016-01-09T05:04:22+08:002016-01-09T05:04:22+08:00

    好,我知道了。senders是 /etc/mailname 提供的,而不是 From 的域部分:

    以下作品:

    begin routers
    
    smarthost1:
      driver = manualroute
      domains = ! +local_domains
      condition = ${if match_domain{${domain:$h_From:}}{domain.com}{yes}{no}}
      transport = remote_domain_com_smtp
      route_data = domain.com::587
      ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1
    
    smarthost2:
      driver = manualroute
      domains = ! +local_domains
      condition = ${if match_domain{${domain:$h_From:}}{domain.org}{yes}{no}}
      transport = remote_domain_org_smtp
      route_data = domain.org::587
      ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1
    
    
    begin transports
    
    remote_domain_com_smtp:
      driver = smtp
      message_size_limit = ${if > {$max_received_linelength}{998} {1}{0}}
      hosts_require_auth = domain.com
      headers_remove = received
      return_path = ${address:$h_from:}
    
    
    remote_domain_org_smtp:
      driver = smtp
      message_size_limit = ${if > {$max_received_linelength}{998} {1}{0}}
      hosts_require_auth = domain.org
      return_path = ${address:$h_from:}
    

    wheredomain.com和domain.org分别是我要选择的域。

    • 5

相关问题

  • 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