Alias With Own Mail From API

Is there a way to create an alias with it's own mail from the api? I can't seem to find it or figure it out.

Status: 
Closed (fixed)

Comments

Never mind, I looked at the help from the command line and found it easily.

I do keep getting this now: Mail for the domain cannot be enabled unless an administration user is created

You should just use the --alias-with-mail parameter, instead of --alias

When I did that, it did not create the domain so that I could add users like it did when I created it from the user interface.

Could you post the full command you are using to create the domain? It should be something like :

virtualmin create-domain --domain aliasdomain.com --alias-with-mail originaldomain.com --dir --mail

virtualmin create-domain --domain aliasdomain.com --alias-with-mail originaldomain.com --dir --mail --web --dns --spam --virus

Now I'm getting:

Unknown plan name

When I set the plan I get the error about "Mail for the domain cannot be enabled unless an administration user is created"

You don't need to set the --plan parameter at all, because plans only apply to top-level virtual servers. Aliases inherit all limits from their parent.

When I don't set plan it asks me for a plan though.

This is also an alias of a sub-server if it matters.

Which VIrtualmin version are you using there? From looking at the code for create-domain , it only outputs that "Unknown plan name" message if the --plan parameter is given.

I figured the plan issue out. But I am still getting the error:

Mail for the domain cannot be enabled unless an administration user is created

Does it matter that I am trying to make this an alias with it's own mail of a sub-server?

Does the sub-server you are trying to create an alias of have email enabled?

It wasn't turned on before, but I just turned it on and I am still getting the same message:

Mail for the domain cannot be enabled unless an administration user is created

I made the alias from the user interface and it worked properly, that is why it's so baffling that it is not working.

Ok, I see the bug now. The work-around is to add the flag --parent xxx.com , where xxx.com is the top-level virtual server for the sub-server.

This will be fixed properly in the next Virtualmin release.

I still can't get it to add the server by putting the parent domain. It returns the same error.

Can you send me a patch or something? I need this working on one server in particular as soon as possible.

I have attached a replacement for the file /usr/{share,libexec}/webmin/virtual-server/create-domain.pl to this bug report.

Should it go to both folders or does only one of them exist? ({share,libexec})

On debian/ubuntu it should go under /usr/share

On redhat/centos/fedora it should go under /usr/libexec

The error didn't show up but when I browse the the domain in the gui, I don't see Edit Users, I see Edit Mail Aliases.

Did you supply the --dir flag to create-domain ?

It worked like a charm. I had it in there before, I must have accidentally deleted it while testing different combinations. Thanks!

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