詳解Linux下的postfix安裝
配置SMTP 認(rèn)證,同樣需要修改在前面創(chuàng)建的/usr/local/sasl2/smtpd.conf
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path: /usr/local/courier-authlib/var/spool/authdaemon/socket
手動(dòng)啟動(dòng)imap的服務(wù)
[root@localhost mail]# /usr/local/courier-imap/libexec/pop3d.rc start
[root@localhost mail]# /usr/local/courier-imap/libexec/imapd.rc start
查看是否啟動(dòng)ok,兩個(gè)端口,110和143
[root@localhost mail]# netstat -anpt | grep 110
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 3822/couriertcpd
tcp 0 20 192.168.225.180:110 89.137.252.99:21639 ESTABLISHED 30768/pop3login
[root@localhost mail]# netstat -anpt | grep 143
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 3816/couriertcpd
[root@localhost mail]# vi /etc/sysconfig/iptables
開放110和143端口
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 143 -j ACCEPT
[root@mail2 ~]# service iptables restart
清除防火墻規(guī)則:[確定]
把 chains 設(shè)置為 ACCEPT 策略:filter [確定]
正在卸載 Iiptables 模塊:[確定]
應(yīng)用 iptables 防火墻規(guī)則:[確定]
載入額外 iptables 模塊:ip_conntrack_netbios_ns [確定]
第十一安裝extmail
Ok,安裝完imap后,開始安裝網(wǎng)頁上的extmail軟件
[root@mail2 postfix]# tar zxvf 51CTO下載-extmail-1.2.tar.gz
因?yàn)閑xtmail相當(dāng)于web 版的outlook,因此將其放到了apache下面的
Mv extmail-1.2 /usr/local/apache/htdocs/extmail
進(jìn)入到/usr/local/apache/htdocs/extmail下面
復(fù)制一份主配置文件
[root@mail2 extmail]# cp webmail.cf.default webmail.cf
之后修改主配置文件(根據(jù)你的實(shí)際路徑進(jìn)行更改)
SYS_CONFIG = /usr/local/apache/htdocs/extmail/
SYS_LANGDIR = /usr/local/apache/htdocs/extmail/lang
SYS_TEMPLDIR = /usr/local/apache/htdocs/extmail/html
SYS_USER_LANG = zh_CN
SYS_MYSQL_USER = extmail 連接mysql數(shù)據(jù)庫使用的數(shù)據(jù)庫名
SYS_MYSQL_PASS = extmail 數(shù)據(jù)庫密碼
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = localhost
SYS_MYSQL_SOCKET = /data/mysql/mysql.Sock 數(shù)據(jù)庫的sock文件
# table name
SYS_MYSQL_TABLE = mailbox
SYS_MYSQL_ATTR_USERNAME = username
SYS_MYSQL_ATTR_DOMAIN = domain
SYS_MYSQL_ATTR_PASSWD = password
SYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socket
更改完成后,修改apache的配置文件,將其與extmail想結(jié)合
Vi /usr/local/apache/conf/httpd.Conf
User postfix
Group postfix
Options Indexes FollowSymLinks +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
安裝Unix-Syslog ,因?yàn)閑xtmail 會(huì)用到DBD:syslog
下載 Unix-Syslog-1.1.tar.gz
http://down.51cto.com/data/329992
下載DBD-mysql-4.020.tar.gz
http://down.51cto.com/data/329989
#tar xvf Unix-Syslog-1.1.tar.gz.gz
#cd Unix-Syslog-1.1
#perl Makefile.PL
# make
#make install
cd DBD-mysql-4.020
#perl Makefile.PL
#make
#make install
Ok.之后測(cè)試extmail是否可以訪問ok
http://ip/extmail/cgi
第十二:安裝extman
安裝extman和安裝extmail的方法是一樣的,
解壓,mv
Mv extman-1.1 /usr/local/apache/htdocs/extman
復(fù)制文件
cp webman.cf.default webman.Cf
編輯文件
extman]# vi webman.Cf
SYS_CONFIG = /usr/local/apache/htdocs/extman/
SYS_LANGDIR = /usr/local/apache/htdocs/extman/lang
SYS_TEMPLDIR = /usr/local/apache/htdocs/extman/html
SYS_MAILDIR_BASE = /var/mailbox/
SYS_SESS_DIR = /var/tmp/extman/
SYS_BACKEND_TYPE = mysql
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = 127.0.0.1
SYS_MYSQL_SOCKET = /data/mysql/mysql.Sock
保存退出,修改apache文件
Options Indexes FollowSymLinks +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
需重啟apache,才能生效
創(chuàng)建數(shù)據(jù)庫,把docs 目錄下面的導(dǎo)入到數(shù)據(jù)庫中,但是在導(dǎo)入數(shù)據(jù)庫前需要把extmail.sql 文件中的TYPE=MyISAM 改成ENGINE=MyISA
#mysql –uroot –p
#mysql –uroot –p
修改cgi 目錄的屬主
#chown –R postfix.Postfix /usr/local/apache/htdocs/extman/cgi/
為extman 授權(quán)數(shù)據(jù)庫訪問權(quán)限
#mysql -uroot –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';
之后再測(cè)試extman是否可以登錄,配置文件提到的幾個(gè)文件都要建立
/var/mailbox/
/var/tmp/extman/
這兩個(gè)目錄要需要提前建立好
第十三:搭建圖形日志
之后開始安裝postfix圖形日志
下載包Time-HiRes-1.9721.tar.gz
http://down.51cto.com/data/329630
下載File-Tail-0.99.3.tar.gz
http://down.51cto.com/data/329637