1、搭建时间服务器,客户端可在每天早晨的9:00整从ntp服务器更新自己的时间。 2、搭建邮件服务器,使用wukong@ceshi.com给wuneng@ceshi.com用户发一封邮件,内容为biechile。
1>
1.
服务端
装chrony包 yum install -y chrony
2.编辑配置文件
vim /etc/chrony.conf
将服务端的时间服务器改为阿里云的服务器(可改可不改)
允许客户机访问本台服务器
3.重启chronyd服务。
systemctl restart chronyd
date查看时间
4.客户端
装chrony包
编辑配置文件
重启服务
systemctl restart chronyd
查看时间 ,修改时间,从服务端 同步时间。
2.服务端 写计划任务
开机自动启动计划任务
systemctl enable chronyc
2>
1.安装postfix包 关闭防火墙,selinux
yum install -y postfix
systemctl stop firewalld
setenforce 0
2.编辑主配置文件 vim /etc/postfix/main.cf
编辑主机名
配置域名
指定发送邮件时所显示的域名
指定监听接口
指定别人给你发邮件应该写什么主机名
指定信任的客户端
指定可以帮忙转发的MTA主机
3.重启服务 systemctl restart postfix
4.安装dovecot包
yum install dovecot
配置dovecot的主配置文件
[root@localhost ~]# vim /etc/dovecot/dovecot.conf
设置允许登录的ip段
编辑文件
[root@localhost ~]# vim /etc/dovecot/conf.d/10-mail.conf
用户邮件所在地
5.服务端开启sasl认证,安装sasl模块的软件包cyrus-sasl
yum install -y cyrus-sasl
6.编辑postfix配置文件
[root@localhost ~]# vim /etc/postfix/main.cf
追加如下内容
broken_sasl_auth_clients = yes #启用sasl对客户端进行认证
smtpd_sasl_auth_enable = yes #启用sasl认证
smtpd_sasl_security_options = noanonymous #禁用匿名用户
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination #定义收件人限定
7.
重启服务
[root@localhost ~]# systemctl restart postfix
[root@localhost ~]# systemctl restart dovecot
[root@localhost ~]# systemctl restart saslauthd
8.创建用户wukong,wuneng。
useradd wukong
useradd wuneng
设置秘密
echo redhat | passwd --stdin wukong
echo redhat | passwd --stdin wuneng
9.修改权限
[root@localhost ~]# chmod 0600 /var/mail/*
如果不执行上面这个命令,可能会出现在系统中可以收到邮件,但是MUA无法收到邮件。
10.使用foxmail登录
用wukong用户给wuneng用户发邮件。