RedHat 5.4 stunnel Configuration

Source: Internet
Author: User

You can use stunnel to implement pop smtp imap access encrypted by the mail server.
 
What is stunnel, here is not introduced, please see stunnel official website http://www.stunnel.org
 
First check the installation package
 
[Root @ mailsvr12/] # rpm-qa | grep-I stunnel
Stunnel-4.15-2.el5.1
 
The key to STUNNEL is the PEM key,
 
The fastest way to generate a key is to generate a key pair at a hidden location on the official website at http://www.stunnel.org/pem.
 
Copy the generated key to/etc/stunnel. pem and clear the previous key. If no, create this file.
Modify permissions
[Root @ mailsvr12/] # chmod 600/etc/stunnel. pem
 
The following is the configuration file.
[Root @ mailsvr12/] # cat/etc/stunnel. conf
# Sample stunnel configuration file
Cert =/etc/stunnel. pem # key storage location
Chroot =/var/run/stunnel/
# PID is created inside chroot jail
Pid =/stunnel. pid
Setuid = nobody
Setgid = nobody
[Pop3s]
Accept = 995
Connect = 1, 110
[Imaps]
Accept = 993
Connect = 1, 143
[Ssmtp]
Accept = 465
Connect = 25
 
---------------------------------------------------------------------------
 
Note the following in the above stunnel. conf file:
/Var/run/stunnel/to create this file, the nobody user has the Read and Write Permissions
 
Start stunnel
 
[Root @ mailsvr12/] #/usr/sbin/stunnel &-add this sentence to/etc/rc. local and start it randomly.
 
View the process in ps-ef.
Nobody 4134 1 0 09:22? 00:00:00/usr/sbin/stunnel

 
This article from the "Xi'an chuangyue Network | Xi'an enterprise mailbox | enterprise mailbox" blog, please be sure to retain this source http://chenzhuo.blog.51cto.com/150592/238570

This article is from bkjia.com technical blog

[Root @ mailsvr12/] # netstat-nap | grep stunnel
Tcp 0 0 0.0.0.0: 993 0.0.0.0: * LISTEN 4134/stunnel
Tcp 0 0 0.0.0.0: 995 0.0.0.0: * LISTEN 4134/stunnel
Tcp 0 0 0.0.0.0: 465 0.0.0.0: * LISTEN 4134/stunnel
Unix 2 [] DGRAM 4418813 4134/stunnel
 
You can see that the port listens normally. Then, emails such as foxmail or outlook can be accessed through an encrypted channel.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.