我安装在 centos 6.4 amavis-new 和 clamav
/etc/clamd.d/amavisd
# cat amavisd.conf
# Use system logger.
LogSyslog yes
# Specify the type of syslog messages - please refer to 'man syslog'
# for facility names.
LogFacility LOG_MAIL
# This option allows you to save a process identifier of the listening
# daemon (main thread).
PidFile /var/run/amavisd/clamd.pid
# Remove stale socket after unclean shutdown.
# Default: disabled
FixStaleSocket yes
# Run as a selected user (clamd must be started by root).
User amavis
# Path to a local socket file the daemon will listen on.
LocalSocket /var/spool/amavisd/clamd.sock
/etc/amavisd/amavisd.conf
['ClamAV-clamd',
\&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
qr/\bOK$/, qr/\bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
但是如果我在 /var/log/maillog 中使用病毒进行测试,我会看到
Jul 16 09:46:24 server postfix/qmgr[15064]: 36F0A19F5: from=<[email protected]>, size=407, nrcpt=1 (queue active)
Jul 16 09:46:24 server amavis[16208]: (16208-01) (!)connect to /var/spool/amavisd/clamd.sock failed, attempt #1: Can't connect to UNIX socket /var/spool/amavisd/clamd.sock: 2
Jul 16 09:46:25 server amavis[16208]: (16208-01) (!)connect to /var/spool/amavisd/clamd.sock failed, attempt #1: Can't connect to UNIX socket /var/spool/amavisd/clamd.sock: No such file or directory
Jul 16 09:46:25 server amavis[16208]: (16208-01) (!)ClamAV-clamd: All attempts (1) failed connecting to /var/spool/amavisd/clamd.sock, retrying (2)
Jul 16 09:46:31 server amavis[16208]: (16208-01) (!)connect to /var/spool/amavisd/clamd.sock failed, attempt #1: Can't connect to UNIX socket /var/spool/amavisd/clamd.sock: No such file or directory
Jul 16 09:46:31 server amavis[16208]: (16208-01) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/spool/amavisd/clamd.sock (All attempts (1) failed connecting to /var/spool/amavisd/clamd.sock) at (eval 113) line 600.\n
Jul 16 09:46:31 server amavis[16208]: (16208-01) (!)WARN: all primary virus scanners failed, considering backups
Jul 16 09:46:36 server amavis[16208]: (16208-01) Blocked INFECTED (Eicar-Test-Signature) {DiscardedInbound,Quarantined}, <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: yDd_Z6Hv2PEK, Hits: -, size: 407, 12624 ms
Jul 16 09:46:36 server postfix/lmtp[16336]: 36F0A19F5: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=13, delays=0.11/0/0/13, dsn=2.7.0, status=sent (250 2.7.0 Ok, discarded, id=16208-01 - INFECTED: Eicar-Test-Signature)
Jul 16 09:46:36 server postfix/qmgr[15064]: 36F0A19F5: removed
clamd 正在运行,但在 /var/spool/amavisd isni clamd.sock
ps ax | grep clam
16509 ? Ssl 0:00 clamd
16517 pts/2 S+ 0:00 grep clam
# ls /var/spool/amavisd/
amavisd.sock db quarantine tmp
答案是这样的:
LocalSocket /var/spool/amavisd/clamd.sock
不等于这样:["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
,你需要决定要使用哪一个,然后设置两个程序都使用它。一开始, /var/spool/amavisd/目录中没有clamd.sock文件。如果您按照上述答案更改LocalSocket /var/spool/amavisd/clamd.sock或["CONTSCAN {}\n","/var/run/clamav/clamd.sock"]的路径,则会出现错误,
不需要像上面那样改变。我有同样的问题。所以我只是启动 clamd.amavisd 服务。然后它工作正常。问题是我们没有启动clamd.amavisd 服务,我们只启动 clamd 服务。
然后它会在 /var/spool/amavisd/ 中自动创建 clamd.sock 文件。
不需要像上面那样改变。我有同样的问题。所以我只是启动 clamd.amavisd 服务。然后它工作正常。问题是我们没有启动 clamd.amavisd 服务,我们只启动 clamd 服务。
不,它没有 - 如果你这样做,你会得到一个权限被拒绝的错误。