Postfix结合squirrelmail邮件服务器实现web界面的简单的配置
 
1.改主机名
[[email protected] named]# vim /etc/sysconfig/network
[[email protected] named]# vim /etc/hosts(去删掉原来的主机名)
[[email protected] named]# hostname
localhost.localdomain
[[email protected] named]# hostname mail.163.com(使改的主机名立即生效)
 
2.因为用到了dns的解析,所以要把dns安装用到的软件包都安装上去。
包括:bind .... Bind-chroot 和ca.. 然后做改变的东西就如下
[[email protected] etc]# cp -p named.caching-nameserver.conf named.conf                   
[[email protected] etc]# vim named.conf
[[email protected] etc]# vim named.rfc1912.zones (去添加163.com.zone)
[[email protected] etc]# cd ../var/named/
去复制个zone,从命名163.com.zone,并vim编辑
[[email protected] named]# service named start
启动 named:                                               [确定]
[[email protected] named]# chkconfig named on
[[email protected] named]# vim /etc/resolv.conf (改网关指向)
[[email protected] named]# service named start
 
[[email protected] named]# nslookup mail.163.com
Server:           192.168.30.120
Address: 192.168.30.120#53
 
Name:     mail.163.com
Address: 192.168.30.120
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

 
3.Postfix的配置:
[[email protected] Server]# rpm -ivh postfix-2.3.3-2.1.el5_2.i386.rpm
[[email protected] ~]# rpm -ql postfix |less
[[email protected] named]# service sendmail stop(把sendmail停掉)
[[email protected] named]# chkconfig sendmail off
[[email protected] named]# service postfix start
[[email protected] named]# netstat -tupln |grep 25
[[email protected] Server]# vim /etc/postfix/main.cf
[[email protected] named]# useradd user1
[[email protected] named]# passwd user1
1.验证本地域才能够发送邮件成功
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

查看日志连接进入了延迟队列
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

本地域发送成功
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

4.编辑配置文件要改变的东西
69   myhostname = mail.163.com
77   mydomain = 163.com
107 inet_interfaces = all(监听的地址)
155 mydestination = $myhostname, localhost.$mydomain, localhost , $mydomain(定义本地域)
配置完成以后查看日志,可以看到已经发送成功
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

5.如何实现postfix的中继
此处为telnet 登录,是外网的地址,因为默认不中继外网的,只中继本地域的
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

改配置文件然后重启:可以看到已经中继成功
255行   mynetworks = 192.168.30.0/24, 127.0.0.0/8
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

6.安全认证
需要安装sasl的软件
[[email protected] Server]# yum install -y cyrus-sasl-2.1.22-5.el5.i386.rpm
[[email protected] Server]# chkconfig --list |grep sasl
saslauthd           0:关闭    1:关闭    2:关闭    3:关闭    4:关闭    5:关闭    6:关闭
[[email protected] Server]# service saslauthd start
[[email protected] Server]# chkconfig saslauthd on
[[email protected] Server]# man 5 postconf
[[email protected] ~]# vim /etc/postfix/main.cf
添加下面的内容
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

从外网telnet上可以看到中继被拒绝
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

[[email protected] ~]# echo -n "[email protected]" |openssl base64
dXNlcjFAMTYzLmNvbQ==
[[email protected] ~]# echo -n "123" |openssl base64
MTIz
 
输入账号密码发现已经可以中继了
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

 
7.实现:http发邮件
要安装squirrelmail-1.4.8-5.el5_3.7.noarch.rpm
安装这个还有依赖的关系:http的和php的所以用yum安装比较好
[[email protected] Server]# yum install squirrelmail-1.4.8-5.el5_3.7.noarch.rpm
[[email protected] Server]# service httpd start
[[email protected] Server]# chkconfig httpd on
要想http能访问到邮件目录,需要在apache的主目录下建立软连接
[[email protected] sasl2]# cd /var/www/html/
[[email protected] html]# ln -s /usr/share/squirrelmail/ mail
[[email protected] html]# cd mail
[[email protected] mail]# cd config/
[[email protected] config]# ./conf.pl
进去做一下简单的设置
改变语言 [en_US]: zh_CN
改变字符集 [iso-8859-1]: GB2312
改变服务器的域名 [localhost]: 163.com
Sendmail 改变成smtp
[[email protected] config]# vim /etc/httpd/conf/httpd.conf
去改变字符集
747行禁掉就行了 然后重启
http:192.168.30.120/mail (http登录)
下面出错了,主要是没有安装dovecot接收邮件的服务器
 

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置

用yum将dovecot安装上就行了
[[email protected] Server]# yum install dovecot-1.0.7-7.el5.i386.rpm
[[email protected] Server]# service dovecot start
[[email protected] Server]# chkconfig dovecot on
成功登录

Postfix结合squirrelmail邮件服务器实现web界面的简单的配置