CyberHosting

creating email account realtime via JAVA

Hi,

I want to create email accounts in runtime by JAVA. I have discovered Rainloop uses e_users table for the email accounts. But the problem is password is stored as CRYPT hash and it seems that this hash is not only the password itself, some kind of "SALT" added.

Does anybody have idea how this password hash is created? And do I need to know more to create email accounts from JAVA on Rainloop?

Thanks in advance,
Muhtar
Tagged:
Tagged:

Comments

  • Look at /usr/local/CyberCP/plogical/mailUtilities.py

    As for the rest. Never worked with JAVA so cant help you there.
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.

    https://www.cyberhosting.org
  • Type your comment> @hennaboy said:
    > Look at /usr/local/CyberCP/plogical/mailUtilities.py
    >
    > As for the rest. Never worked with JAVA so cant help you there.

    Great thanks. I can find my way there I hope :)
  • Type your comment> @hennaboy said:
    > Look at /usr/local/CyberCP/plogical/mailUtilities.py
    >
    > As for the rest. Never worked with JAVA so cant help you there.

    Your comment is very useful. bcrypt is used and i have learned what i needed. Cheers...
  • Type your comment> @hennaboy said:
    > Look at /usr/local/CyberCP/plogical/mailUtilities.py
    >
    > As for the rest. Never worked with JAVA so cant help you there.

    Your comment is very useful. bcrypt is used and i have learned what i needed. Cheers...

    For the ones interested in implementing it in JAVA below is my code example. Not that class is in Spring Encryption API:

    public static boolean CreateEmailAcc(String user, String pass, String domain){
    try {
    pass = "{CRYPT}" + BCrypt.hashpw(pass,BCrypt.gensalt());
    EUsersEntity euser = new EUsersEntity();
    euser.setEmail(user + "@" + domain);
    euser.setPassword(pass);
    euser.setMail("maildir:/home/vmail/" + domain +"/" + user + "/Maildir");
    euser.setEmailOwner_id(domain);

    Also note: no need to create Maildir folder. Rainloop handles the folder creation.

    Hope it will be usefull.
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion