postfix垃圾邮件处理

简介:

Clamav安装配置

安装clamav

Shell> groupadd –g 1006 clamav

Shell> useradd –g 1006 –u 1006 –s /bin/false –d /dev/null –c “Clamav Install User” clamav

 

Shell> tar zxvf clamav-0.98.4-r1.tar.gz

Shell> cd clamav-0.98.4-r1

Shell> ./configure –prefix=/data/sw/clamav –with-dbdir=/data/sw/clamav/db

Shell> make && make install

 

Shell> mkdir –p /data/sw/clamav/run /data/sw/clamav/db /data/sw/clamav/logs

Shell> groupadd –g 1007 amavis

Shell> useradd –g 1007 –u 1007 –s /bin/flase –d /dev/null –c “Amavis User” amavis

Shell> chown –R amavis:amavis /data/sw/clamav/run /data/sw/clamav/db /data/sw/clamav/logs

Shell> chmod –R 700 /data/sw/clamav/run

 

Shell> cp /data/sw/clamav/etc/clamd.conf.sample /data/sw/clamav/etc/clamd.conf

Shell> cp /data/sw/clamav/etc/freshclam.conf.sample /data/sw/clamav/etc/freshclam.conf

 

配置clamav

Shell> cd /data/sw/clamav

Shell> vi etc/clamd.conf

注销Example,并修改配置如下

clip_image002

Shell> vi etc/freshclam.conf

注销Example并修改配置如下

clip_image004

升级病毒库

Shell> cd /data/sw/clamav

Shell> bin/freshclam

启动clamav

Shell> /data/sw/clamav/sbin/clamd

病毒库自动更新

Shell> echo “0 4 * * * root /data/sw/clamav/bin/freshclam --quiet --log=/data/sw/clamav/logs/freshclam.conf” >> /etc/crontab

Spamassassin的安装

Shell> tar zxvf Mail-SpamAssassin-3.4.0.tar.gz

Shell> cd Mail-SpamAssassin

Shell> perl Markfile.PL

clip_image005

Fetch的安装

 

Shell> tar zxvf http_fetcher-1.1.0.tar.gz

Shell> cd http_fetcher-1.1.0

Shell> ./configure

Shell> vi src/http_fetcher.c

注释掉781

clip_image007

Shell> make && make install

 

Shell> tar zxvf fetch-1.0.tar.gz

Shell> cd fetch-1.0

Shell> ./configure

Shell> make && make install

 

Curl安装

Shell> tar zxvf fetch-7.37.0.tar.gz

Shell> cd fetch-7.37.0

Shell> ./configure

Shell> make && make install

Gnupg安装

Shell> tar xvf libassuan-2.1.1.tar.bz2

Shell> cd libassuan-2.1.1

Shell> ./configure

Shell> make && make install

 

Shell> tar xvf libgpg-error-1.13.tar.bz2

Shell> cd libgpg-error-1.13

Shell> ./configure

Shell> make && make install

 

Shell> tar xvf libksba-1.3.0.tar.bz2

Shell> cd libksba-1.3.0

Shell> ./configure

Shell> make && make install

 

Shell> tar zxvf pth-2.07.tar.gz

Shell> cd pth-2.07

Shell> ./configure

Shell> make && make install

 

Shell> ldconfig –v

Shell> tar zxvf gnupg-1.4.16.tar.bz2

Shell> cd gnupg-1.4.16

Shell> ./configure

Shell> make && make install

Razor2安装

Geo-IP的安装

Shell> tar zxvf Geo-IP-1.4.3.tar.gz

Shell> cd Geo-IP-1.4.3

Shell> perl Mailfile.PL PP=1

Shell> make && make install

 

perl模块安装

Shell> perl –MCPAN –e shell

Cpan> install HTML::Parser

Cpan> install Net::DNS

Cpan> install Net::DNS::Resolver::Programmable

Cpan> install NetAddr::IP

Cpan> install Digest::SHA1

Cpan> install IO::Socket::IP

Cpan> install IO::Socket::INET6

Cpan> install IO::Socket::SSL

Cpan> install Mail::DKIM

Cpan> install LWP::UserAgent

Cpan> install HTTP::Date

Cpan> install Encode::Detect

Cpan> install Net::Patricia

Cpan> install Time::HiRes

Cpan> install Archive::Tar

Cpan> install MIME::Base64

Cpan> install Mail::SPF

Cpan> install DBI

Cpan> install Net::LDAP

Cpan> install ZeroMQ

Cpan> install SpamAssassin

Cpan> install Razor2::Client::Agent

Cpan> install XML::LibXML::Iterator

更多模块参考SpamAssassin安装目录INSTALL文件

 

Shell> perl Makefile.PL

Shell> make && make install

 

启动

Shell> sa-update –no-gnupg

Shell> spamassassin &

 

Amavisd安装配置

安装amavisd

Shell> tar xvf amavisd-new-2.9.0.tar.xz

