免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 925 | 回复: 0
打印 上一主题 下一主题

[Mail] sendmail+clamav 在solaris 8 for space 上通过 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-10-14 14:54 |只看该作者 |倒序浏览
网上sendmail杀毒都是用scanmail的,sendmail有milter的API,所以搞了下.成功.发个过程,分享下

How to use Clamav check virus with sendmail

In sendmail,you must enable the libmilter,
In sendmail source directory,
#cd ./libmilter
#./Build
#./Build install

then into the ../devtools/Site,edit the file site.config.m4
add two line:

APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER') #enable the libmilter
APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER_ROOT_UNSAFE ') #use libmilter must be root

Then re-compile the sendmail binary

and compile the sendmail.cf
edit cf/cf/sendmail.mc
add two line:

INPUT_MAIL_FILTER(`clmilter',`S=local:/var/run/clmilter.sock,F=,T=S:4m;R:4m')dnl
define(`confINPUT_MAIL_FILTERS',`clmilter')  #this is for clamav-milter

then:
./Build install-cf

In Clamav
First,you must apply many package on solaris
1.curl-7.12.1
2.openssl-0.9.7d
3.zlib-1.2.1
4.gmp-4.1.2 (this package must be compiled from source code,others can get binary from www.sunfreeware.com)
5.bzip2
6.clamav-0.80rc4

add the clamav account to system

# groupadd clamav
# useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav

then install the clamav,in source code directory
#./configure --sysconfdir=/etc --enable-milter
#make
#make install

after complete,edit /etc/clamd.conf,and /etc/freshclam.conf
in /etc/clamd.conf

comment Example
#Example

enable log
LogFile /var/log/clamd.log

comment LocalSocket /tmp/localhost (I am not remember clear)
add line:
LocalSocket /var/run/clamd.sock

any others you want change

in /etc/freshclam.conf

comment Example
#Example

enable log
logFile ....

# Number of database checks per day.
# Default: 12 (every two hours)
Checks 2

I think update virus database twice everyday is better.

any others you want change

start the clamd daemon
#/usr/local/sbin/clamd

start the auto-update daemon
#/usr/local/bin/freshclam -d

start clamav-milter for sendmail
#/usr/local/sbin/clamav-milter -lo /var/run/clmilter.sock

then restart the sendmail

everything is ok.in every mail head you can see the check virus information.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP