1

Topic: Mail user creation using terminal, not correct password

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Ubuntu server 20.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Dear Sirs, Dear Mr.  Huangbin,
I have something a little strange to report. I used the /tools/create_mail_user_SQL.sh of iRedMail-1.3.1 installed on 20.04
Everything went well, but the created user was not possible to login in roundcube. The only solving solution was to change password (I put the same password as it was before at the create_mail_user_SQL.sh) using the web iRedAdmin, standard version. After that, the user is able to login to roundcube normally. I did the exact same test using another mail user and again faced the above reported problem.
What to you think was wrong? Something related to the way that SSHA512 was calculated inside the sh script?

Thanks and Best Regards.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Mail user creation using terminal, not correct password

- How did you run "create_mail_user_SQL.sh"?
- Does your password contain special characters but not quoted with single or double quotes? e.g. #.
- What's the password hash stored in SQL table "vmail.mailbox"?

3

Re: Mail user creation using terminal, not correct password

ZhangHuangbin wrote:

- How did you run "create_mail_user_SQL.sh"?
- Does your password contain special characters but not quoted with single or double quotes? e.g. #.
- What's the password hash stored in SQL table "vmail.mailbox"?

Dear Mr. Huangbin, my replies are below:

I  run it from the terminal using the root account just like the supporting example.

Yes, most of my users passwords have special characters like $ and I just passed without single or double quotes mostly because I didn't get any instruction to do so. Please write it to its documentation and script comments

Sorry, I don't have that incorrect hash stored passwords, because I re-create all of them for the users, using the iRedAdmin web.

Thanks a lot for your answer and support.

Best Regards,
Mike Kranidis

4

Re: Mail user creation using terminal, not correct password

mikekgr wrote:

Yes, most of my users passwords have special characters like $ and I just passed without single or double quotes mostly because I didn't get any instruction to do so. Please write it to its documentation and script comments

ok, I updated document to mention "always using single quote".

"$" is special in shell, it's used for variable substitution. For example, if you input "abc$def" (without quote), it becomes to "abc" and value of variable "def". If "def" is defined and set to "123", then the final password will be "abc123".

5

Re: Mail user creation using terminal, not correct password

ZhangHuangbin wrote:
mikekgr wrote:

Yes, most of my users passwords have special characters like $ and I just passed without single or double quotes mostly because I didn't get any instruction to do so. Please write it to its documentation and script comments

ok, I updated document to mention "always using single quote".

"$" is special in shell, it's used for variable substitution. For example, if you input "abc$def" (without quote), it becomes to "abc" and value of variable "def". If "def" is defined and set to "123", then the final password will be "abc123".

Dear Mr. Huangbin,
now it is more than clear. Thanks for the explanation.

Best Regards.