Postfix MAIL service setup (Article 1): RHEL6

Source: Internet
Author: User
Tags dovecot

 

Elementary: add the sender, acceptor, and email alias to implement the mail group function.

We all know that the mail server has two servers, namely two ports, one is the sending port and the other is the receiving port. We usually use the process of sending and receiving emails, the server opens two ports for us to use. We are not operating the mail server, but only using the two ports of the mail service to meet our needs.

First, set up the mail server's sending service, namely port 25:

By default, the system has installed the postfix mail service for me. However, although this service can send emails, it is only available on the local machine. We can make this mail service available to anyone, this is what we need to do.

In our mail server, the default path is: The main. cf file is the master configuration file of the sender.

By default, this mail service is only available on the local machine:

Configure the main. cf file as follows:

My host name:

The domain used:

All networks can use:

These are some variables defined by the server:

In the following two items, one is to use the host name given by the mail to send the mail, and the other is to use the domain name.

Restart the service:

We use the domain name above:

Check the email name: OK

The host name is used as follows:

Test the mail sending function:

Let's see if port 25 is accessible to all users:

Four zeros indicate that all users can use them:

Let's try it out on a host: telnet is a remote connection tool for common users.

Emails received by the root user on the server:

OK.

Let's take a look at the use of the MAIL command:

Mailq indicates to print the list of sent mails, that is, sending failed.

 

Below is the postmap command, which can check the syntax and encrypt the virtual user.

Configure the acceptor as follows:

First install the software package:

Next, let's take a look at its path: dovecot. conf is the total configuration file, and conf. d is the sub-configuration file.

First, configure the mail protocol used by vim dovecot. conf.

Allow all users to use:

Then, the gamete file:10-mail.comf

Add the following content, which is found in the file.

Restart the service:

Then, check whether the four protocol ports of the email service are enabled for all users.

Server:

Test the function of sending an email to lisi:

The acceptance is successful, and the local user test is OK.

Next let's take a look at remote user host testing.

First install a remote email viewing tool:

Test login by customer Ticket: Use pop protocol and login by lisi identity

Then the following problems will occur:

The Root user's home directory does not contain the mail directory. Do you want to create it? Yes

Reject, view once, view multiple times. We select the o key, once

 

The Lisi user password. You must know the lisi password when logging in as lisi.

Then we will see this email:

Press enter to view the email content, and press qq to quit.

In fact, an email is accepted by creating a directory under the user's home directory, which contains the cache file of the email. They are all encrypted and cannot see the content.

Note: If you are using rhel6.3In this way, the system will automatically create INBOXDirectory, if you are using RHEL6.5You need to manually create the INBOXDirectory or file. Mkdir INBOX or touch INBOX cannot be remembered, either of them.

View the following Port:

Add email service alias:

You can use postconf-d to list many mail service options:

We filter keywords: Find the alias line

Perform the following operations to add the alias line to the main. conf file:

The following describes how to use an alias to encrypt virtual user files.

Open the main. conf file and you can see the following content:

Then open the virtual user file: virtual

Add the following: to send an email to the admin@westos.Org is to send an email to the root.

Then we make the operation take effect:

 

A virtual. db encrypted file is generated.

Inspiring parts service:

Test the previous operation:

Open the root Email:

Completely OK.

We can also add aliases as follows: vim/etc/alias file

It means sending an email to the admin user is sending the email to the root user.

Make it effective immediately

Clear the root mailbox:

Test:

View root mailbox

Mass mailing:

The users file we wrote does not exist. You have to create it yourself.

Test:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.