文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>FC4下yum安装postfix笔记

FC4下yum安装postfix笔记

时间:2007-06-15  来源:szxsztszk


感谢yayaa

注: 本人安装时选择了最小安装,安装后用yum update更新了所有已安装的rpm包,当前内核为(2.6.15-1.1833_FC4smp).
准备工组:DNS测试
# host -t MX yayaa.net
yayaa.net mail is handled by 10 mail.yayaa.net.
# host -t a mail.yayaa.net
mail.yayaa.net has address 192.168.1.188

1.卸载sendmail
#killall sendmail
#rpm –e –nodeps sendmail

2.开始安装
#yum install httpd
依存关系
(1/3): httpd-2.0.54-10.3. 100% |=========================| 935 kB    00:08    
(2/3): apr-0.9.6-3.5.i386 100% |=========================| 105 kB    00:01    
(3/3): apr-util-0.9.6-2.i 100% |=========================|  56 kB    00:01

#yum install mysql-devel
依存安装
(1/4): mysql-devel-4.1.16 100% |=========================| 2.0 MB    00:13    
(2/4): e2fsprogs-devel-1. 100% |=========================| 512 kB    00:03    
(3/4): krb5-devel-1.4.1-5 100% |=========================| 923 kB    00:06    
(4/4): openssl-devel-0.9. 100% |=========================| 1.7 MB    00:10

#yum install mysql-server
依存安装
(1/2): mysql-server-4.1.1 100% |=========================| 5.6 MB    00:36    
(2/2): perl-DBD-MySQL-2.9 100% |=========================| 140 kB    00:02

# yum install php
依存安装
(1/4): php-pear-5.0.4-10. 100% |=========================| 371 kB    00:14    
(2/4): php-5.0.4-10.5.i38 100% |=========================| 2.3 MB    00:24    
(3/4): curl-7.13.1-5.fc4. 100% |=========================| 262 kB    00:01    
(4/4): libidn-0.5.15-1.i3 100% |=========================| 176 kB    00:03

#yum install php-mysql

#yum install php-gd

#yum install php-imap
依存安装
(1/2): php-imap-5.0.4-10. 100% |=========================|  43 kB    00:00    
(2/2): libc-client-2002e- 100% |=========================| 479 kB    00:01

#yum install php-mbstring

#yum install postfix

#yum install postfix-pflogsumm

# yum install dovecot
依存关系
(1/4): perl-DBI-1.48-4.i3 100% |=========================| 571 kB    00:03    
(2/4): postgresql-libs-8. 100% |=========================| 182 kB    00:01    
(3/4): dovecot-0.99.14-4. 100% |=========================| 678 kB    00:03    
(4/4): mysql-4.1.16-1.FC4 100% |=========================| 2.8 MB    00:14 

# yum install sylpheed-claws-plugins-maildir
依存关系
(1/27): gtk+-1.2.10-39.i3 100% |=========================| 885 kB    00:04    
(2/27): dillo-0.8.4-3.i38 100% |=========================| 293 kB    00:08    
(3/27): fedora-usermgmt-s 100% |=========================| 6.5 kB    00:00    
(4/27): sylpheed-claws-pl 100% |=========================|  30 kB    00:02    
(5/27): pinentry-0.7.1-4. 100% |=========================|  53 kB    00:01    
(6/27): gdk-pixbuf-0.22.0 100% |=========================| 225 kB    00:01    
(7/27): clamav-lib-0.88-1 100% |=========================| 151 kB    00:04    
(8/27): gnupg2-1.9.20-2.f 100% |=========================| 895 kB    00:16    
(9/27): perl-Net-DNS-0.49 100% |=========================| 194 kB    00:00    
(10/27): glib-1.2.10-16.i 100% |=========================| 130 kB    00:00    
(11/27): pth-2.0.6-1.fc4. 100% |=========================|  87 kB    00:01    
(12/27): perl-Time-HiRes- 100% |=========================|  22 kB    00:00    
(13/27): pilot-link-0.12. 100% |=========================| 518 kB    00:02    
(14/27): sylpheed-claws-2 100% |=========================| 2.5 MB    00:19    
(15/27): fedora-usermgmt- 100% |=========================| 5.6 kB    00:00    
(16/27): clamav-data-0.88 100% |=========================| 2.7 MB    00:22    
(17/27): spamassassin-3.0 100% |=========================| 687 kB    00:03    
(18/27): perl-Digest-SHA1 100% |=========================|  48 kB    00:00    
(19/27): startup-notifica 100% |=========================|  28 kB    00:00    
(20/27): fedora-usermgmt- 100% |=========================| 7.7 kB    00:00    
(21/27): libksba-0.9.13-2 100% |=========================|  95 kB    00:01    
(22/27): perl-Digest-HMAC 100% |=========================|  12 kB    00:00    
(23/27): perl-HTML-Tagset 100% |=========================|  13 kB    00:00    
(24/27): gmp-4.1.4-6.i386 100% |=========================| 593 kB    00:03    
(25/27): libetpan-0.42-1. 100% |=========================| 247 kB    00:03    
(26/27): gpgme-1.0.3-2.fc 100% |=========================| 221 kB    00:20    
(27/27): perl-HTML-Parser 100% |=========================|  89 kB    00:05

