安装详细过程
实验环境:
网络域名: test.com
DNS 主机名称: win2003
DNS 主机 IP 地址: 192.168.1.105
邮件主机名称: mail. test.com
邮件主机 IP 地址: 192.168.1.102
操作系统: redhat el5
网络域名: test.com
DNS 主机名称: win2003
DNS 主机 IP 地址: 192.168.1.105
邮件主机名称: mail. test.com
邮件主机 IP 地址: 192.168.1.102
操作系统: redhat el5
打算使用rpm方式安装,本文的前提是apache已经正确安装并可以正常支持CGI
为了解决依赖性问题强烈建议把perl的相关包都安装上
由于当时安装系统的时候已经安装了sendmail,所以需要首先停掉
可以使用下面命令
#killall sendmail (停止所有的Sendmail进程)
或者
# service sendmail stop
# chkconfig sendmail off (关闭sendmail 开机的启动)
# chkconfig –list (查看下自动启动的程序)
查看有没有安装postfix
#rpm –qa|grep postfix
发现没有安装
# rpm -ivh postfix- 2.3.3 -2.i386.rpm
# rpm -ivh postfix-pflogsumm- 2.3.3 -2.i386
在安装postfix-pflogsumm- 2.3.3 -2.i386的时候总是提示依赖性问题,所以最好安装之前
把有关perl的包都安装上
这几个是我按顺序安装过包之后可以正常安装的过程,如果您安装的时候也有相关提示建议
根据屏幕的依赖性提示进行安装
# rpm -ivh perl-Carp-Clan-5.3- 1.2.1 .noarch.rpm
# rpm -ivh perl-Bit-Vector-6.4- 2.2.2 .1.i386.rpm
# rpm -ivh perl-Date-Calc-5.4- 1.2.2 .1.i386.rpm
# rpm -ivh postfix-pflogsumm- 2.3.3 -2.i386.rpm
当然也可以大家在安装系统的时候就安装好postfix就更省事了.
然后安装dovecot
# rpm -ivh dovecot-1.0-1.2.rc15.el5.i386.rpm
接着又是一大堆的依赖型问题……….
我安装了以下包之后正常
# rpm -ivh perl-DBI-1.52-1.fc6.i386.rpm
# rpm -ivh mysql- 5.0.22 -2.1.i386.rpm (居然连mysql也装上了)
# rpm -ivh libdbi- 0.8.1 -2.1.i386.rpm
# rpm -ivh libdbi-drivers- 0. 8.1a -1.2.2.i386.rpm
# rpm -ivh libdbi-dbd-mysql- 0. 8.1a -1.2.2.i386.rpm
# rpm -ivh dovecot-1.0-1.2.rc15.el5.i386.rpm
启动postfix和dovecot服务过程:
# service postfix start
Starting postfix: [ 确定 ]
# service dovecot start
启动 Dovecot Imap: [ 确定 ]
Starting postfix: [ 确定 ]
# service dovecot start
启动 Dovecot Imap: [ 确定 ]
设置postfix和doveco开机自动运行
# chkconfig postfix on
# chkconfig dovecot on
现在可以使用邮件服务器发送邮件了,但是还不能下载邮件,因为新版redhat Linux中 dovecot代替了imap软件包,但是还没有绑定POP3和POP协议,下面修改配置文件: /etc/dovecot.conf,
#protocols = imap imap3
protocols = imap imap3 pop3 pop3s
修改postfix邮件服务器配置文件:
/etc/postfix/main.cf
文件
#myhostname = host.domain.tld
更改为:
myhostname = mail.test.com
#mydomain = domain.tld
更改为:
mydomain = test.com
#myorigin = $mydomain
更改为:
myorigin = test.com
#inet_interfaces = all
更改为:
Inet_interfaces =all
#myhostname = host.domain.tld
更改为:
myhostname = mail.test.com
#mydomain = domain.tld
更改为:
mydomain = test.com
#myorigin = $mydomain
更改为:
myorigin = test.com
#inet_interfaces = all
更改为:
Inet_interfaces =all
这里需要注意的是下面有个Inet_interfaces = local一定要注释掉,要不会出现只监听
127.0.0.1 25的情况
#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 = 192.168.1.0/24, 127.0.0.0/8
#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 = 192.168.1.0/24, 127.0.0.0/8
端口测试:
# telnet mail.test.com 25 (测试25端口)
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.cao.net ESMTP Postfix
quit
221 Bye
Connection closed by foreign host.
# telnet mail.test.com 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.
# telnet mail.test.com 25 (测试25端口)
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.cao.net ESMTP Postfix
quit
221 Bye
Connection closed by foreign host.
# telnet mail.test.com 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.