【问题标题】:How do you create a newsletter using Exim filter?您如何使用 Exim 过滤器创建时事通讯?
【发布时间】:2017-05-03 19:34:47
【问题描述】:

我想使用 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

【问题讨论】:

    标签: exim


    【解决方案1】:

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

    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
    

    【讨论】:

    • 您能再解释一下吗?这如何允许给定的贡献者列表?
    • 使用别名文件将伪地址映射到收件人列表
    • 投稿人怎么样?- 人们(这里是 eric 和 graham)被允许发布时事通讯?
    【解决方案2】:

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

    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/exim/mailinglists/list01

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

    向邮件列表“list01”发送测试消息

    echo body | mail -s Test list01@mailinglist
    

    【讨论】:

    • 如上:贡献者呢?-人们(这里是 eric 和 graham)被允许发布时事通讯?
    猜你喜欢
    • 2011-06-21
    • 2012-03-08
    • 2012-01-10
    • 2015-09-24
    • 1970-01-01
    • 1970-01-01
    • 2011-02-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多