在 imta.cnf 文件(负责向后端邮件存储主机发送邮件)中添加重写规则。示例:
msg_store1.siroe.com $U@msg_store1.siroe.com
使用 destinationspamfilterXoptin 关键字添加与该重写规则对应的通道。示例:
tcp_msg_store1 smtp subdirs 20 backoff “pt5m” “pt10” “pt30” “pt1h” \ “pt2h” “pt4h” maxjobs 1 pool IMS_POOL fileinto $U+$S@$D \ destinationspamfilter 1optin spam,virus msg_store1.siroe.com
示例 2。对所有通过 MTA 的外来邮件进行垃圾邮件过滤(通常情况下,所有外来邮件都通过 tcp_local 通道):
tcp_local smtp mx single_sys remotehost inner switchchannel \ identnonelimited subdirs 20 maxjobs 7 pool SMTP_POOL \ maytlsserver maysaslserver saslswitchchannel tcp_auth \ sourcespamfilter1optin spam tcp-daemon
示例 3。过滤所有通过 MTA 外发到 Internet 的邮件。(通常情况下,所有外发到 Internet 的邮件都通过 tcp_local 通道。)
tcp_local smtp mx single_sys remotehost inner switchchannel \ identnonelimited subdirs 20 maxjobs 7 pool SMTP_POOL \ maytlsserver maysaslserver saslswitchchannel tcp_auth \ destinationspamfilter1optin spam tcp-daemon
示例 4。过滤所有通过 MTA 的外来和外发邮件:
tcp_local smtp mx single_sys remotehost inner switchchannel \ identnonelimited subdirs 20 maxjobs 7 pool SMTP_POOL \ maytlsserver maysaslserver saslswitchchannel tcp_auth \ sourcespamfilter1optin spam destinationspamfilter1optin spam tcp-daemon
示例 5。过滤所有发送到两层系统中本地邮件存储的邮件,不使用基于用户的选定:
ims-ms smtp mx single_sys remotehost inner switchchannel \ identnonelimited subdirs 20 maxjobs 7 pool SMTP_POOL \ maytlsserver maysaslserver saslswitchchannel tcp_auth \ destinationspamfilter1optin spam tcp-daemon
示例 6。对所有外来和外发邮件进行垃圾邮件和病毒过滤(假定软件可以进行垃圾邮件和病毒过滤):
tcp_local smtp mx single_sys remotehost inner switchchannel \ identnonelimited subdirs 20 maxjobs 7 pool SMTP_POOL \ maytlsserver maysaslserver saslswitchchannel tcp_auth \ destinationspamfilter1optin spam,virus sourcespamfilter1optin \ spam,virus tcp-daemon