五、安装postfix管理工具
1、安装postfix管理工具webmail来设置第一个域名和用户
A、在http://www.toping.net/bbs/job.php?action=download&pid=tpc&tid=1469&aid=116 下载最新版的webmail4.11
B、然后用一些FTP软件将WEBMAIL4.11到网站根目录
C、然后解压
#tar zxvf webmail4.11.tar.gz
D、然后修改config/config.inc.php中的
define(MYSQL_HOST, ‘localhost’); 为 您的MySQL服务器的主机名
define(MYSQL_USER, ‘postfix’); 为 您的MySQL的用户名 define(MYSQL_PASS, ‘postfix’); 为 您的MySQL的密码 define(MYSQL_DATA, ‘postfix’); 为 您的邮件服务器的数据库 |
同样修改 webadmin/include/config.inc.php
define(MYSQL_HOST, ‘localhost’); 为 您的MySQL服务器的主机名
define(MYSQL_USER, ‘postfix’); 为 您的MySQL的用户名
define(MYSQL_PASS, ‘postfix’); 为 您的MySQL的密码
define(MYSQL_DATA, ‘postfix’); 为 您的邮件服务器的
为了使webmail4.11支持php5 ,对webmail4.11作下面修改:
修改config/db_mysql.php 文件,将54行的
if (!isset($this->Link_ID)){
改成
if (!is_object($this) || !isset($this->Link_ID)){
同样在webmain/include/db_mysql.php文件,将54行的
if (!isset($this->Link_ID)){
改成
if (!is_object($this) || !isset($this->Link_ID)){
数据库修改完成后运行:http://172.16.16.205/webadmin/index.php
完装完成!!
2、用户登录测试
用户登录测试
A、安装p5-MIME-Base64
# cd /usr/ports/converters/p5-MIME-Base64/
# make install clean
通过p5-MIME-Base64来取得用户名和密码的base64编码
# perl -MMIME::Base64 -e ‘print encode_base64(“webmaster\@toping.net”);’
d2VibWFzdGVyQHRvcGluZy5uZXQ=
# perl -MMIME::Base64 -e ‘print encode_base64(“000000”);’
MDAwMDAw
B、测试发送邮件(端口:25):
# telnet 127.0.0.1 25
Trying 127.0.0.1…
Connected to 0.
Escape character is ‘^]’.
220 mail.toping.net ESMTP Postfix
ehlo mail
250-mail.toping.net
250-PIPELINING
250-SIZE 4194304
250-VRFY
250-ETRN
250-AUTH NTLM LOGIN PLAIN OTP
250-AUTH=NTLM LOGIN PLAIN OTP
250 8BITMIME
auth login
334 VXNlcm5hbWU6
d2VibWFzdGVyQHRvcGluZy5uZXQ= //此为用户名id:webmaster@toping.net
334 UGFzc3dvcmQ6
MDAwMDAw //此为用户密码password:000000
235 Authentication successful
MAIL FROM:<webmaster@toping.net> //告诉服务器发件人的Email地址
250 Ok
RCPT TO:<webmaster@toping.net> //告诉服务器收件人的地址
250 OK
DATA //告诉服务器开始写信
354 End data with <CR><LF>.<CR><LF>
SUBJECT:test //subject后面填写的是邮件的主题
test
. //换行后输入.后按回车,表示信件内容书写完毕
250 Ok: queued as 58DC71D5
quit //发送信件,结束对话,退出SMTP服务器
221 Bye
Connection closed by foreign host
C、测试收取邮件(端口:110):
# telnet 127.0.0.1 110
Trying 127.0.0.1…
Connected to 0
Escape character is ‘^]’
+OK Hello there
user webmaster@toping.net
+OK Password required
pass 000000
+OK logged in
list
+OK POP3 clients that break here, they violate STD53
1 2217
.
retr 1 //返回第一封信的全部内容
+OK 2217 octets follow.
Return-Path: <webmaster@toping.net>
X-Original-To: webmaster@toping.net
Delivered-To: webmaster@toping.net
Received: from mail (localhost.toping.net [127.0.0.1])
by mail.toping.net (Postfix) with ESMTP id 58DC71D5
for <webmaster@toping.net>; Mon, 9 Aug 2004 21:11:20 +0800 (CST)
SUBJECT:test
Message-Id: <20040809131120.58DC71D5@mail.toping.net>
Date: Mon, 9 Aug 2004 21:11:20 +0800 (CST)
From: webmaster@toping.net
To: undisclosed-recipients:;
test
.
dele 1 //删除
+OK Deleted
quit
+OK Bye-bye
Connection closed by foreign host
也可以使用任何其它的邮件客户端程序来测试,如Foxmail、Outlook Express等等。
修改apache的配置文件httpd.conf .修改apache 的启动用户与组.
#vi /usr/local/etc/apache22/httpd.conf
将Group www、User www修改为: Group postfix、User postfix
以下文章点击率最高
Loading…