On 13/03/2023 02.10, Antonino Di Mauro via Postfix-users wrote:
unfortunately I don't know this topic, but I'm really willing to study.
Please do you have any documentation on this?
https://dev.mysql.com/doc/refman/8.0/en/
I'm no expert on Postfix, but can talk about databases. To help with
your understanding of the system, and our understanding of the problem
you face (and perhaps any language-barrier), let's try the following:-
As a first step, let's see if the database is set-up correctly (and if
postfix has been given two essential elements to link with MySQL). If
these are working, then we can move-on to looking at postfix problems...
If you would like to check your settings against a working-example, here
is what is working for these domains:
main.cf (includes)
virtual_mailbox_domains = mysql:/etc/postfix/auth/mysql_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/auth/mysql_users.cf
virtual_alias_maps = mysql:/etc/postfix/auth/mysql_aliases.cf
Thus, there are three files which configure how MySQL is to respond to
Postfix enquiries. Taking one of them as an example:
mysql_domains.cf
user = ****userNM****
password = ****secret****
hosts = ****host****
dbname = ****dbname****
query = SELECT 1 FROM ****dbname****.domains WHERE domainNM='%s'
NB your system will use different ****data-values****. Substitute those
values for what is written below. The three .cf files are very similar.
Please check all of them, and discuss any differences in a reply 'here'...
Also, if you have handled the db-credentials differently, make
appropriate adjustments - this is the simple method illustrated in most
web-page how-tos!
First, check that MySQL is up-and-running:
systemctl status mysql
...
Active: active (running)
(your system may require a different command, but ultimately the next
step will reveal whether the RDBMS is running - or not. Am also assuming
Dovecot (or whatever) is also up-and-running)
To check that the database logic will work, from the command-line on the
server log in to MySQL:
mysql -u ****userNM**** -p -h ****host****
It will then ask:
Enter password: ****secret****
and respond with:
Welcome to the MySQL monitor. Commands end with ; or \g.
...
mysql>
Copy the query from the .cf file (everything from SELECT onwards, and
substitute valid database/schema and domain-names (in this case):
mysql> SELECT 1 FROM ****dbname****.domains WHERE domainNM='rangi.cloud';
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
The response of "1" says that MySQL found exactly one domain called
"rangi.cloud" (in my case) in the table. Not finding anything means that
the definition is missing - finding two would be unnecessary/greedy!. A
number greater than zero proves that the MySQL part works correctly.
How does the MySQL server respond to the three .cf files' queries?
There are other settings to examine if the above all works as-planned,
but the system is still not working correctly...
--
Regards =dn
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org