RHLE5+Postfix+Openwebmail
前提條件:一/#yum install perl*
二/下載perl-Text-Iconv-1.7-2.el5.i386.rpm
( Iconv-1.7-2.el5.i386.rpm)
#rpm -ivh perl-Text-Iconv-1.7-2.el5.i386.rpm
三/關閉selinux
啟動postfix + dovecot服務過程:
# service postfix start
Starting postfix: [ 確定 ]
# service dovecot start
啟動 Dovecot Imap: [ 確定 ]
修改/etc/dovecot.conf檔案:
#protocols = imap imap3
更改為:
protocols = imap imap3 pop3 pop3s (啟動imap imap3 pop3 pop3s功能)
# service dovecot restart(重新啟動dovecot服務)
停止 Dovecot Imap: [ 確定 ]
啟動 Dovecot Imap: [ 確定 ]
修改/etc/postfix/main.cf檔案:
#myhostname = host.domain.tld
更改為:
myhostname = mail.test.org (指定執行Postfix郵件系統的主機名稱)
#mydomain = domain.tld
更改為:
mydomain = test.org (指定Postfix郵件系統使用的域名)
#myorigin = $mydomain
更改為:
myorigin = test.org (指定發件人所在的域名)
#inet_interfaces = all
更改為:
Inet_interfaces =all (指定Postfix郵件系統監視的網路介面)
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain
更改為:
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain(指定Postfix接收郵件時收件人的域名)
#mynetworks = host
更改為:
mynetworks = host (指定您所在的網路地址192.168.10.0/24)
# service postfix restart (重新啟動postfix服務)
Shutting down postfix: [ 確定 ]
Starting postfix: [ 確定 ]
埠測試:
# telnet mail.test.org 25 (測試25埠)Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.easy.com ESMTP Postfix
quit
221 Bye
Connection closed by foreign host.
# telnet mail.test.org 110 (測試110埠)Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.
配置openwebmail:
# service httpd restart (啟動httpd服務)
停止 httpd: [ 確定 ]
啟動 httpd: [ 確定 ]
# 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.
修改 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf 檔案:
domainnames auto
更改為:
domainnames test.org (更改為自己定義的域名)
default_language en
更改為:
default_language zh_CN.GB2312 (更改為簡體中文版介面)
default_iconset Cool3D.Englist
更改為:
default_iconset Cool3D.Chinese.Simplified (更改為中文3D按鍵)
修改/var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf檔案:
smtpserver 127.0.0.1
更改為:
smtpserver 192.168.10.1 (更改smtp伺服器的地址)
authpop3_server localhost
更改為:
authpop3_server 192.168.10.1 (更改pop3伺服器的地址)
修改/var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf檔案:
dbmopen_ext none
更改為:
dbmopen_ext .db
dbmopen_haslock no
更改為:
dbmopen_haslock yes
smtpserver 192.168.10.1 (新增smtp伺服器的地址)
繼續執行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:
.......
Send the site report?(Y/n) y (輸入y,然後按Enter鍵)
sending report...
Thank you.
增加使用者傳送電子郵:
增加本地使用者:
# useradd user1
# useradd user2
# useradd user3
設定本地yer使用者的密碼
# passwd user1
Changing password for user yer.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
# passwd user2
Changing password for user fandy.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
# passwd user3
Changing password for user biao.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
測試webmail方式收發電子郵件:
在ie中輸入以下地址:
試驗成功。
但是如果要用替代繁瑣的
#vi /etc/httpd/conf/httpd.conf
去除972行註釋,改為 NameVirtualHost *:80
最後新增
<VirtualHost *:80>
ServerName mail.test.org
DocumentRoot "/var/www"
DirectoryIndex /cgi-bin/openwebmail/openwebmail.pl
<使用mail.test.org代替mail.test.org/cgi-bin/openwebmail/openwebmail.pl 來登入Open Webmail>
ScriptAlias /openwebmail "/var/www/cgi-bin/openwebmail"
<因為有一些Openwebmail的根路徑(例如圖片的路徑)是從/openwebmail開始,而實際卻是在/var/www/cgi-bin/openwebmail下>
</VirtualHost>
<Directory /var/www/cgi-bin>
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
可能還需要註釋掉如下語句:ScriptAlias /cgi-bin/ "/usr/local/www/apache22/cgi-bin/"。並且將httpd.conf中的“#AddHandler cgi-script .cgi”改為“AddHandler cgi-script .cgi .pl”;這樣apache才會去執行pl檔案,而不是開啟它。注意,改完httpd.conf之後記得重啟apche噢
©著作權歸作者所有:來自51CTO部落格作者qiujichun的原創作品,如需轉載,請註明出處,否則將追究法律責任
職場休閒Postfix服務
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/1834/viewspace-2822168/,如需轉載,請註明出處,否則將追究法律責任。