Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The third of mail service series implements postfix+dovecot+sasl.

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

MRA: cyrus-imap,dovecot

Dovecot relies on MySQL client

Pop3 protocol snooping tcp110

Imap4 protocol listens on tcp143 port

To work in clear text, it is necessary to combine sasl to realize the encryption of mail transmission.

Dovecot supports four protocols:

Pop3 imap4 pop3s imaps

The configuration file is located at: / etc/dovecot.conf

With sasl authentication capability

Two mailbox formats are supported:

Mbox one file stores all messages

Maildir: one file stores one message, and all messages are stored in one directory

Installation:

Yum install dovecot

Complete the installation (you can see that the installation of dovecot will install a MySQL by default for support, but the installed MySQL will not affect the available MySQL that we have already installed)

The configuration file is located at: / etc/dovecot.conf

Open the configuration file

find

# protocols=imap imaps pop3 pop3s

Enable, modify to

Protocols=imap pop3

Save exit

Start the service service dovecot start

View the port: (as shown below, snooping for the dovecot port is implemented)

Edit a message and send it to the remote host

1. Send an email

two。 Check the sending status in the log, which has been passed to mailbox

3. When you open the inbox on the recipient side, you can see the received mail. The email was sent successfully.

So far, we have realized the simple function of sending and receiving email, but we have not realized the function of authentication, so it is not safe.

The next step is to use postfix combined with SASL to realize user authentication.

Enable sasl to start the sasl service

The startup service file for sasl on the Red Hat system is located at / etc/init.d/saslauthd

Configuration file: / etc/sysconfig/saslauthd

Saslauthd-v shows the authentication modules supported by the current host server saslauthd

Change MECH in configuration file to shadow mode

Next, start the sasl service, which is off by default, and set sasl to boot automatically

Test whether user authentication can be achieved

The sasl service is already working

Postconf-a to see if sasl service is supported

Make sure that cyrus appears in the

To support the functions of sasl

To add the following to the main configuration file / etc/postfix/main.cf of postfix to support sasl functionality

And edit / usr/lib/sasl2/smtpd.conf

Add the following:

Pwcheck_method: saslauthd

Meth_list: PLAIN LOGIN

The default configuration of postfix is as follows

Connection: smtpd_client_restrictions =

Helo: smtpd_helo_restrictions =

Mail from: smtpd_sender_restrictions =

Rcpt to: smtpd_recipient_restrictions =

Data: smtpd_data_restrictions =

Look up table:

Access control file

/ etc/postfix/access-convert to hash format: / etc/postfix/access.db to binary

For example, when a user wants to access

You can set smtpd_client_restrictions = check_client_access hash:/etc/postfix/access to check whether the user can or cannot access

Example

Limit the recipient to the sender

Since then, we have completed the installation and configuration of the mail service system that can realize the authentication function, and then we will introduce the relevant knowledge about the virtual domain and the virtual user.

If you want to know what happens in the future, please look at the next decomposition.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report