如何使用Exim过滤器创建新闻稿?

时间:2017-05-03 19:34:48

标签: exim

我想使用Exim过滤器文件来创建新闻稿:接受来自指定参与者地址的邮件,然后转发到指定的订阅者地址。以下是有效的,但有更优雅和稳健的方法吗?

# Exim filter
if
    $reply_address contains "eric@i.com" or
    $reply_address contains "graham@c.com"
then
    seen 
    deliver john@c.com
    deliver michael@p.com
    deliver terry@gj.com
endif

2 个答案:

答案 0 :(得分:0)

使用发件人地址确定收件人是不寻常的。我只是一个别名文件。您可以将其基于系统别名路由器:

<强> exim.conf

system_aliases:

  driver = redirect
  allow_fail
  allow_defer
  data = ${lookup{$local_part}lsearch{/etc/aliases}}
  file_transport = address_file
  pipe_transport = address_pipe

<强>的/ etc /别名

mailinglist: john@c.com, michael@p.com, terry@gj.com

答案 1 :(得分:0)

使用此配置将邮件列表维护在一个文件中,每行一个地址。

<强> exim.conf

# append "mailinglist" to local domains so that "mailinglist" is
# recognized as a domain we handle.  Alternatively, you could just
# use your own domain and not bother with this

domainlist local_domains = @ : localhost : localhost.localdomain : mydomain.com : mailinglist

...

begin routers

...

mailing_lists:
  driver = redirect
  domains = mailinglist
  no_more
  file = /etc/exim/mailinglists/$local_part
  no_check_local_user
  forbid_pipe
  forbid_file
  errors_to = myusername@mydomain.net

<强>的/ etc /进出口/邮件列表/ list01

john@c.com
michael@p.com
terry@gj.com

将测试邮件发送到邮件列表“list01”

echo body | mail -s Test list01@mailinglist