已阅读5页,还剩8页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
使用 Linux + Postfix + Cyrus-sasl + Courier-imap + Tmail3.0 + spamassassin + Clamav + mailscanner ,来架构一个具有多域名,有邮件列表、webmail、防病毒、防垃圾邮件、web管理界面的邮件系统。系统主要采用 MailScanner + clamav + Spamassassin 来对病毒过滤和垃圾邮件过滤。在CentOS、REDHATas上安装测试通过,病毒过滤放弃采用amavisd。主要采用执行效率更高的MailSanner来对邮件过滤和垃圾邮件过滤,配置更容易,并且降低了系统开消。让系统更加稳定,经过严格病毒邮件测试成功率达到了100%。垃圾邮件过滤基本上达到了95%的成功率。+正文+0、演示地址:用户名:密码:demo1.、安装系统安装之前:因用户数据都保存在/var目录下,因此安装系统时/var的空间应尽量大。系统的版本为最小化安装,软件包只安装只装开发包 (development)。在文档中假设服务器的ip地址为,域名为,主机名为。所需的软件包我都打包好了。下载地址: /soft/src.tar.gz仔细一些,注意空格和TAB。2.关闭selinuxrootmail# vi /etc/selinux/configSELINUX=disablerootmail# reboot3、设置YUMrootmail yum.repos.d vi CentOS-Base.repobasename=CentOS-4.2 - Basebaseurl=/centos/4.2/os/$basearch/gpgcheck=1gpgkey=/centos/RPM-GPG-KEY-centos4#released updatesupdatename=CentOS-4.2 - Updatesbaseurl=/centos/4.2/updates/$basearch/gpgcheck=1gpgkey=/centos/RPM-GPG-KEY-centos4#packages used/produced in the build but not releasedaddonsname=CentOS-4.2 - Addonsbaseurl=/centos/4.2/addons/$basearch/gpgcheck=1gpgkey=/centos/RPM-GPG-KEY-centos4#additional packages that may be usefulextrasname=CentOS-4.2 - Extrasbaseurl=/centos/4.2/extras/$basearch/gpgcheck=1gpgkey=/centos/RPM-GPG-KEY-centos4#additional packages that extend functionality of existing packagescentosplusname=CentOS-4.2 - Plusbaseurl=/centos/4.2/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=/centos/RPM-GPG-KEY-centos4#contrib - packages by Centos Userscontribname=CentOS-4.2 - Contribbaseurl=/centos/4.2/contrib/$basearch/gpgcheck=1enabled=0gpgkey=/centos/RPM-GPG-KEY-centos4#packages in testingtestingname=CentOS-4.2 - Testingbaseurl=/centos/4.2/testing/$basearch/gpgcheck=1enabled=0gpgkey=/centos/RPM-GPG-KEY-centos4rootmail yum.repos.d# vi dag.repodagname=Dag RPM Repository for Red Hat Enterprise Linuxbaseurl=http:/apt.sw.be/redhat/el$releasever/en/$basearch/daggpgcheck=1enabled=1rootmail yum.repos.d# yum update4、安装mysqlrootmail build#yum install mysql-serverrootmail build#yum install mysql-devel5、安装apacherootmail build#yum install httpd6.安装phprootmail build#yum install phprootmail build#yum install php-mysqlrootmail build#yum install php-gdrootmail build#yum install php-imaprootmail build#yum install vsftpdrootmail build#yum install clamavrootmail build#yum install spamassassinrootmail build#/usr/bin/freshclam设置apache默认:User apache改为User postfix默认Group apache改为Group postfix默认AddDefaultCharset UTF-8改为AddDefaultCharset gb2312新加入:AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps7、安装phpMyAdminrootmail build#tar zxf ./src/phpMyAdmin-.tar.gzrootmail build#mv phpMyAdmin- /var/www/html/dbadmin/rootmail build#cp /var/www/html/dbadmin/libraries/config.default.php /var/www/html/dbadmin/dbadmin/libraries/config.inc.php (line 1.)8、设置数据库rootmail build#mysqlMysql create datases postfix;Mysql use mysql;Mysql INSERT INTO user (host,user,password) VALUES(localhost,postfix,);Mysql update user set password=password(postfix) where User=postfix;Mysql GRANT ALL ON postfix.* TO postfixlocalhost IDENTIFIED BY postfix;Mysql exitrootmail build tar zxf ./src/webmail.tar.gzrootmail build mysql u root p postfix Tmail.sql9、增加postfix的用户和组rootmail build groupadd -g 12345 postfixrootmail build useradd -u 12345 -g 12345 -c postfix -d/dev/null -s/sbin/nologin postfixrootmail build groupadd -g 54321 postdrop10、安装postfixrootmail build tar zxf ./src/postfix-2.2.8.tar.gzrootmail build cd postfix-2.2.8rootmail build patch -p1 /etc/postfix/aliasesrootmail build /usr/bin/newaliasesrootmail build mv /var/mail /var/mail.bakrootmail build mkdir /var/mailrootmail build chown -R postfix:postfix /var/mailrootmail build mv /etc/postfix/main.cf /etc/postfix/main.cf.bakrootmail build vi /etc/postfix/main.cfcommand_directory = /usr/sbinconfig_directory = /etc/postfixdaemon_directory = /usr/libexec/postfixdebug_peer_level = 2html_directory = nomail_owner = postfixmailq_path = /usr/bin/mailqmanpage_directory = /usr/local/mannewaliases_path = /usr/bin/newaliasesqueue_directory = /var/spool/postfixreadme_directory = nosample_directory = /etc/postfixsendmail_path = /usr/sbin/sendmailsetgid_group = postdropunknown_local_recipient_reject_code = 550header_checks = regexp:/etc/postfix/header_checks#NEW ADD#=BASE=myhostname = mydomain = mydestination = $myhostnamelocal_recipient_maps =local_transport = virtual#=MySQL=virtual_alias_maps = mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cfvirtual_gid_maps = static:54321virtual_mailbox_base = /virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cfvirtual_mailbox_limit = 51200000virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cfvirtual_minimum_uid = 125virtual_transport = virtualvirtual_uid_maps = static:12345#=Quota=virtual_create_maildirsize = yesvirtual_mailbox_extended = yesvirtual_mailbox_limit_maps = mysql:/etc/postfix/mysql/mysql_virtual_mailbox_limit_maps.cfvirtual_mailbox_limit_override = yesvirtual_maildir_limit_message = Sorry, the users maildir has overdrawn his diskspace quota, please try again later.virtual_overquota_bounce = yes#=SASL=smtpd_sasl_auth_enable = yessmtpd_sasl_security_options = noanonymousbroken_sasl_auth_clients = yessmtpd_delay_reject=yessmtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,permit_auth_destination,rejectsmtpd_client_restrictions = permit_sasl_authenticatedrootmail build vi mysql_virtual_alias_maps.cfuser = postfixpassword = postfixhosts = localhostdbname = postfixquery = SELECT alias FROM userinfo WHERE address=%s AND active = 1rootmail build vi mysql_virtual_domains_maps.cfuser = postfixpassword = postfixhosts = localhostdbname = postfixquery = SELECT domain FROM domaininfo WHERE domain=%srootmail build vi mysql_virtual_mailbox_limit_maps.cfuser = postfixpassword = postfixhosts = localhostdbname = postfixquery = SELECT quota FROM userinfo WHERE address=%srootmail build vi mysql_virtual_mailbox_maps.cfuser = postfixpassword = postfixhosts = localhostdbname = postfixquery = SELECT maildir FROM userinfo WHERE address=%s AND active = 115、配置sasl认证rootmail build vi /usr/lib/sasl2/smtpd.confpwcheck_method: authdaemondlog_level: 3mech_list: plain loginauthdaemond_path:/usr/lib/authlib/var/socket16、配置courier-imaprootmail build mv /usr/lib/authlib/etc/authlib/authmysqlrc /usr/lib/authlib/etc/authlib/authmysqlrc.bakrootmail build vi /usr/lib/authlib/etc/authlib/authmysqlrcMYSQL_SERVER localhostMYSQL_USERNAME postfixMYSQL_PASSWORD postfixMYSQL_PORT 0MYSQL_OPT 0MYSQL_DATABASE postfixMYSQL_USER_TABLE userinfoMYSQL_CRYPT_PWFIELD passwdMYSQL_UID_FIELD 12345MYSQL_GID_FIELD 54321MYSQL_LOGIN_FIELD addressMYSQL_HOME_FIELD homedirMYSQL_NAME_FIELD realnameMYSQL_MAILDIR_FIELD maildirMYSQL_QUOTA_FIELD quotarootmail build mv /usr/lib/authlib/etc/authlib/authdaemonrc /usr/lib/authlib/etc/authlib/authdaemonrc.bakrootmail build vi /usr/lib/authlib/etc/authlib/authdaemonrcauthmodulelist=authmysqlauthmodulelistorig=authmysqlversion=authdaemond.mysqldaemons=5subsystem=mailDEBUG_LOGIN=0DEFAULTOPTIONS=wbnodsn=1rootmail build vi /usr/lib/imapd/etc/pop3d默认POP3DSTART=NO改为POP3DSTART=YESrootmail build vi /usr/lib/imapd/etc/imapd默认IMAPDSTART=NO改为IMAPDSTART=YESrootmail build chmod +x /usr/lib/authlib/var/17、安装WebMailrootmail build mv Tmail /var/www/html/webmailrootmail build vi /var/www/html/webmail/config/config_inc.php$CFG_BASEPATH = /var/www/html/webmail/temp; /临时目录/ Mysqldefine(MYSQL_HOST, localhost); /数据库主机名define(MYSQL_USER, postfix); /数据库用户名define(MYSQL_PASS, postfix); /数据库密码define(MYSQL_DATA, postfix); /数据库名称$CFG_NETDISK_PATH = /var/mail/netdisk; /文件管理存储目录rootmail build vi /var/www/html/webmail/webadmin/include/config.inc.php/ Mysqldefine(MYSQL_HOST, localhost); /数据库主机名define(MYSQL_USER, postfix); /数据库用户名define(MYSQL_PASS, postfix); /数据库密码define(MYSQL_DATA, postfix); /数据库名称rootmail build mkdir /var/mail/netdiskrootmail build chown R postfix:postfix /var/mail/netdiskrootmail build mkdir /var/www/html/webmail/temprootmail build chown R postfix:postfix /var/www/html/webmail/temprootmail build cp courier-authlib-0.58/courier-authlib.sysvinit /etc/rc.d/init.d/courier-authlibrootmail build chmod 755 /etc/rc.d/init.d/courier-authlibrootmail build chkconfig -add courier-authlibrootmail build cp courier-imap-4.0.6/courier-imap.sysvinit /etc/rc.d/init.d/courier-imaprootmail build chmod 755 /etc/rc.d/init.d/courier-imaprootmail build chkconfig -add courier-imap18、启动服务测试rootmail build chkconfig httpd onrootmail build chkconfig mysqld onrootmail build service httpd startrootmail build service mysqld startrootmail build service courier-authlib startrootmail build service courier-imap startrootmail build postfix start通过后台加入域名和用户名(本文档中的域名为: 、 用户名: )rootmail build perl -MMIME:Base64 -e print encode_base64();dGVzdEB0ZXN0LmNvbQ=rootmail build perl -MMIME:Base64 -e print encode_base64(000000);MDAwMDAwrootmail build telnet localhost 25Trying .Connected to localhost.localdomain ().Escape character is .220 ESMTP Postfixehlo 250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-AUTH PLAIN LOGIN250-AUTH=PLAIN LOGIN250 8BITMIMEauth login334 VXNlcm5hbWU6dGVzdEB0ZXN0LmNvbQ= /用户名()334 UGFzc3dvcmQ6MDAwMDAw / 密码(000000)235 Authentication successful /表示成功验证通过19、安装Clamavrootmail build rpm -import /packages/RPM-GPG-KEY.dag.txtrootmail build rpm -import RPM-GPG-KEY.dag.txtrootmail build rpm -q gpg-pubkey -qf %summary - %version-%releasengpg(CentOS-4 key ) - 443e1821-421f218fgpg(Dag Wieers (Dag Apt Repository v1.0) ) - 6b8d79e6-3f49313drootmail build vi /etc/yum.repos.d/dag.repodagname=Dag RPM Repository for Red Hat Enterprise Linuxbaseurl=http:/apt.sw.be/redhat/el$releasever/en/$basearch/daggpgcheck=1enabled=1rootmail build yum updaterootmail build yum install clamav20、升级病毒库rootmail build /usr/bin/freshclamClamAV update process started at Thu Mar 9 17:23:21 2006main.cvd is up to date (version: 36, sigs: 44686, f-level: 7, builder: tkojm)daily.cvd is up to date (version: 1319, sigs: 1376, f-level: 7, builder: ccordes)21、安装Spamassassinrootmail build yum install spamassassinrootmail build service spamassassin start22、安装MailScannerrootmail build tar zxf ./src/MailScanner-4.51.5-1.rpm.tar.gzrootmail build MailScanner-4.51.5-1/install.sh23、设置MailScannerrootmail build chkconfig sendmail offrootmail build chkconfig -level 2345 MailScanner onrootmail build vi /etc/MailScanner/MailScanner.conf%org-name% = %org-long-name% = wooxian%web-site% = %report-dir% = /etc/MailScanner/reports/cnRun As User = postfixRun As Group = postfixIncoming Queue Dir = /var/spool/postfix/holdOutgoing Queue Dir = /var/spool/postfix/incomingMTA = postfixVirus Scanners = clamavAlways Include SpamAssassin Report = yesUse SpamAssassin = yesRequired SpamAssassin Score = 6SpamAssassin User State Dir = /var/spool/MailScanner/spamassassinSpamAssassin Install Prefix = /usr/binSpamAssassin Local Rules Dir = /etc/MailScannerrootmail build yum install unrarrootmail build unrar x ./src/cn.rarrootmail build mv cn /etc/MailScanner/reports/rootmail build mv /etc/postfix/header_check /etc/postfix/header_check.bakrootmail build vi /etc/postfix/header_check/Received:/ HOLDrootmail build chown R postfix:postfix /var/spool/MailScanner/*rootmail build postfix stoprootmail build service MailScanner start24、测试病毒邮件rootmail build telnet localhost 25Trying .Connected to localhost.localdomain
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 商业摄影摄像与后期处理(AI协同)(微课版)课件(项目1-项目3)
- 2026年全国中级导游等级考试大纲
- 从佛得角奇迹看成长的力量 世界杯励志故事·新学期开学第一课
- 供应应急预案措施包括(3篇)
- 企业团建喝茶活动方案策划(3篇)
- 公司人员聚集应急预案(3篇)
- 手机软件后台维护服务协议二篇
- 河北省邢台市2026年重点学校初一入学数学分班考试试题及答案
- 2026年广东省云浮市重点学校初一入学语文分班考试试题及答案
- 2026年内蒙古政府采购评审专家试卷带答案
- 校园消防隐患排查整治
- 钢筋制作后台分包合同
- 国企中层干部竞聘测试题库(+答案)
- DLT595-2025《六氟化硫电气设备气体监督导则》深度解读
- 湖北新八校2026届高三第二次联考(二模)语文试题及参考答案
- 康复机器人市场调研报告
- 白石洲调研报告
- 2026年《必背60题》消防队文员高频面试题包含详细解答
- 2026年中国移动政企客户经理岗位高频面试真题
- KNX智能家居系统培训资料
- 不完全性肠梗阻中医护理方案
评论
0/150
提交评论