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

Dovecot+mysql pickup service and shell mail

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1.yum install dovecot dovecot-mysql.x86_64-y

# # dovecot is an open source IMAP and POP3 mail server that supports Linux and email

# # dovecot-mysql is a plug-in for dovecot to let dovecot recognize MySQL

2. Vim / etc/dovecot/dovecot.conf

24 protocols = imap pop3 lmtp # # supported pickup protocols

48 login_trusted_networks = 0.0.0.0amp 0 # # trust any network

49 disable_plaintext_auth = no # # enable plaintext authentication

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

123! include auth-sql.conf.ext # # enable MySQL authentication

4. Cp / usr/share/doc/dovecot-2.2.10/example-config/dovecot-sql.conf.ext / etc/dovecot/dovecot-sql.conf.ext

# # generate dovecot and read MySQL configuration

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

32 driver = mysql # # Database Type

71 connect = host=localhost dbname=email user=postuser password=123 # # query database, user and password

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

107 password_query =\ # # query password match

108 SELECT username, domain, password\ # # query user, domain name, password

109 FROM emailuser WHERE username ='% u 'AND domain ='% d'# # query from the emailuser table

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

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

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

168 first_valid_uid = 666 # # query user identity by email

175 first_valid_gid = 666

7.systemctl restart dovecot.service # # restart the dovecot service

* * Test

8. Shell mail

Vim / etc/postfix/main.cf

Myorigin = westos.com # # set to the real host domain name

Mydestination = # # Shell mail does not accept mail, so do not set

Relayhost = 172.25.254.174 # # IP of the real host replaced by

* * Test

The shell host sends mail to the native root, and the 174host receives the mail.

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

Database

Wechat

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

12
Report