1

Topic: LDAP script to create import users

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

I have setup a cron job to run this script and import all of my LDAP users into IREDMAIL and create mailboxes for them:

https://forum.iredmail.org/post27294.html#p27294

But when running the script im getting this error

line 108: hash_domain: command not found
line 108: hash_maildir: command not found

The script is able to create the users but they all share the same mailbox

If i remove/delete a user i get this error when a cronjob tries to run this

python3 /opt/www/iredadmin/tools/delete_mailboxes.py

ERROR:

* <<< SKIP >>> Seems no timestamp in maildir path (/var/vmail/vmail1/), too risky to remove this mailbox.
* <<< SKIP >>> Seems no timestamp in maildir path (/var/vmail/vmail1/), too risky to remove this mailbox.
* <<< SKIP >>> Seems no timestamp in maildir path (/var/vmail/vmail1/), too risky to remove this mailbox.
* <<< SKIP >>> Seems no timestamp in maildir path (/var/vmail/vmail1/), too risky to remove this mailbox.
* <<< SKIP >>> Seems no timestamp in maildir path (/var/vmail/vmail1/), too risky to remove this mailbox.
* <<< SKIP >>> Seems no timestamp in maildir path (/var/vmail/vmail1/), too risky to remove this mailbox.


Please advise

----

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

2

Re: LDAP script to create import users

This link was 7 years old. don't try it.

jdlpc wrote:

* <<< SKIP >>> Seems no timestamp in maildir path (/var/vmail/vmail1/), too risky to remove this mailbox.

This directory contains all users' mailboxes, you incorrectly added some users.

Please check our tutorial here:
https://docs.iredmail.org/ldap.bulk.cre … users.html

Also: https://docs.iredmail.org/

3

Re: LDAP script to create import users

How can i delete these users so i dont get the errors?

Also, your script is great but that only allows creating a user for the "first time"

I want to be able to sync the password changes so when a password changes in my LDAP server it updates the password of the user mailbox in IredMail

4

Re: LDAP script to create import users

jdlpc wrote:

Also, your script is great but that only allows creating a user for the "first time"

Please check our tutorial: https://docs.iredmail.org/ldap.bulk.cre … users.html

jdlpc wrote:

I want to be able to sync the password changes so when a password changes in my LDAP server it updates the password of the user mailbox in IredMail

You may want to setup OpenLDAP replication instead. FYI:
https://www.openldap.org/doc/admin24/gu … eplication