5.修改pop3的配置文件,使服务器支持pop3加密
[root@localhost certs]# vim /etc/dovecot.conf
修改如下
20行 protocols = imaps pop3s
91 行 ssl_cert_file = /etc/dovecot/certs/dovecot.cert
92 行 ssl_key_file = /etc/dovecot/certs/dovecot.key
6.启动pop3服务器
[root@localhost certs]# service dovecot restart
停止 Dovecot Imap: [确定]
启动 Dovecot Imap: [确定]
[root@localhost certs]#
测试是否启动pop3s
[root@localhost certs]# netstat -tupln |grep dovecot
tcp 0 0 :::993 :::* LISTEN 2740/dovecot
tcp 0 0 :::995 :::* LISTEN 2740/dovecot
7.在客户机上测试是否成功
首先要对客户端的用户进行使用pop3s的设置

点击使用ssl加密,因为前面我们已经去掉了支持pop3,只能使用加密方法pop3s,所以如果直接收邮件 是不成功的.
在服务器端发一个邮件
[root@localhost certs]# mail code
Subject: hello
hello this is a test!
.
Cc:
在客户端接收
接收时会出现下面的情况

直接点击OK就行了,这样就成功了,我们也可以使用抓包的方式来进行验证
首先安装wireshark
[root@localhost yum.repos.d]# yum install wireshark
进行抓包
[root@localhost yum.repos.d]# tshark -ni eth0 -R "tcp.port eq 995"
0.012501 192.168.2.20 -> 192.168.2.10 SSL Client Hello //可以看到使用了ssl加密
0.012567 192.168.2.10 -> 192.168.2.20 TCP 995 > 3624 [ACK] Seq=1 Ack=110 Win=5840 Len=0
0.015353 192.168.2.10 -> 192.168.2.20 TLSv1 Server Hello, Certificate, Server Hello Done
0.016918 192.168.2.20 -> 192.168.2.10 TLSv1 Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message
