我需要检索消息的某些部分,看起来像
Subject: Test message
Message-Id: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/report; boundary="----=_Part_fba0c199dfcd4d60ae506b37a6320a84"; report-type=notification
To: [email protected]
Date: Mon, 17 Sep 2018 16:21:45 -0400 (EDT)
From: [email protected]
------=_Part_fba0c199dfcd4d60ae506b37a6320a84
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
BTW, this is the correct notification ... it should be "failed" not "failure".
------=_Part_fba0c199dfcd4d60ae506b37a6320a84
Content-Type: message/notification
Content-Transfer-Encoding: 7bit
Final-Recipient: rfc822; [email protected]
Original-Message-ID: <[email protected]>
------=_Part_fba0c199dfcd4d60ae506b37a6320a84—
例如,我需要获取之后的内容Final-Recipient: rfc822;
并将Original-Message-ID:
它们存储为变量
我试图做类似的事情
if body :raw :contains ["Original-Message-ID:"] {
set "Original-Message-ID" "${0}";
}
但是设置为的变量Original-Message-ID
不包含消息中的内容。
发现身体测试肯定不适用于匹配变量:
https://www.rfc-editor.org/rfc/rfc5173#section-6
MIME Sieve 扩展可能会提供所需 的https://www.rfc-editor.org/rfc/rfc5703或
pipe
向脚本发送消息并在那里处理它,这就是我在我的案例中所做的。