[root@mail ~]# hostname
mail.bj.com
[root@mail ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
222.1.10.10 mail.bj.com
[root@mail ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mail.bj.com
[root@mail ~]#
70-1
[root@mail ~]# mkdir /mnt/cdrom
[root@mail ~]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@mail ~]# mv yum.repo /etc/yum.repos.d/
[root@mail ~]# yum list all
[root@mail ~]# yum install sendmail* m4 --需要安装m4
[root@mail ~]# cd /etc/mail/
[root@mail mail]# vim sendmail.mc
116 DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl --改变默认监听的地址
[root@mail mail]# vim access
70-2
[root@mail mail]# service sendmail restart
Shutting down sm-client: [ OK ]
Shutting down sendmail: [ OK ]
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]
[root@mail mail]# vim /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
mail.bj.com
bj.com
[root@mail mail]# yum install dovecot –y
[root@mail mail]# vim /etc/dovecot.conf
21 protocols = imap pop3
[root@mail mail]# service dovecot start
Starting Dovecot Imap: [ OK ]
[root@mail mail]# chkconfig dovecot on
[root@mail mail]# chkconfig sendmail on
[root@mail ~]# yum list all |grep squirrel
squirrelmail.noarch 1.4.8-5.el5_4.10 rhel-server
[root@mail ~]# yum install squirrelmail –y
======================================================================
Package Arch Version Repository Size
======================================================================
Installing:
squirrelmail noarch 1.4.8-5.el5_4.10 rhel-server 4.3 M
Installing for dependencies:
httpd i386 2.2.3-43.el5 rhel-server 1.2 M
php i386 5.1.6-27.el5 rhel-server 2.3 M
php-cli i386 5.1.6-27.el5 rhel-server 2.1 M
php-common i386 5.1.6-27.el5 rhel-server 152 k
php-mbstring i386 5.1.6-27.el5 rhel-server 995 k
Transaction Summary
[root@mail ~]# cd /var/www/html/
[root@mail html]# ln -s /usr/share/squirrelmail/ /var/www/html/mail
[root@mail html]# cd mail
[root@mail mail]# cd config
[root@mail config]# pwd
/var/www/html/mail/config
[root@mail config]# ./conf.pl
70-3
70-4
[root@mail config]# vim /etc/httpd/conf/httpd.conf
747 #AddDefaultCharset UTF-8 --更改web服务器的编码,避免乱码问题
[root@mail config]# service httpd restart
[root@mail config]# useradd user3
[root@mail config]# passwd user3
[root@mail config]# useradd user4
[root@mail config]# passwd user4
浏览器登陆:http://222.1.10.10/mail User3和user4 测试可以实现web mail 的通信。