POSTFIX 邮件服务器
建立邮件收发服务器 实现邮件互相转发
192.168.83.128 mail.qq.com 用户xiaoli xiaowang
192.168.83.129 mail.baidu.com 用户xixi haha
192.168.83.130 DNS服务器
一、192.168.83.128:
1、实验准备:
安装软件包
[[email protected] ~]# yum install postfix -y
[[email protected] ~]# yum install mailx -y
[[email protected] ~]# yum install dovecot -y
设置防火墙,seLinux:
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# setenforce 0
添加用户设置密码:
[[email protected] ~]# useradd xiaoli
[[email protected] ~]# useradd xiaowang
[[email protected] ~]# echo redhat | passwd --stdin xiaoli
更改用户 xiaoli 的密码 。
passwd:所有的身份验证令牌已经成功更新。
[[email protected] ~]# echo redhat | passwd --stdin xiaowang
更改用户 xiaowang 的密码 。
passwd:所有的身份验证令牌已经成功更新。
2、配置发送服务器
[[email protected] ~]# vim /etc/postfix/main.cf
启动服务测试:
[[email protected] ~]# systemctl restart postfix.service
3、配置接收服务器
[[email protected] ~]# vim /etc/dovecot/dovecot.conf
[[email protected] ~]# vim /etc/dovecot/conf.d/10-mail.conf
修改mail文件权限:
[[email protected] mail]# chmod 700 /var/mail/*
启动服务测试:
[[email protected] ~]# systemctl restart dovecot
二、192.168.83.129
配置基本同上:
不同点:
[[email protected] ~]# useradd haha
[[email protected] ~]# useradd xixi
[[email protected] ~]# echo redhat | passwd --stdin haha
更改用户 haha 的密码 。
passwd:所有的身份验证令牌已经成功更新。
[[email protected] ~]# echo redhat | passwd --stdin xixi
更改用户 xixi 的密码 。
passwd:所有的身份验证令牌已经成功更新。
配置发送服务器成功测试:
配置成功测试
三、DNS服务器:
实验环境准备:
[[email protected] ~]# yum install bind -y
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# setenforce 0
配置文件:
[[email protected] ~]# vim /etc/named.conf
[[email protected] ~]# vim /var/named/named.baidu
[email protected] ~]# cp /var/named/named.baidu /var/named/named.qq
[[email protected] ~]# vim /var/named/named.qq
启动服务:[[email protected] ~]# systemctl restart named
测试:实现不同域之前的邮件转发 xiaoli---haha
SquirrelMail实现Web方式收发邮件
环境准备
[[email protected] ~]# yum install httpd php php-gd -y
[[email protected] ~]# systemctl restart httpd
[[email protected] ~]# vim /var/www/html/phpinfo.php
2、下载SquirrelMail squirrelmail-webmail-1.4.22
[[email protected] mail]# ll | egrep "squirrelmail|zh_CN"
-rw-r--r--. 1 root root 664076 7月 15 18:56 squirrelmail-webmail-1.4.22.tar(1).gz
-rw-r--r--. 1 root root 115672 7月 15 18:56 zh_CN-1.4.22-20110425.tar(1).gz
[[email protected] mail]# tar xf squirrelmail-webmail-1.4.22.tar\(1\).gz -C /var/www
[[email protected] mail]# ln -sv /var/www/squirrelmail-webmail-1.4.22/ /var/www/webmail
"/var/www/webmail" -> "/var/www/squirrelmail-webmail-1.4.22/"
[[email protected] mail]# tar xf zh_CN-1.4.22-20110425.tar\(1\).gz -C /var/www/webmail/
3、创建目录,设置权限 调整配置文件
[[email protected] mail]# cd /var/www/webmail/
[[email protected] webmail]# mkdir attach
[[email protected] webmail]# chown -R apache.apache data/ attach/
[[email protected] webmail]# chmod -R 730 attach/
[[email protected] webmail]# cd config
[[email protected] config]# cp -a config_default.php config.php
[[email protected] config]# vim config.php
4、搭建web网站
[[email protected] config]# vim /etc/httpd/conf/httpd.conf
[[email protected] config]# httpd -t
[[email protected] config]# systemctl restart httpd
测试:
、[[email protected]]# echo haha:haha | chpasswd