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

Postfix+mysql

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

Share

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

1. Configure mysql

Before the experiment, the production should use the database and tables.

Add database users and authorize them

* vim / etc/postfix/mailuser.cf # # query user name

1 host = localhost # # Database host

2 user = postuser # # Login database user

3 password = 123 # # login password

4 dbname = email # # name of the postfix query library

5 table = emailuser # # name of the postfix query table

6 select_field = username # # fields for postfix query

7 where_field = username # # conditions for postfix query

* vim / etc/postfix/maildomain.cf # # Domain name query

1 host = localhost

2 user = postuser

3 password = 123

4 dbname = email

5 table = emailuser

6 select_field = domain

7 where_field = domain

Vim / etc/postfix/mailbox.cf

1 host = localhost

2 user = postuser

3 password = 123

4 dbname = email

5 table = emailuser

6 select_field = maildir

7 where_field = username

test

two。 Configure postfix

Groupadd-g 666 vmail # # add a user group and specify a gid of 666

Useradd-s / sbin/nologin-u 666 vmail-g 666 # # add users and specify uid and gid as 666

* postconf-e "virtual_mailbox_base = / home/vmail" # # set the virtual user mail directory

Postconf-e "virtual_uid_maps = static:666" # # specify the virtual user to create the file uid

Postconf-e "virtual_gid_maps = static:666" # # specify the virtual user to create the file gid

Postconf-e "virtual_alias_maps = mysql:/etc/postfix/mailuser.cf" # # specify MySQL lookup host

Postconf-e "virtual_mailbox_domains = mysql:/etc/postfix/maildomain.cf" # # specify the MySQL lookup domain name

Postconf-e "virtual_mailbox_maps = mysql:/etc/postfix/mailbox.cf" # # specify MySQL to find mailboxes

* systemctl restart postfix # # restart the postfix service

test

The email sent to linux@linux.com is found in / home/vmail/linux/new/

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