Shell> cd amavisd-new-2.9.0

Amavisd和Spamassassin安装需要很多perl module,安装之间先看下INSTALL文件,源码安装太麻烦,如果有联网建议CPAN安装

INSTALL列出先决条件如下:

clip_image009

Perl 模块如下

clip_image011

邮件病毒扫描需求(已经安装)

clip_image013

扩展程序(暂时不安装)

clip_image015

第三方工具(暂时不安装)

clip_image017

Shell> perl –MCAPN –e shell

Cpan> install Archive::Zip

Cpan> install Compress::Zlib

Cpan> install Compress::Raw::Zlib

Cpan> install MIME::Base64

Cpan> install MIME::Parser

Cpan> install Mail::Internet

Cpan> install Net::Server

Cpan> install Digest::MD5

Cpan> install Time::HiRes

Cpan> install Unix::Syslog

Cpan> install Mail::DKIM

Cpan> install IO::Stringy

Cpan> install Convert::BinHex

Cpan> install BerkeleyDB

Cpan> install Unix::Getrusage

cpan> install Image::Info

 

amavisd配置

shell> vi /etc/amavisd.conf

$daemon_user = 'amavis';

$daemon_group = 'amavis';

$mydomain = 'zhengwing.org';

$MYHOME = '/var/amavis';

$TEMPBASE = "$MYHOME/tmp";.

$QUARANTINEDIR = '/var/amavis/var/virusmails';

$db_home = "$MYHOME/db";

$helpers_home = "$MYHOME/home";

$lock_file = "$MYHOME/var/amavisd.lock";

$pid_file = "$MYHOME/var/amavisd.pid";

$unix_socketname = "$MYHOME/var/amavisd.sock";

$myhostname = 'mail.zhengwing.org';

##以上是amavisd.conf基本配置

##以下是amavisd.conf关于clamav配置

['ClamAV-clamd-stream',

\&ask_daemon, ["*", 'clamd:/data/sw/clamav/run/clamd.sock'],

qr/\bOK$/m, qr/\bFOUND$/m,

qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ],

 

Postfix支持amavisd

Shell> vi /etc/postfix/main.cf

clip_image018

Shell> vi /etc/postfix/master.cf

clip_image019

Shell> postfix reload

调试

Shell> /usr/local/sbin/amavisd –u amavis debug

如果有问题,参照调试日志修改

启动

Shell> /usr/local/sbin/amavisd –u amavis &










本文转自 chengchow 51CTO博客,原文链接:http://blog.51cto.com/chengchow/1428783,如需转载请自行联系原作者
目录
相关文章
|
缓存 关系型数据库 MySQL
postfix疯狂外发垃圾邮件之分析与解决
postfix疯狂外发垃圾邮件之分析与解决 本周二上班有人反应公司邮箱无法外发邮件,后来登录到服务器查看原因,不看不知道,一看吓一跳,服务器日志疯狂滚动!一看全是被其它邮件服务器拒绝的信息!由于这台服务器以前不是我管,连配置文件都find了好久,最终从十多个main.
2577 0
postfix反垃圾邮件说明
原文地址:http://guailele.blog.51cto.com/1156442/780223 #1、postfix配置说明(强烈建议参看“postfix权威指南 第十一章 反垃圾邮件”)#fqdn格式:完全限定域名格式,即用点分隔开的包括域名和主机名的主机...
897 0
|
网络协议 安全 数据库
Postfix上的反垃圾邮件的四个方法
原文地址:http://wolfword.blog.51cto.com/4892126/1215656 在介绍如何配置Postfix的smtp配置之前有必要首先介绍一下它的背景和特点。
1678 0
|
网络协议 Linux 文件存储
Postfix 邮件服务器的配置
Postfix是一种功能强大且功能多样的邮件传输代理。在本文中,我们已经了解了如何使用postfix 和 dovecot为基于系统用户帐户的单个域实现基本电子邮件服务器。我们几乎没有涉及基于 postfix 的系统的真正功能,但希望能为新用户构建提供坚实的工作基础。
1804 0
|
存储 网络协议 Linux
Postfix + Extmail 企业邮件服务器搭建
ExtMail套件用于提供从浏览器中登录、使用邮件系统的Web操作界面,而Extman套件用于提供从浏览器中管理邮件系统的Web操作界面。它以GPL版权释出,设计初衷是希望设计一个适应当前高速发展的IT应用环境,满足用户多变的需求,能快速进行开发、改进和升级,适应能力强的webmail系统。
764 0
Postfix + Extmail 企业邮件服务器搭建
|
网络协议 Linux 网络安全
Linux服务器---邮件服务安装postfix
安装postfix      postfix是一个快速、易于管理、安全性高的邮件发送服务,可以配合dovecot实现一个完美的邮箱服务器。1、安装postfix       [root@localhost ~]# rpm -qa | grep postfix      [root@localhos...
2396 0