Author Topic: RC and hMail virtuser_query  (Read 2997 times)

Offline iburnthings

  • Newbie
  • *
  • Posts: 9
RC and hMail virtuser_query
« on: September 10, 2014, 07:56:36 AM »
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.
« Last Edit: September 10, 2014, 08:29:08 AM by iburnthings »

Offline timex163

  • Newbie
  • *
  • Posts: 1
Re: RC and hMail virtuser_query
« Reply #1 on: September 14, 2014, 11:43:21 AM »
I have responded to you on the hmailserver forum post.


www.hmailserver.com/forum/viewtopic.php?t=27030