Get the App
SLTechnology News&Howtos  ›  Database  › 

Dovecot+mysql configuration and the method of building mail cloud server

Shulou Source: shulou.com Published: 2022-06-01 19:32:24 11月06日 Update

Let's learn about dovecot+mysql configuration and how to build an email cloud server. I'm sure you will benefit a lot after reading it. I hope you want this short article about dovecot+mysql configuration and how to build an email cloud server.

Dovecot+mysql

One configuration

1 plug-in for yum install dovecot-mysql.x86_64-y###dovecot so that this software can recognize mysql###

2 vim / etc/dovecot/conf.d/10-auth.conf # Edit the authentication file #

Content:

123! include auth-sql.conf.ext### supports mysql authentication #

3 configuration for cp / usr/share/doc/dovecot-2.2.10/example-config/dovecot-sql.conf.ext / etc/dovecot/dovecot-sql.conf.ext### to generate dovecot to read mysql #

4 vim / etc/dovecot/dovecot-sql.conf.ext

Content:

32 driver = mysql### database type #

71 connect = host=localhost dbname=email user=postuser password=postuser### connection query library, user, password #

78 default_pass_scheme = PLAIN### default authentication method is plaintext #

107 password_query =\ # query password matching #

108 SELECT username, domain, password\

109 FROM emailuser WHERE username ='% u 'AND domain ='% d'

125 user_query = SELECT maildir, 666 AS uid, 666 AS gid FROM emailuser WHERE username ='% uplink email # query email content #

5 vim / etc/dovecot/conf.d/10-mail.conf

Content:

168 first_valid_uid = 666 customers # email file query user identity #

175 first_valid_gid = 666

30 mail_location = maildir:/home/vmail/%d/%n### specify email location #

6 systemctl restart dovecot.service

Test:

[root@foundation78 Desktop] # telnet 172.25.254.112 110

Trying 172.25.254.112...

Connected to 172.25.254.112.

Escape character is'^]'.

+ OK [XCLIENT] Dovecot ready.

User lee@lee.com

+ OK

Pass lee

+ OK Logged in.

Quit

+ OK Logging out.

Connection closed by foreign host.

You can test directly in thunderbird:

Two-shell mail

1) null client

1 vim / etc/postfix/main.cf

Content:

Mydomain = example.com### domain #

Myorigin = the domain where westos.com### is disguised as a real mail cloud server #

Myhostname = mail.example.com### hostname #

Mydestination = # is empty and does not accept email #

Relayhost = 172.25.254.112 email # forwarded to the real email CVM #

2 systemctl restart postfix.service

3 Test:

Shell mail cloud server:

[root@mail ~] # mail root@example.com

Subject: dskjaf

Skdja

.

EOT

[root@mail ~] # mailq

Mail queue is empty

[root@mail ~] # mail

No mail for root

Real email CVM #

[root@westos-mail ~] # mail

Heirloom Mail version 12.5 7-5-10. Type? For help.

"/ var/spool/mail/root": 3 messages 3 new

N 1 root Sat May 27 23:23 21 amp 753 "hfue"

N 2 root Sat May 27 23:23 21amp 757 "hjk"

N 3 root Sat May 27 23:24 21 amp 752 "dskjaf"

& 3

Message 3:

From root@mail.example.com Sat May 27 23:24:11 2017

Return-Path:

X-Original-To: root@example.com

Delivered-To: root@example.com

Date: Sat, 27 May 2017 23:24:08-0400

To: root@example.com

Subject: dskjaf

User-Agent: Heirloom mailx 12.5 7-5-10

Content-Type: text/plain; charset=us-ascii

From: root@mail.example.com (root)

Status: R

Skdja

& Q

Held 3 messages in / var/spool/mail/root

After reading this article on how to configure dovecot+mysql and how to build email cloud servers, many readers will want to know more about it. For more industry information, you can follow our industry information section.

Tags: Mail server service content configuration query method test authentication password file more user shell industry affirmation benefit a lot host location information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Information Microsoft vpn Shulou Tech Info