Sun Java System Messaging Server 6.3 管理指南

Procedure使用 ClamAV 丢弃被病毒或特洛伊木马感染的电子邮件

以下示例将丢弃所有被 ClamAV 检测到包含病毒或特洛伊木马的邮件。未使用结论字符串。

  1. 创建 ClamAV 配置文件。

    步骤 2 中指定了此文件的名称和位置。clamav.opt 是一个很好的文件名。本文件包含以下各行:


    # more /opt/SUNWmsgsr/config/clamav.opt
    ! ClamAV Settings
    debug=1
    host=127.0.0.1
    port=3310
    mode=1

    debug=1 指定在 ClamAV 库中启用调试。

    hostport 分别指定运行 clamd 的系统的名称,以及 clamd 侦听外来请求的端口。

    mode=1 指定在检测到被病毒感染的电子邮件时,ClamAV 插件返回 ClamAV 结果字符串作为结论。

  2. 修改 option.dat 文件。

    option.dat 文件中添加以下各行:


    ! ClamAV settings 
    spamfilter2_config_file=/opt/SUNWmsgsr/config/clamav.opt 
    spamfilter2_library=/opt/SUNWmsgsr/lib/libclamav.so 
    spamfilter2_string_action=data:,require ["jettison"]; jettison;

    spamfilter2_config_file 指定 ClamAV 配置文件。

    spamfilter2_library 指定 ClamAV 共享库。

    spamfilter2_string_action 指定对感染病毒的电子邮件采取的 Sieve 操作。

  3. 指定要过滤的邮件。

    要过滤传入本地消息存储的所有邮件,请通过在 ims-ms 通道中添加 destinationspamfilterXoptin 病毒关键字来更改 imta.cnf 文件:


    !
    ! ims-ms 
    ims-ms defragment subdirs 20 notices 1 7 14 21 28 backoff "pt5m" "pt10m"
    "pt30m" "pt1h" "pt2h" "pt4h" maxjobs 4 pool IMS_POOL fileinto 
    $U+$S@$D destinationspamfilter2optin virus 
    ims-ms-daemon
  4. 重新编译配置并重新启动服务器。

    只需要重新启动 MTA。无需执行 stop-msg。


     # imsimta cnbuild
    # imsimta restart
  5. 启动 clamd 守护进程。