I need some help getting virtuser_query plugin to extract usernames from one table, and create identities in RC based on the domains in another table.
My hmail database has a few tables that I need virtuser to look at.
the first is table hm_accounts and it has an accountaddress column which lists as user@domain1.tld
the next is hm_aliases which has custom email addresses for a select number of accounts. aliasname has custom@domain.tld and aliasvalue has user@domain.tld
the third is hm_domain which has my primary domain as a single entry
the fourth is hm_domain_aliases which has all my secondary domain names linked to the primary. column daaslias lists 'domain1.tld' 'domain2.tld'
so I need virtuser_query to take the hm_accounts entry for the current user %u, remove @domain1.tld from it
then look at hm_domain_aliases and add each %u to each entry in table hm_domain_aliases
create identities for each.
Then less importantly I'd like to have hm_aliases processed and identities created for each custom email
Alternatively if it's possible to get virtuser_file to accept wildcards as part of the flatfile
for example instead of defining each account manually, just put something like.
%u@domain.tld %u
%u@domain1.tld %u
or a small script to generate my flatfile using a similar method described for virtuser_query
Another option would be to take %u (or the rc table 'identities' extract the 'name' value)
then take 'hm_domain_aliases'
add them together with an @ between them and inject the new values into roundcubemail.identities table
I don't know much about php, scripting, or mysql commands at all. Thanks in advance for the help.