1

Topic: getting error of ldap_add: Invalid DN syntax (34)

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



as I displayed in the screen-shot below, I'm going to add a new mail user by running the sh file I got when I installed iredmail.    and for that getting error of a ldap_add: Invalid DN syntax (34)additional info: invalid DN. actually I'm very very new for .sh files and for the iredmail. can anybody help me to come over these? advance thank you for your precious time.

----

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

2 (edited by MuPp3t33r 2020-02-05 17:01:20)

Re: getting error of ldap_add: Invalid DN syntax (34)

sounds like you're using the LDAP scripts on a MySQL installation, try use the create_mail_user_SQL.sh script instead.
Note the the script doesn't automatically go and add the account in for you, all it does is generate the command that you need to add in to SQL to create the user.
In any case, the scripts aren't required to be used, you can use the iredadmin web interface as well.

3 (edited by prasanna 2020-02-05 18:02:59)

Re: getting error of ldap_add: Invalid DN syntax (34)

MuPp3t33r wrote:

sounds like you're using the LDAP scripts on a MySQL installation, try use the create_mail_user_SQL.sh script instead.
Note the the script doesn't automatically go and add the account in for you, all it does is generate the command that you need to add in to SQL to create the user.
In any case, the scripts aren't required to be used, you can use the iredadmin web interface as well.



hi sir thank you for your quick response. as you suggested i tried with the ./create_mail_user_SQL.sh user@a.com qwerty. and got a response as you said. but actually, i need to create a user by the terminal.
if i try to add the user from the browser, I'm getting a success response and everything is working fine too. but I need to work with the terminal.

here is the screenshot of ./create_mail_user_SQL.sh

4

Re: getting error of ldap_add: Invalid DN syntax (34)

I don't see your screenshot attached so not sure exactly what the issues is

I see you're using ./ to run the script, by default it's not executable so you may have to chmod +x create_mail_user_SQL.sh before running that way, otherwise just run it through bash

bash create_mail_user_SQL.sh dummy@domain.tld password

The result will look like this:

INSERT INTO mailbox (username, password, name,
                     storagebasedirectory,storagenode, maildir,
                     quota, domain, active, passwordlastchange, created)
             VALUES ('dummy@domain.tld', '{SSHA512}/zB/WPxT+CNvvyD1tvLniaHlbXa1asr7odrZ4SZgY6jcAtAcMrWpYE03lU9N8QAilNYd36XrqMUW17Uk6u0u0f8NZDpjfwZf', 'dummy',
                     '/var/vmail','vmail1', 'domain.tld/d/u/m/dummy-2020.02.05.12.04.48/',
                     '1024', 'domain.tld', '1', NOW(), NOW());
INSERT INTO forwardings (address, forwarding, domain, dest_domain, is_forwarding)
                 VALUES ('dummy@domain.tld', 'dummy@domain.tld','domain.tld', 'domain.tld', 1);

That result above is what you need to insert into MySQL to create the user

Not sure if you've seen it yet, but there is a handy doc with all the info you should require here: https://docs.iredmail.org/sql.create.mail.user.html

5

Re: getting error of ldap_add: Invalid DN syntax (34)

MuPp3t33r wrote:

I don't see your screenshot attached so not sure exactly what the issues is

I see you're using ./ to run the script, by default it's not executable so you may have to chmod +x create_mail_user_SQL.sh before running that way, otherwise just run it through bash

bash create_mail_user_SQL.sh dummy@domain.tld password

The result will look like this:

INSERT INTO mailbox (username, password, name,
                     storagebasedirectory,storagenode, maildir,
                     quota, domain, active, passwordlastchange, created)
             VALUES ('dummy@domain.tld', '{SSHA512}/zB/WPxT+CNvvyD1tvLniaHlbXa1asr7odrZ4SZgY6jcAtAcMrWpYE03lU9N8QAilNYd36XrqMUW17Uk6u0u0f8NZDpjfwZf', 'dummy',
                     '/var/vmail','vmail1', 'domain.tld/d/u/m/dummy-2020.02.05.12.04.48/',
                     '1024', 'domain.tld', '1', NOW(), NOW());
INSERT INTO forwardings (address, forwarding, domain, dest_domain, is_forwarding)
                 VALUES ('dummy@domain.tld', 'dummy@domain.tld','domain.tld', 'domain.tld', 1);

That result above is what you need to insert into MySQL to create the user

Not sure if you've seen it yet, but there is a handy doc with all the info you should require here: https://docs.iredmail.org/sql.create.mail.user.html








thank you very much sir. i found solution you can close this issue now.