#yum install perl-Text-Iconv

# yum install perl-suidperl

# yum install perl-Compress-Zlib

#yum install perl-BerkeleyDB

# yum install perl-Cyrus

下载openwebmail
#wget http://openwebmail.org/openwebmail/download/redhat/rpm/release/openwebmail-2.51-1.i386.rpm
#rpm –ivh openwebmail-2.51-1.i386.rpm

下载perl-CGI-SpeedyCGI
#wget http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/fc4/i386/RPMS.dries/perl-CGI-SpeedyCGI-2.22-1.2.fc4.rf.i386.rpm
#rpm -ivh perl-CGI-SpeedyCGI-2.22-1.2.fc4.rf.i386.rpm

3.2
cd /usr/lib/sasl2/
vi smtp.conf
修改如下:
pwcheck_method: saslauthd
log_level:3
mech_list:PLAIN LOGIN

3.3
vi /etc/sysconfig/saslauthd
如下设置:
   MECH=pam

3.4
修改postfix配置文件main.cf
vi /etc/postfix/main.cf
#BASE
#myhostname = host.domain.tld
更改为:
myhostname = mail.yayaa.net

#mydomain = domain.tld
更改为:
mydomain = yayaa.net

#myorigin = $mydomain
更改为:
myorigin = yayaa.net

#inet_interfaces = all
更改为:
Inet_interfaces =all

#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain
更改为:
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain,ftp.$mydomain

#mynetworks = host
更改为:
mynetworks = host

#SASL SMTP验证
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated ,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
reject_non_fqdn_recipient,
reject_unauth_destination
smtpd_client_restrictions = permit_sasl_authenticated

3.5
vi /etc/dovecot.conf
确认以下几项:
protocols = imap imap3 pop3 pop3s
auth_passdb =
auth_passdb = pam

4. 开机自启动
chkconfig –add postfix
chkconfig postfix on
service postfix restart

chkconfig –add dovecot
chkconfig dovecot on
service dovecot restart

chkconfig –add saslauthd
chkconfig saslauthd on
service saslauthd restart

5. 测试
5.1
telnet mail.yayaa.net 25
telnet mail.yayaa.net 110

5.2
Outolook客户端测试

6. 配置openwebmail 2.51
6.1
# cd /var/www/cgi-bin/openwebmail/
# ./openwebmail-tool.pl –init
Please change './etc/dbm.conf' from

dbm_ext .db
dbmopen_ext none
dbmopen_haslock no

to

dbm_ext .db
dbmopen_ext .db
dbmopen_haslock no


And execute './openwebmail-tool.pl --init' again!

ps: If you are running openwebmail in persistent mode,
don't forget to 'touch openwebmail*.pl', so speedycgi
will reload all scripts, modules and conf files in --init.

6.2
vi /var/www/cgi-bin/openwebmail/etc/openwebmail.conf
domainnames auto
更改为:
domainnames yayaa.com (更改为自己定义的域名)

default_language en
更改为:
default_language zh_CN.GB2312 (更改为简体中文版介面)

default_iconset Cool3D.Englist
更改为:
default_iconset Cool3D.Chinese.Simplified (更改为中文3D按键)

Step9、修改/var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf文件:

smtpserver 127.0.0.1
更改为:
smtpserver 192.168.1.188 (更改smtp服务器的地址)

authpop3_server localhost
更改为:
authpop3_server 192.168.1.188 (更改pop3服务器的地址)

6.3
vi /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf
dbmopen_ext none
更改为:
dbmopen_ext .db

dbmopen_haslock no
更改为:
dbmopen_haslock yes

smtpserver 192.168.1.188 (添加smtp服务器的地址)

