分类: LINUX
2010-03-31 22:38:43
httpd, php, php-mysql, mysql, mysql-server, mysql-devel, openssl-devel, dovecot, perl-DBD-MySQL, tcl, tcl-devel, libart, libart-devel
# service sendmail stop
# chkconfig sendmail off
Development Libraries
Legacy Software Development
X Software Development
# yum groupinstall "packge_group_name"
# service mysqld start
# chkconfig mysqld on
# mysqladmin -uroot password 'your_password'
# groupadd -g 2525 postfix
# useradd -g postfix -u 2525 -s /sbin/nologin -M postfix
# groupadd -g 2526 postdrop
# useradd -g postdrop -u 2526 -s /bin/false -M postdrop
# tar zxvf postfix-2.6.5.tar.gz
# make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS ' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto'
tempdir: [/usr/local/src/ postfix-2.6.5] /tmp
config_directory: [/etc/postfix] /etc/postfix
#vi /etc/postfix/main.cf
myhostname = mail.test.com
myorigin = test.com
mydomain = test.com
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.1.0/24, 127.0.0.0/8
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.test.com ESMTP Postfix
mail from:root@test.com
250 2.1.0 Ok
rcpt to:redhat@test.com
250 2.1.5 Ok
354 End data with
250 2.0.0 Ok: queued as AB94A1A561
221 2.0.0 Bye
Connection closed by foreign host.
"/var/spool/mail/redhat": 1 message 1 new
>N 1 root@test.com Wed Sep 5 10:59 15/488 "Mail test!"
# /usr/local/postfix/sbin/postconf -a
#vi /etc/postfix/main.cf
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!
#vi /usr/local/lib/sasl2/smtpd.conf
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
#/usr/local/postfix/sbin/postfix reload
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 Welcome to our mail.test.com ESMTP,Warning: Version not Available!
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN (请确保您的输出以类似两行)
# tar jxvf courier-authlib-0.62.4.tar.bz2
# cd courier-authlib-0.62.4
CFLAGS="-march=i686 -O2 -fexpensive-optimizations"
CXXFLAGS="-march=i686 -O2 -fexpensive-optimizations"
# chmod 755 /usr/local/courier-authlib/var/spool/authdaemon
# cp /etc/authdaemonrc.dist /etc/authdaemonrc
# cp /etc/authmysqlrc.dist /etc/authmysqlrc
MYSQL_SERVER localhost
MYSQL_PORT 3306 (指定你的mysql监听的端口,这里使用默认的3306)
MYSQL_USERNAME extmail (这时为后文要用的数据库的所有者的用户名)
MYSQL_PASSWORD extmail (密码)
# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
# chmod 755 /etc/init.d/courier-authlib
# chkconfig --add courier-authlib
# chkconfig --level 2345 courier-authlib on
#echo "/usr/local/courier-authlib/lib/courier-authlib" >> /etc/ld.so.conf
# service courier-authlib start (启动服务)
#mkdir –pv /var/mailbox
#chown –R postfix /var/mailbox
接下来重新配置SMTP 认证,编辑 /usr/local/lib/sasl2/smtpd.conf ,确保其为以下内容:
pwcheck_method: authdaemond
mech_list:PLAIN LOGIN
########################Virtual Mailbox Settings########################
virtual_mailbox_base = /var/mailbox
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:2525
virtual_gid_maps = static:2525
virtual_transport = virtual
maildrop_destination_recipient_limit = 1
maildrop_destination_concurrency_limit = 1
##########################QUOTA Settings########################
message_size_limit = 14336000
virtual_mailbox_limit = 20971520
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please Tidy your mailbox and try again later.
virtual_overquota_bounce = yes
# cd extman-1.1/docs
# mysql -u root -p # mysql -u root -p mysql> GRANT all privileges on extmail.* TO extmail@localhost IDENTIFIED BY 'extmail'; mysql> GRANT all privileges on extmail.* TO extmail@127.0.0.1 IDENTIFIED BY 'extmail'; # vi /etc/dovecot.conf mail_location = maildir:/var/mailbox/%d/%n/Maildir # vi /etc/dovecot-mysql.conf connect = host=localhost dbname=extmail user=extmail password=extmail default_pass_scheme = CRYPT password_query = SELECT username AS user,password AS password FROM mailbox WHERE username = '%u' user_query = SELECT maildir, uidnumber AS uid, gidnumber AS gid FROM mailbox WHERE username = '%u' # service dovecot start # chkconfig dovecot on # tar zxvf extmail-1.2.tar.gz # mkdir -pv /var/www/extsuite # mv extmail-1.2 /var/www/extsuite/extmail # cp /var/www/extsuite/extmail/webmail.cf.default /var/www/extsuite/extmail/webmail.cf #vi /var/www/extsuite/extmail/webmail.cf SYS_MESSAGE_SIZE_LIMIT = 5242880 SYS_USER_LANG = en_US SYS_USER_LANG = zh_CN SYS_MAILDIR_BASE = /home/domains SYS_MAILDIR_BASE = /var/mailbox SYS_MYSQL_USER = db_user SYS_MYSQL_PASS = db_pass SYS_MYSQL_USER = extmail SYS_MYSQL_PASS = extmail SYS_MYSQL_HOST = localhost SYS_MYSQL_TABLE = mailbox SYS_MYSQL_ATTR_USERNAME = username SYS_MYSQL_ATTR_DOMAIN = domain SYS_MYSQL_ATTR_PASSWD = password SYS_AUTHLIB_SOCKET = /var/spool/authdaemon/socket SYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socket ServerName mail.test.com DocumentRoot /var/www/extsuite/extmail/html/ ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi Alias /extmail /var/www/extsuite/extmail/html SuexecUserGroup postfix postfix # chown -R postfix.postfix /var/www/extsuite/extmail/cgi/ # vi /etc/httpd/httpd.conf ServerName mail.test.com DocumentRoot /var/www/extsuite/extmail/html/ ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi Alias /extmail /var/www/extsuite/extmail/html # tar zxvf Unix-Syslog-0.100.tar.gz # cd Unix-Syslog-0.100 # service httpd start # mv extman-1.1 /var/www/extsuite/extman # cp /var/www/extsuite/extman/webman.cf.default /var/www/extsuite/extman/webman.cf # vi /var/www/extsuite/extman/webman.cf SYS_MAILDIR_BASE = /home/domains SYS_MAILDIR_BASE = /var/mailbox # chown -R postfix.postfix /var/www/extsuite/extman/cgi/ ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi Alias /extman /var/www/extsuite/extman/html #mkdir -pv /tmp/extman #chown postfix.postfix /tmp/extman (1) 如果您安装后无法正常显示校验码,安装perl-GD模块会解决这个问题。如果想简单,您可以到以下地址下载适合您的平台的rpm包,安装即可: #tar zxvf Time-HiRes-1.9707.tar.gz #cd Time-HiRes-1.9707 #tar zxvf File-Tail-0.99.3.tar.gz #cd File-Tail-0.99.3 #./configure --prefix=/usr/local/rrdtool #ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/auto/RRDs/RRDs.so /usr/lib/perl5/5.8.5/i386-linux-thread-multi/ #ln -sv /usr/local/rrdtool/lib/perl/5.8.5/RRDp.pm /usr/lib/perl5/5.8.5 #ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/RRDs.pm /usr/lib/perl5/5.8.5 # cp -r /var/www/extsuite/extman/addon/mailgraph_ext /usr/local # /usr/local/mailgraph_ext/mailgraph-init start # /var/www/extsuite/extman/daemon/cmdserver --daemon # echo “/usr/local/mailgraph_ext/mailgraph-init start” >> /etc/rc.d/rc.local # echo “/var/www/extsuite/extman/daemon/cmdserver -v -d” >> /etc/rc.d/rc.local