问题
如何测试一个消息或保证它的内容过滤器工作如设计?
过滤器可以测试保证他们适当地工作在调试过滤器旁边。调试过滤器是要求系统检疫范围的一个两步进程。
创建在GUI被呼叫的‘FilterDebug的’新的系统检疫。检疫被配置在‘Monitor->Quarantines下。 如果有可用若干检疫的空间,请点击‘添加检疫’按钮配置FilterDebug检疫。 如果没有可用足够的空间,您将必须编辑使用使若干空闲空间可用的若干其他检疫和更低空间。
用规则创建过滤器(匹配标准)您期望使用和设置动作“检疫(‘FilterDebug’)”。
调试您配比的规则, enable (event)在适当的邮件策略的过滤器(其中您在生产打算它运作)和生成数据流。
匹配您的规则的消息将进入FilterDebug检疫,您能检查他们和满足自己您的规则精密地配比什么您想要。 从检疫发布那些消息,并且通常将提供他们。 如果要有一阵子观看此,请设置检疫保留阶段对某事可接受短缺并且定期检查检疫发现什么样的消息匹配您的标准。
要调试您的过滤器操作,请创建只有一个测试接收人的一个新的邮件策略。禁用您的在其他邮件策略的规则和enable (event)它在此新的邮件策略。 编辑您的规则采取您希望的行动。 您能删除检疫规则。
生成数据流并且检查消息,被提供(或没有,根据您的过滤器)到测试接收人验证这是什么您想要。现在您能enable (event)在邮件策略的完整规则您的生产配置的和禁用它从测试接收人策略。
一个相似的程序可以使用调试消息过滤器。 通过建立您在生产要使用的标准开始:
RedirectEarningsReports:
if (recv-listener == "InboundMail")
and (subject == "(?i)quarterly earnings") {
quarantine ("FilterDebug");
}
这在CLI执行:
smtp.example.com>filters
Choose the operation you want to perform:
- NEW - Create a new filter.
- DELETE - Remove a filter.
- IMPORT - Import a filter script from a file.
- EXPORT - Export filters to a file
- MOVE - Move a filter to a different position.
- SET - Set a filter attribute.
- LIST - List the filters.
- DETAIL - Get detailed information on the filters.
- LOGCONFIG - Configure log subscriptions used by filters.
- ROLLOVERNOW - Roll over a filter log file.
[]> new
Enter filter script. Enter '.' on its own line to end.
RedirectEarningsReports:
if (recv-listener == "InboundMail")
and (subject == "(?i)quarterly earnings") {
quarantine ("FilterDebug");
}
.
1 filters added.
Choose the operation you want to perform:
- NEW - Create a new filter.
- DELETE - Remove a filter.
- IMPORT - Import a filter script from a file.
- EXPORT - Export filters to a file
- MOVE - Move a filter to a different position.
- SET - Set a filter attribute.
- LIST - List the filters.
- DETAIL - Get detailed information on the filters.
- LOGCONFIG - Configure log subscriptions used by filters.
- ROLLOVERNOW - Roll over a filter log file.
[]>
smtp.example.com >commit
Please enter some comments describing your changes:
[]> add RedirectEarningsReports filter test actions (incomplete)
Changes committed: Wed Nov 24 12:00:10 2004 MST
检查被检疫的消息使用GUI并且发布消息。 这样观看消息流的Continue,直到您是满足的。 其次,请添加您的测试接收人到规则,并且更改动作到什么您在生产要运行:
RedirectEarningsReports:
if (recv-listener == "InboundMail")
and (subject == "(?i)quarterly earnings")
and (rcpt-to == "(?i)alan@exchange\\.scu\\.com$") {
alt-rcpt-to ("sam@exchange.scu.com");
}
在CLI中,您需要删除和再创过滤器:
smtp.example.com> filters
Choose the operation you want to perform:
- NEW - Create a new filter.
- DELETE - Remove a filter.
- IMPORT - Import a filter script from a file.
- EXPORT - Export filters to a file
- MOVE - Move a filter to a different position.
- SET - Set a filter attribute.
- LIST - List the filters.
- DETAIL - Get detailed information on the filters.
- LOGCONFIG - Configure log subscriptions used by filters.
- ROLLOVERNOW - Roll over a filter log file.
[]> list
Num Active Valid Name
1 N Y betatest
2 N Y StripInboundExes
3 Y Y RedirectEarningsReports
Choose the operation you want to perform:
- NEW - Create a new filter.
- DELETE - Remove a filter.
- IMPORT - Import a filter script from a file.
- EXPORT - Export filters to a file
- MOVE - Move a filter to a different position.
- SET - Set a filter attribute.
- LIST - List the filters.
- DETAIL - Get detailed information on the filters.
- LOGCONFIG - Configure log subscriptions used by filters.
- ROLLOVERNOW - Roll over a filter log file.
[]> delete
Enter the filter name, number, or range:
[]> 3
1 filters deleted.
Choose the operation you want to perform:
- NEW - Create a new filter.
- DELETE - Remove a filter.
- IMPORT - Import a filter script from a file.
- EXPORT - Export filters to a file
- MOVE - Move a filter to a different position.
- SET - Set a filter attribute.
- LIST - List the filters.
- DETAIL - Get detailed information on the filters.
- LOGCONFIG - Configure log subscriptions used by filters.
- ROLLOVERNOW - Roll over a filter log file.
[]> new
Enter filter script. Enter '.' on its own line to end.
RedirectEarningsReports:
if (recv-listener == "InboundMail")
and (subject == "(?i)quarterly earnings")
and (rcpt-to == "(?i)alan@exchange\\.scu\\.com$") {
alt-rcpt-to ("sam@exchange.scu.com");
}
.
1 filters added.
Choose the operation you want to perform:
- NEW - Create a new filter.
- DELETE - Remove a filter.
- IMPORT - Import a filter script from a file.
- EXPORT - Export filters to a file
- MOVE - Move a filter to a different position.
- SET - Set a filter attribute.
- LIST - List the filters.
- DETAIL - Get detailed information on the filters.
- LOGCONFIG - Configure log subscriptions used by filters.
- ROLLOVERNOW - Roll over a filter log file.
[]>
smtp.example.com> commit
Please enter some comments describing your changes:
[]> set RedirectEarningsReports to test recipient
Changes committed: Wed Nov 24 12:10:07 2004 MST
验证动作执行什么您想要。 (根据您的过滤器,您可以也验证某些在mail_logs的动作。) 前,请通过去除测试接收人汇集终滤器:
RedirectEarningsReports:
if (recv-listener == "InboundMail")
and (subject == "(?i)quarterly earnings") {
alt-rcpt-to ("sam@exchange.scu.com");
}
过滤器和检疫的一个潜在混乱的方面是消息正文处理与信息标题。 在ESA中,消息正文和报头涉及分开。如果在适用动作以后检查在检疫的消息,您将看不到所有报头处理完成对消息(但是它将完成在发运。) 这,平行,是因为报头处理分开完成,因为消息通过传递途径进步。 消息与其在发运前的(潜在被修改的)报头在检疫团聚,但是看不到。 您将看到对消息的正文的所有变化,例如附件标记剥离或的页脚,在检疫上。