Email Exim:以密件抄送中的收件人为基础转发

Email Exim:以密件抄送中的收件人为基础转发,email,filter,exim,bcc,exim4,Email,Filter,Exim,Bcc,Exim4,目前,我正在通过.forward以以下方式过滤传入邮件: if $header_to: matches "(office|info)@domain.com" then save Maildir/.office/ endif if $header_to: matches "whatever@domain.com" then save Maildir/.whatever/ endif 所以我有一个邮件帐户,它接收不同地址的邮件。基本上,我希望他们根据邮件发送到的地址,在不同的分区着

目前,我正在通过.forward以以下方式过滤传入邮件:

if $header_to: matches "(office|info)@domain.com" then
    save Maildir/.office/
endif
if $header_to: matches "whatever@domain.com" then
    save Maildir/.whatever/
endif
所以我有一个邮件帐户,它接收不同地址的邮件。基本上,我希望他们根据邮件发送到的地址,在不同的分区着陆

这适用于收件人位于
收件人
-标题中的邮件,但如果收件人位于
密件抄送
标题中则不起作用

当收到使用
密件抄送
-标题发送的邮件时,只有
信封至
-标题与邮件送达的实际地址匹配,并且在
已接收
-标题中提及

Envelope-to: office@domain.com

Received: from mail.other.domain ([1.1.1.1])
    by mail.domain.com with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
    (Exim 4.71)
    (envelope-from <sender@other.domain>)
    id 1RO5xc-0001TF-Qj
    for office@domain.com; Wed, 09 Nov 2011 12:04:57 +0100
...
To: can_be_anything@whatever.com
但这不起作用,即使使用
发送至
-标题发送邮件,邮件也不会被过滤(看起来在转发文件中,
信封至
-标题不可用)。我是否应该尝试解析(多个)
接收的
-头


如何根据真实的收件人地址将邮件移动到收件人的子目录中?

看来我终于找到了答案

if $original_local_part matches "office|info" then
    save Maildir/.office/
endif

这只检查本地部分,但afaik也可以扩展到使用域,使用
$original\u domain
(请参阅)

变量
$recipients
包含所有(
抄送
密件抄送
)收件人。你试过了吗

if $original_local_part matches "office|info" then
    save Maildir/.office/
endif