我需要检索消息的某些部分,看起来像
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
不包含消息中它后面的内容。
发现 body 测试肯定不适用于匹配变量:
https://tools.ietf.org/html/rfc5173#section-6
与“body”一起使用的通配符表达式不受 [VARIABLES] 中描述的副作用的影响。也就是说,他们不得将匹配变量 (${1}, ${2}...) 设置为与匹配模式中的通配符序列对应的输入值。
MIME Sieve 扩展可能会提供所需的https://tools.ietf.org/html/rfc5703或pipe
消息到脚本并在那里处理它,我在我的情况下所做的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句