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 send mail service

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

Share

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

The following mainly brings you postfix+mysql send mail service, I hope these contents can bring you practical use, this is also my main purpose of editing postfix+mysql send mail service this article. All right, don't talk too much nonsense, let's just read the following.

1. Configure mysql

* before the experiment, make use of database and table.

* add and authorize database users

* 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 # # query mailbox location

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/

For the above about the postfix+mysql mail service, you do not think it is very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.

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