简介
本文档介绍如何在邮件安全设备(ESA)上将已剥离的附件替换为文本消息。
创建邮件过滤器
许多站点希望在删除附件时提供其他信息。您可以使用邮件过滤器执行此操作,该过滤器允许包含可选注释字段。
以下是邮件过滤器示例:
StripInboundMP3s:
if (recv-listener == "InboundMail") {
drop-attachments-by-filetype ('mp3', 'Corporate policy disallows mp3
attachments. Please contact the helpdesk at x411 for assistance in
transferring binary files.');
}
您可以使用filters命令在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.
StripInboundMP3s:
if (recv-listener == "InboundMail") {
drop-attachments-by-filetype ('mp3', 'Corporate policy disallows mp3 attachments.
Please contact the helpdesk at x411 for assistance in transferring binary files.');
}
.
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 StripInboundMP3s filter
Changes committed: Wed Nov 24 18:32:03 2004 MST
您还可以使用邮件过滤器操作变量来提供详细信息,例如时间戳或发件人。
创建通知消息
另一种方法是发送单独的通知消息来解释策略。这样做的优点是,您可以创建更长、更详细的邮件,也可以将其发送给发件人、收件人或您希望通知的任何其他地址。
要创建通知消息,请使用textconfig CLI命令:
smtp.example.com> textconfig
Current Text Resources:
1. Disclaimer (Message Footer)
2. attach.size.notify (Notification Template)
Choose the operation you want to perform:
- NEW - Create a new text resource.
- IMPORT - Import a text resource from a file.
- EXPORT - Export text resource to a file.
- PRINT - Display the content of a resource.
- EDIT - Modify a resource.
- DELETE - Remove a resource from the system.
[]> new
What kind of text resource would you like to create?
1. Message Footer
2. Notification Template
[1]> 2
Please create a name for the notification template:
[]> mp3.strip.notify
Enter the encoding for the notification template:
1. US-ASCII
2. Unicode (UTF-8)
3. Unicode (UTF-16)
4. Western European/Latin-1 (ISO 8859-1)
5. Western European/Latin-1 (Windows CP1252)
6. Traditional Chinese (Big 5)
7. Simplified Chinese (GB 2312)
8. Simplified Chinese (HZ GB 2312)
9. Korean (ISO 2022-KR)
10. Korean (KS-C-5601/EUC-KR)
11. Japanese (Shift-JIS (X0123))
12. Japanese (ISO-2022-JP)
13. Japanese (EUC)
[1]>
Enter or paste the notification template here. Enter '.' on a blank line to end.
To whom it may concern:
You have attempted to send an MP3 file to a corporate address. It is against
corporate policy to send or receive MP3 files, and the MP3 was stripped
from the message you sent. The other parts of the message were
delivered to the recipient.
If you have any problems or questions regarding this policy, please contact
the Help Desk at x411 or 800-555-1212.
Thank you for your attention to this matter.
Corporate Management
.
Notification template "mp3.strip.notify" created.
Current Text Resources:
1. Disclaimer (Message Footer)
2. attach.size.notify (Notification Template)
3. mp3.strip.notify (Notification Template)
Choose the operation you want to perform:
- NEW - Create a new text resource.
- IMPORT - Import a text resource from a file.
- EXPORT - Export text resource to a file.
- PRINT - Display the content of a resource.
- EDIT - Modify a resource.
- DELETE - Remove a resource from the system.
[]>
smtp.example.com> commit
Please enter some comments describing your changes:
[]> create mp3.strip.notify for notifications
Changes committed: Wed Nov 24 18:52:32 2004 MST
通知操作将邮件的摘要电子邮件发送到指定的电子邮件地址。通知摘要包含信封地址的内容、邮件的邮件信头以及与邮件匹配的邮件过滤器的名称。使用此通知模板的邮件过滤器类似如下:
StripInboundMP3s:
If (recv-listener == "InboundMail")
AND (attachment-filetype == "mp3") {
drop-attachments-by-filetype("mp3");
notify("$EnvelopeSender,$EnvelopeRecipients", "[$FilterName] MP3s not allowed",
"$EnvelopeSender", "mp3.strip.notify");
}
注意:规则现在在删除并发送通知之前检查邮件是否包含mp3附件。
此通知消息将同时发送给发件人和收件人,并且不允许主题行[StripInboundMP3s] MP3;它将默认为“邮件传送系统MAILER-DAEMON@smtp.example.com”的返回路径设置为发件人。该消息包含mp3.strip.notify消息以及之前记录的通知消息的内容。
请注意通知发件人。由于大多数邮件是垃圾邮件,因此,邮件过滤器(如前面介绍的过滤器)会生成通知,通知垃圾邮件和病毒发件人通常无法投递。过滤器也可创建为内容过滤器。在反垃圾邮件和防病毒处理邮件后应用内容过滤器。在内容过滤器中通知发件人比在邮件过滤器中更合理,但前提是您删除垃圾邮件和病毒附件。