Set up postfix and dovecot simple email servers in CentOS

Source: Internet
Author: User
Tags dovecot

Set up postfix and dovecot simple email servers in CentOS

1. Install postfix and dovecot

Yum install postfix
Yum install dovecot

Ii. postfix email server configuration

Vim/etc/postfix/main. cf

Myhostname =
Mydomain =
Myorigin = $ mydomain
Inet_interfaces = all
Inet_protocols = all
Mydestination = $ mydomain
Mynetworks =
Relay_domains = $ mydestination
Home_mailbox = Maildir/
Service postfix restart
Comment out inet_interfaces = localhost

Iii. Use telnet to test whether the email server is normal

1. Install telnet on the email server
Yum install telnet
2. Connect to the SMTP port of the server
Telnet 25
3. Enter the sender
Mail from: <>
4. Enter the recipient
Rcpt to:
5. Write email content
5.1 start to write email content
5.2 enter the title
Subject: test message
5.3 enter the content and end with.
Test body.
If the following information is displayed, the email enters the sending queue.
250 2.0.0 OK: queued as 88D6D32A94

4. Configure dovecot to receive emails

Vim/etc/dovecot. conf

Protocols = imap pop3 lmtp

Listen = *,::

Login_trusted_networks =

Vim/etc/dovecot/conf. d/10-mail.conf

Mail_location = maildir :~ /Maildir # Set only the mailbox path

Vim/etc/dovecot/conf. d/10-auth.conf

Auth_mechanic ISMs = plain login # allow authentication and login
Disable_plaintext_auth = yes # Allow plaintext Login

Vim/etc/dovecot/conf. d/10-master.conf

Unix_listener auth-userdb {# databases allowed to run
# Mode = 0600
User = postfix
Group = postfix

Service dovecot restart

V. Test

Create useradd aaa-p 521521

Acceptance can be tested using foxmail

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: 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.