Virtualmin can't enable mail with an additional virtual_alias_map configured

Operating system:
OS version:
10 (buster)

I have a server with virtualmin, which has an additional virtual_alias_map configured, using mysql for additional (dynamic) aliases:

virtual_alias_maps = hash:/etc/postfix/virtual,mysql:/etc/postfix/

Since this is only a readonly lookup (from the perspective of postfix or virtualmin), the user inside that cf-file has only SELECT-priviledges. All normal users (from virtualmin) are in the file-based table (/etc/postfix/virtual)
However virtualmin “sees” the mysql-config and tries to insert data there, leading to an error when enabling/disabling mail for a domain:
Mail for domain failed! : SQL insert failed : INSERT command denied to user ‘SOME_DB_USER’@‘localhost’ for table ‘mail_config’

SQL delete failed : DELETE command denied to user ‘SOME_DB_USER’@‘localhost’ for table ‘mail_config’

Is there a way to make virtualmin ignore the db-lookup-config?
I.e. virtualmin should behave, as if the line in is:
virtual_alias_maps = hash:/etc/postfix/virtual

Regards, Tim

Ah, I should have tried that before, just as I have posted the message, I had an idea, which worked:
Apparently, virtualmin uses the last alias-map from that list, i.e. by changing the order, I could enable/disable mail for the domains again:

virtual_alias_maps = mysql:/etc/postfix/,hash:/etc/postfix/virtual

That’s a nice (undocumented?) feature and thank you for sharing the solution with us

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.