1

我正在尝试将自定义标头添加到我的Exim4配置中,以便我的所有电子邮件都显示在 CloudWatch 中。为了让它工作,我更新了以下配置:

.ifdef DCconfig_smarthost DCconfig_satellite
# configtype=smarthost or configtype=satellite
#
# Send all non-local mail to a single other machine (smarthost).
#
# This means _ALL_ non-local mail goes to the smarthost. This will most
# probably not do what you want for domains that are listed in
# relay_domains. The most typical use for relay_domains is to control
# relaying for incoming e-mail on secondary MX hosts. In that case,
# it doesn't make sense to send the mail to the smarthost since the
# smarthost will probably send the message right back here, causing a
# loop.
#
# If you want to use a smarthost while being secondary MX for some
# domains, you'll need to copy the dnslookup_relay_to_domains router
# here so that mail to relay_domains is handled separately.

smarthost:
  debug_print = "R: smarthost for $local_part@$domain"
  driver = manualroute
  headers_add = X-SES-CONFIGURATION-SET: CloudWatch
  headers_add = X-SES-MESSAGE-TAGS: customer=senet, application=twentyfour
  domains = ! +local_domains
  transport = remote_smtp_smarthost
  route_list = * DCsmarthost byname
  host_find_failed = ignore
  same_domain_copy_routing = yes
  no_more

.endif

在我更新路由器上的调试消息并从 CLI 发送电子邮件时显示特定消息的情况下,这实际上效果很好。

当我检查 exim 配置时exim -bP config,我看到那里的信息也设置正确:

begin routers

  smarthost:
    debug_print = "R: smarthost for $local_part@$domain"
    driver = manualroute
    headers_add = X-SES-CONFIGURATION-SET: CloudWatch
    headers_add = X-SES-MESSAGE-TAGS: customer=senet, application=twentyfour
    domains = ! +local_domains
    transport = remote_smtp_smarthost
    route_list = * email-smtp.eu-central-1.amazonaws.com:587 byname
    host_find_failed = ignore
    same_domain_copy_routing = yes
    no_more
    COND_LOCAL_SUBMITTER = "${if match_ip{$sender_host_address}{:@[]}{1}{0}}"

唯一的问题是我在实际电子邮件中看不到这两个标题中的任何一个。

提前致谢,

最好的,皮姆

4

0 回答 0