6.4
继续运行openwebmail-tool.pl文件:
# ./openwebmail-tool.pl --init
creating db /var/www/cgi-bin/openwebmail/etc/maps/b2g ...done.
creating db /var/www/cgi-bin/openwebmail/etc/maps/g2b ...done.
creating db /var/www/cgi-bin/openwebmail/etc/maps/lunar ...done.
Welcome to the Open WebMail!

This program is going to send a short message back to the developer,
so we could have the idea that who is installing and how many sites are
using this software, the content to be sent is:

OS: Linux 2.6.9-11.EL i686
Perl: 5.008005
WebMail: Open WebMail 2.51 20050228

Send the site report?(Y/n) y (输入y,然后按回车键)
sending report...

Thank you.

6.5
测试: http://mail.yayaa.net/cgi-bin/openwebmail/openwebmail.pl


Postfix安装笔记2之防毒,过滤篇
作者:yayaa
Mail: [email protected]
Homepage:http://yayaa.eicp.net

1.下载MailScanner, ClamAV 0.88 and SpamAssassin 3.1.0 easy installation package

#wget http://www.sng.ecs.soton.ac.uk/mailscanner/files/4/rpm/MailScanner-4.51.5-1.rpm.tar.gz
#wget http://www.sng.ecs.soton.ac.uk/mailscanner/files/4/install-Clam-SA.tar.gz
 
# tar -zxvf MailScanner-4.51.5-1.rpm.tar.gz
#tar -zxvf install-Clam-SA.tar.gz
# cd MailScanner-4.51.5-1
# ./install.sh
# cd install-Clam-SA
# ./install.sh
注: 这两步的过程比较长,可以先泡杯茶…….
2.配置:
vi /etc/mail/spamassassin/v310.pre
激活下面两个插件(去掉前面的 # ):
loadplugin Mail::SpamAssassin::Plugin::DCC
loadplugin Mail::SpamAssassin::Plugin::Razor2

# vi /etc/MailScanner/MailScanner.conf
修改下面几项:
Run As User = postfix
Run As Group = postfix
MTA = postfix
%org-name% = yayaa.net
%org-long-name% = YY
%web-site% = www.yayaa.net

确保下面几项正确:
Incoming Queue Dir = /var/spool/mqueue.in
Outgoing Queue Dir = /var/spool/mqueue
Virus Scanners = auto
Use SpamAssassin = yes

#mkdir /var/spool/mqueue
#chown postfix:postfix /var/spool/mqueue
#chown postfix:postfix /var/spool/MailScanner/incoming
#chown postfix:postfix /var/spool/MailScanner/quarantine
#chown -R postfix:postfix /var/spool/mqueue.in
#chown –R postfix:postfix /var/spool/postfix

开机自启动:
#chkconfig spamassassin on
#service spamassassin restart
#chkconfig postfix off
# chkconfig MailScanner on

3.定时自动更新
使用CCERT 中文垃圾邮件过滤规则集Chinese_rules.cf
#wget -N -P /usr/share/spamassassin www.ccert.edu.cn/spam/sa/Chinese_rules.cf
定时更新:SA
# crontab –e
0 0 1 * * wget -N -P /usr/share/spamassassin www.ccert.edu.cn/spam/sa/Chinese_rules.cf;/etc/init.d/spamassassin restart;/etc/init.d/spamassassin restart;
# sa-learn --sync -D -p user_prefs (建立学习系统)
#sa-learn --dump all(查看自学习的数据信息)
定时更新:ClamAV
#vi /usr/local/etc/freshclam.conf
去掉下面几句前面的 #
UpdateLogFile /var/log/freshclam.log
LogSyslog
PidFile /var/run/freshclam.pid
#vi /usr/local/etc/clamd.conf
LogFile /var/log/clamav/clamd.log 
LogFileMaxSize 2M 
LogTime
PidFile /var/run/clamd.pid
LogSyslog
ScanMail
#touch /var/log/freshclam.log
#chmod 644 /var/log/freshclam.log
#chown clamav:clamav /var/log/freshclam.log 
#mkdir /var/log/clamav
#touch /var/log/clamav/clamd.log
#chown –R clamav:clamav /var/log/clamav
#chmod –R 644 /var/log/clamav
#crontab –e
0 1 * * * freshclam --quiet -l /var/log/freshclam.log

4.重新启动,测试
#reboot
#tail –f /var/log/maillog |grep MailScanner

相关阅读 更多 +
排行榜 更多 +
爱是小事最新版

爱是小事最新版

休闲益智 下载
悬案2刹那惊颤游戏

悬案2刹那惊颤游戏

冒险解谜 下载
几何飞行内购修改版

几何飞行内购修改版

飞行射击 下载