ubuntu下安装设置amavis和clamav
注意内存在3G或更小内,请只安装amavis,4G以上可以考虑安装clamav,否则会卡死
一、升级系统
apt-get update -y
apt-get upgrade -y
二、安装配置amavis
2.1安装amavis和支持组件
apt-get install amavisd-new -y
apt-get install arj cabextract cpio rpm2cpio file gzip lhasa pax rar unrar p7zip-full unzip zip lrzip liblz4-tool lzop unrar-free nomarch bzip2 lzip
2.2配置amavis
编辑/etc/amavis/conf.d/05-node_id文件取消注释,注意换成你自己的域名
$myhostname = "mail.loshub.com";
2.3、集成到postfix上去
2.3.1编辑/etc/postfix/main.cf在最后面的下一行加入以下内容
#amavis
content_filter = smtp-amavis:[127.0.0.1]:10024
smtpd_proxy_options = speed_adjust
2.3.2编辑/etc/postfix/master.cf文件在最后面的下一行加入以下内容
smtp-amavis unix - - n - 2 smtp
-o syslog_name=postfix/amavis
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
-o smtp_tls_security_level=none
127.0.0.1:10025 inet n - n - - smtpd
-o syslog_name=postfix/10025
-o content_filter=
-o mynetworks_style=host
-o mynetworks=127.0.0.0/8
-o local_recipient_maps=
-o relay_recipient_maps=
-o strict_rfc821_envelopes=yes
-o smtp_tls_security_level=none
-o smtpd_tls_security_level=none
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_end_of_data_restrictions=
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings
2.4加入系统启动amavis
systemctl enable amavis
systemctl start amavis
amavis安装完成了
三、安装clamav程序
apt install clamav clamav-daemon -y
systemctl restart clamav-daemon
adduser clamav amavis
编辑
/etc/amavis/conf.d/15-content_filter_mode,取消以下注释
@bypass_virus_checks_maps = (
/%bypass_virus_checks, /@bypass_virus_checks_acl, /$bypass_virus_checks_re);
systemctl restart amavis clamav-daemon
版权申明
本文系作者 @天边的云 原创发布在Loshub站点。未经许可,禁止转载。
暂无评论数据