webmail
Squirrel webmail安装postfix[root@mail ~]# cd /mnt/cdrom/Server/ [root@mail Server]# rpm -ivh postfix- postfix--2.1.el5_2.i386.rpm postfix-pflogsumm--2.1.el5_2.i386.rpm [root@mail Server]# rpm -ivh postfix--2.1.el5_2.i386.rpm Preparing... ########################################### [100%] 1:postfix ########################################### [100%] [root@mail Server]# vim /etc/postfix/master.cf [root@mail ~]# vim /etc/postfix/main.cf 110 inet_interfaces = all 70 myhostname = mail.bj.com 77 mydomain = bj.com 158 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain --按地址段的中继 257 mynetworks = 168.100.101.0/24, 127.0.0.0/8 --接收mail的网段 [root@mail ~]# service postfix restart 做dns[root@mail Server]# rpm -qa |grep bind bind--10.P1.el5 bind-devel--10.P1.el5 bind-libs--10.P1.el5 bind-sdb--10.P1.el5 ypbind-1.19-11.el5 bind-utils--10.P1.el5 bind-libbind-devel--10.P1.el5 bind-chroot--10.P1.el5 [root@localhost Server]# rpm -ivh caching-nameserver--10.P1.el5.i386.rpm [root@localhost etc]# cd /var/named/chroot/etc/ [root@localhost etc]# cp -p named.caching-nameserver.conf named.conf [root@localhost etc]# vim named.conf options { listen-on port 53 { any; } allow-query { any; }; }; view localhost_resolver { match-clients { any; }; match-destinations { any; }; recursion yes; include "/etc/named.rfc1912.zones"; }; [root@localhost etc]# vim /var/named/chroot/etc/named.rfc1912.zones zone "bj.com" IN { type master; File "bj.com.zone"; allow-update { none; }; }; [root@localhost named]# pwd /var/named/chroot/var/named [root@localhost named]# cp -p localhost.zone bj.com.zone [root@localhost named]# vim bj.com.zone $TTL 86400 @ IN SOA ns.bj.com. root ( 42 ; serial (d. ) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum
IN NS ns.bj.com. ns IN A 192.168.101.9 mail IN A 192.168.101.9 pop3 IN CNAME mail smtp IN CNAME mail @ IN MX 10 mail [root@localhost named]# vim /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=mail.bj.com [root@localhost named]# vim /etc/resolv.conf nameserver 192.168.101.9 [root@localhost named]# vim /etc/hosts 127.0.0.1 localhost.localdomain localhost 192.168.101.9 mail.bj.com mail [root@localhost named]# vim /etc/inittab id:3:initdefault: [root@mail ~]# service named start [root@mail ~]# chkconfig named on [root@mail named]# dig -t mx bj.com 1.安装squirrelmail[root@mail cdrom]# mount /dev/cdrom /mnt/cdrom/ [root@mail ~]# cd /mnt/cdrom/Server [root@mail Server]# ll |grep mail -r--r--r-- 99 root root 35921 Jan 19 2007 ant-javamail--2jpp.2.i386.rpm -r--r--r-- 99 root root 1191912 Jan 19 2007 classpathx-mail--4jpp.2.i386.rpm -r--r--r-- 99 root root 354324 Jan 19 2007 classpathx-mail-javadoc--4jpp.2.i386.rpm -r--r--r-- 99 root root 538779 Jul 16 2007 fetchmail--1.1.el5.i386.rpm -r--r--r-- 149 root root 14853 Jan 19 2007 mailcap--1.fc6.noarch.rpm -r--r--r-- 99 root root 10199621 Feb 4 2008 mailman--4.el5.i386.rpm -r--r--r-- 100 root root 56198 Jan 19 2007 mailx--44.2.2.i386.rpm -r--r--r-- 100 root root 170371 Jan 19 2007 procmail-3.22-17.1.i386.rpm -r--r--r-- 99 root root 646627 Jan 18 2007 sendmail--2.el5.i386.rpm -r--r--r-- 99 root root 318825 Jan 18 2007 sendmail-cf--2.el5.i386.rpm -r--r--r-- 113 root root 131258 Jan 18 2007 sendmail-devel--2.el5.i386.rpm -r--r--r-- 99 root root 668921 Jan 18 2007 sendmail-doc--2.el5.i386.rpm -r--r--r-- 148 root root 4493690 May 17 2007 squirrelmail--4.0.1.el5.noarch.rpm -r--r--r-- 148 root root 58696 Jan 18 2007 system-switch-mail--12.noarch.rpm -r--r--r-- 148 root root 17796 Jan 18 2007 system-switch-mail-gnome--12.noarch.rpm [root@mail Server]#
[root@mail Server]# yum install squirrelmail--4.0.1.el5.noarch.rpm Installing: squirrelmail noarch -4.0.1.el5 squirrelmail--4.0.1.el5.noarch.rpm 4.3 M Installing for dependencies: httpd i386 -22.el5 rehl-server 1.2 M php i386 -23.el5 rehl-server 1.2 M php-cli i386 -23.el5 rehl-server 2.1 M php-common i386 -23.el5 rehl-server 153 k php-mbstring i386 -23.el5 rehl-server 970 k [root@mail Server]# 2.运行squirrelmail脚本更改配置[root@mail Server]# cd /var/www/html [root@mail html]# ln -s /usr/share/squirrelmail/ /var/www/html/mail [root@mail config]# pwd /var/www/html/mail/config [root@mail config]# ./conf.pl –运行脚本需要系统装有perl解释器。 10.改变语言
2.改变服务器的配置
3.配置apache服务器[root@mail config]# vim /etc/httpd/conf/httpd.conf 747 #AddDefaultCharset UTF-8 --禁用 [root@mail config]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] [root@mail config]#
4.安装dovecot
--webmail需要imap服务器 [root@mail config]# yum list all|grep dovecot This system is not registered with RHN. RHN support will be disabled. dovecot.i386 -7.el5 rehl-server [root@mail config]# yum install dovecot Installing: dovecot i386 -7.el5 rehl-server 1.7 M Installing for dependencies: mysql i386 -7.el5 rehl-server 4.1 M perl-DBI i386 1.52-2.el5 rehl-server 605 k [root@mail config]#
[root@mail config]# service dovecot start Starting Dovecot Imap: [ OK ] [root@mail config]#
--测试发送webmail出现问题,squirrelmail没有配置server domain [root@mail config]# tail -f /var/log/maillog Aug 27 22:51:19 mail sendmail[7385]: p7REpJm0007385: Authentication-Warning: mail.bj.com: apache set sender to user1@localhost using -f Aug 27 22:51:19 mail sendmail[7385]: p7REpJm0007385: from=user1@localhost, size=501, class=0, nrcpts=1, msgid=<[email protected]>, relay=apache@localhost Aug 27 22:51:19 mail postfix/smtpd[7386]: connect from localhost.localdomain[127.0.0.1] Aug 27 22:51:19 mail postfix/smtpd[7386]: fatal: non-null host address bits in "127.0.0.1/8", perhaps you should use "127.0.0.0/8" instead Aug 27 22:51:20 mail postfix/master[6931]: warning: process /usr/libexec/postfix/smtpd pid 7386 exit status 1 Aug 27 22:51:20 mail postfix/master[6931]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling Aug 27 22:51:20 mail sendmail[7385]: p7REpJm0007385: [email protected], ctladdr=user1@localhost (501/501), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30501, relay=[127.0.0.1] [127.0.0.1], dsn=, stat=Deferred: Connection reset by [127.0.0.1] Aug 27 22:51:20 mail dovecot: imap-login: Login: user= Aug 27 22:51:20 mail dovecot: IMAP(user1): Disconnected: Logged out Aug 27 22:51:21 mail dovecot: imap-login: Login: user= Aug 27 22:51:21 mail dovecot: IMAP(user1): Disconnected: Logged out Aug 27 22:53:26 mail dovecot: imap-login: Login: user= Aug 27 22:53:26 mail dovecot: IMAP(user1): Disconnected: Logged out 使用webmail测试邮件的收发
31-4
|