How can I get the domain from a username?

Guys,

I know this may sound like a silly question but does virtualmin command line allow me to get the domain fo the user if I have the username?

I'm trying to take into account multiple top level domains (domain.com.au, domain.com, etc). I can easily script something to grab the domain assuming all domains are the same top level (.com, .net) but if it ends in .com.au I can't figure out how to grab it.

Was hoping there was a lookup using virtualmin that would display the domain of a user (user.domain.com.au, user.domain.net, etc).

Thanks!
-- Craig

Status: 
Closed (fixed)

Comments

Sure, you can do this using the API with a command like :

virtualmin list-domains --user bob --name-only

or to get just the top-level domain, use

virtualmin list-domains --user bob --name-only --toplevel

I thought there might be... unfortunately neither of those commands works for me...

[root@mail05 ~]# virtualmin list-domains --user cindy --name-only
No top-level domain owned by cindy exists

In this case, do you happen to know the domain that the user "cindy" owns?

If so, I'm curious what output this command produces:

virtualmin list-domains --domain cindysdomain.tld

The output of that command will show the user that Virtualmin thinks owns that domain, and we can use that to try and sort out why that's not working for you.

Re-read my first message except replace the last sentence with the following:

Was hoping there was a lookup using virtualmin that would display the domain of an EMAIL user (user.domain.com.au, user.domain.net, etc). Not the domain owner.

Sorry, that isn't possible in the current release.

However, since this is a pretty good idea I will add a --mail-user flag to the list-domains API command in the next release, to allow searching by mail user.

Do you have an estimated release for this feature? Not pushing just planning. Thanks!

Probably a couple of weeks away.

Automatically closed -- issue fixed for 2 weeks with no activity.