【问题标题】:Procmail split mailing list answerProcmail拆分邮件列表答案
【发布时间】:2013-02-01 11:13:22
【问题描述】:

关于邮件列表的常见道德规范是回复人,并抄送邮件列表,如下所示:

To: help-volounter@dev.full
Cc: some-program@mailing-list.com
Subject: Re: Describtion of the problem

问题是我收到了两份这样的电子邮件(这是预期的)。我想procmail 一份到邮件列表 mbox,另一份到收件箱 mbox。方法简单吗?

【问题讨论】:

    标签: email procmail


    【解决方案1】:

    这并不完全是微不足道的,但有一些你可能会发现有用的构建块。

    您可以通过保存已看到的 message-id:s 的缓存来检测您是否已经收到了一条消息。这是procmailex man page 中更详细描述的标准技术。我建议使用相同的技术来决定将传入消息归档的位置;如果以前没有看过,请发送到您的收件箱;否则,文件到列表的文件夹。

    锁定变得有些复杂,因为您需要在输入formail -D 配方之前获取锁定文件。这可以通过使用LOCKFILE 特殊变量来完成。

    # Is this message addressed both to yourself and to the list?
    :0
    * ^TO_you@example\.net\>
    * ^TO_mailing-list@elsewhere\.example\.org\>
    {
        # Select regular inbox as default target for this message
        dest=$DEFAULT
    
        # Lock msgid.lock for exclusive access to msgid.cache
        LOCKFILE=msgid.lock
    
        # If message-id is already cached, override $dest
        :0
        * H ? formail -D 8192 msgid.cache
        { dest=listbox/ }
    
        # Release lock
        LOCKFILE=
    
        # Deliver to $dest
        :0
        $dest
    }
    

    这不是 100% 万无一失的。例如,如果您得到Bcc:,则您自己的地址不会出现在标题中,因此^TO_ 您自己 将不匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-16
      • 1970-01-01
      • 2020-02-14
      相关资源
      最近更新 更多