Do I need to create a Subaccount or should I use the mailbox only when opening a new mailbox via API?

Ram Freedman

Member
Jul 18, 2017
19
0
1
Israel
cPanel Access Level
Website Owner
Hi.
I'm trying to create a pop mailbox and also to delete such a mailbox via cpanel API and I have some questions:

1. Do I need to create a Subaccount for everyone I want to open a pop mailbox for?

When I read the documentation for Create email address I see this message:

  • We recommend that you use the UAPI UserManager::create_user function to create an email address instead of this function. This function is incompatible with the Reset Password feature.
The problem is that I was unable to find a UserManager::create_user api command unless it's the Create Subaccount command.
So do I need to create a Subaccount for everyone I want to open a pop mailbox for? I just need mailboxes without any FTP or other access.


2. In both cases (add_pop and create_user) I see that I should create a password during the account / mailbox creation - Is there a way to have cpanel to issue a random password to such a user / mailbox just like when manually creating a mailbox?

3. I see that when creating a Subaccount there is a way to send a reset password email to the Subaccount's alternate email address ( send_invite=) but the welcome_email is sent to the client account - is there a way for me to send those instructions ( services.email.send_welcome_email= ) to the alternate email address?

I would really appreciate your input.
Thanks!
Ram
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,188
790
313
cPanel Access Level
Root Administrator
Hey there! I'll go through and answer these in order to make sure I don't miss anything.

1 - "Subaccount" is just the general term for the function, but it can be used to make an email account. For example, here's an SSH version of the UAPI call to make an email account named "[email protected]"

Code:
uapi --user=username UserManager create_user domain='domain.com' password=12345 username=emailtest services.email.enabled=1
2 - At this time there is not a built-in function to create a random password. I'm sure there is a way to call a custom password generator script along with the API itself, but that would require a bit more programming work.

3 - I'm not seeing a way to do this one either, but that sounds like an excellent feature request if you'd like to get that submitted using the link in my signature below.
 
  • Like
Reactions: Ram Freedman

Ram Freedman

Member
Jul 18, 2017
19
0
1
Israel
cPanel Access Level
Website Owner
Hi,
Thanks for your help.

1 - "Subaccount" is just the general term for the function, but it can be used to make an email account. For example, here's an SSH version of the UAPI call to make an email account named "[email protected]"
That's strange... in the Create email address documentation there is a clear message not to use the `add_pop` command but rather to use the Create Subaccount command. I see that while using the Create Subaccount command I can also create an mailbox (among other things) while the add_pop is only for adding mailbox.
never mind since I need only to create a mailbox I guess I`ll use the add_pop.

2 - At this time there is not a built-in function to create a random password. I'm sure there is a way to call a custom password generator script along with the API itself, but that would require a bit more programming work.
Thanks - I think that adding such a feature will help creating a more secured mailboxes.

3 - I'm not seeing a way to do this one either, but that sounds like an excellent feature request if you'd like to get that submitted using the link in my signature below.
Done - I added such a feature request here:

Thanks for your help!
Ram