簡介
本文說明如何使用郵件安全裝置(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附件。
此通知消息將同時傳送給傳送者和收件人,主題行[StripInboundMP3]MP3是不允許的;它將預設設定為Mail Delivery System MAILER-DAEMON@smtp.example.com的返迴路徑設定為發件人。該消息包含mp3.strip.notify消息以及前面提到的通知消息的內容。
請謹慎通知發件人。由於大多數電子郵件都是垃圾郵件,因此前面介紹的郵件過濾器會生成針對垃圾郵件和病毒傳送者的通知,這些通知通常無法傳送。還可以將該過濾器建立為內容過濾器。在反垃圾郵件和防病毒處理郵件後應用內容過濾器。通知內容過濾器中的發件人比郵件過濾器中的發件人更合理,但前提是丟棄垃圾郵件和病毒附件。