1 (edited by mohan 2012-04-14 12:46:06)

Topic: Bulk User Adding

Hi Zhang,

I am trying to add bulk users with the script  http://iredmail.googlecode.com/svn/trun … penLDAP.py , I am geting users added and quota as I am defining in csv file, but not able to login with the password provided, even when try to change the password from panel that password also it is not accepting.

Kindly suggest a solution for this. I am attaching  the testusers.csv.ldif which I exported to LDAP for adding bulk users.

I added with the ldapadd command from command line as below:
root@mail opt]# ldapadd -x -D cn=Manager,dc=mydomain,dc=com -W -f testusers.csv.ldif

Thanks,
Mohan

Post's attachments

testusers.csv.ldif 4.68 kb, 4 downloads since 2012-04-14 

You don't have the permssions to download the attachments of this post.

----

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

2

Re: Bulk User Adding

The LDIF data is not correct. For example:

- it has "memberOfGroup:: DQ==", the correct value of memberOfGroup must be an email address.
- missed many values of 'enabledService'
- ...

Could you show us the sample data of your CSV file? and the full command you used to generate LDIF data and its output mesage.

3 (edited by mohan 2012-04-16 11:23:06)

Re: Bulk User Adding

ZhangHuangbin wrote:

The LDIF data is not correct. For example:

- it has "memberOfGroup:: DQ==", the correct value of memberOfGroup must be an email address.
- missed many values of 'enabledService'
- ...

Could you show us the sample data of your CSV file? and the full command you used to generate LDIF data and its output mesage.

Hi Zhang,

I have attached the testusers.csv file.

full command used to generate ldif file:root@mail#  python  create_mail_user_OpenLDAP.py testusers.csv

command used to add in ldap database:  root@mail# ldapadd -x -D cn=Manager,dc=cubemail,dc=com -W -f testusers.csv.ldif

Thanks,
Regards,
Mohan

Post's attachments

testusers.csv 198 b, 7 downloads since 2012-04-16 

You don't have the permssions to download the attachments of this post.

4

Re: Bulk User Adding

- You must append one more ',' each line in testusers.csv if you don't assign them to a group.
- There's a bug in create_mail_user_*, please download the latest version here:
https://bitbucket.org/zhb/iredmail/src/ … Mail/tools

5

Re: Bulk User Adding

Hi Zhang,

I have downloaded the updated script and now able to add users and login , but when trying to send mail getting error in maillog  as
" mail amavis[8024]: (08024-02) (!)ClamAV-clamd av-scanner FAILED: CODE(0x98936a8) unexpected , output="/var/amavis/tmp/amavis-20120416T150159-08024/parts: lstat() failed: Permission denied. ERROR\n" at (eval 105) line 596."Apr 16 15:25:07 mail amavis[8024]: (08024-02) (!!)WARN: all primary virus scanners failed, considering backups
I have pasted the ldif file for you reference.
dn: mail=user4@test.com,ou=Users,domainName=test.com,o=domains,dc=mydomain,d
c=com
changetype: add
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
mail: user4@test.com
userPassword: cloud2012
mailQuota: 100
cn: User4
sn: user4
uid: user4
storageBaseDirectory: /var/vmail
/mailMessageStore: vmail1/test.com/u/s/e/user4-2012.04.16.12.13.46/
homeDirectory: /var/vmail/vmail1/test.com/u/s/e/user4-2012.04.16.12.13.46/
accountStatus: active
mtaTransport: dovecot
enabledService: mail
enabledService: smtp
enabledService: smtpsecured
enabledService: pop3
enabledService: pop3secured
enabledService: imap
enabledService: imapsecured
enabledService: deliver
enabledService: lda
enabledService: forward
enabledService: senderbcc
enabledService: recipientbcc
enabledService: managesieve
enabledService: managesievesecured
enabledService: internal
enabledService: sieve
enabledService: sievesecured
enabledService: shadowaddress
enabledService: displayedInGlobalAddressBook

Thanks
Regards,
Mohan

6

Re: Bulk User Adding

LDIF data is OK. But the error is reported by Amavisd, not LDAP.

mohan wrote:

mail amavis[8024]: (08024-02) (!)ClamAV-clamd av-scanner FAILED: CODE(0x98936a8) unexpected , output="/var/amavis/tmp/amavis-20120416T150159-08024/parts: lstat() failed: Permission denied. ERROR\n" at (eval 105) line 596."Apr 16 15:25:07 mail amavis[8024]: (08024-02) (!!)WARN: all primary virus scanners failed, considering backups

May i know which Linux/BSD distribution and release version you're running?

If you're running Debian or Ubuntu, please add ClamAV system user 'clamav' to Amavisd group 'amavis'. For example:

# adduser --quiet clamav amavis

7

Re: Bulk User Adding

Hi Zhang,

We have centos 5.6 32 bit linux os, iredmail 0.7.2 and iredproldapadmin-1.6.3.

I have now getting error with roundcube while sending mail from the user added with bulk user script.

roundcube: IMAP Error: Could not save message in Sent in /var/www/roundcubemail-0.5.3/program/steps/mail/sendmail.inc on line 669 (POST /?_unlock=loading1334639464640?_task=mail&_action=send

Thanks,
Regards,
Mohan

8

Re: Bulk User Adding

Please check Dovecot log file also.

9 (edited by mohan 2012-04-18 15:25:35)

Re: Bulk User Adding

Hi Zhang,

I am now able to add bulk users with script and also able to send mails.

In the users.csv file previously the quota I set 100 it is taking in bytes, so changed to 100000000 bytes which is 100 MB, now mails are working. Because of quota being 100 bytes roundcube was not able to save in sent items and throwed  error message. Now it is solved.

Thanks,
Regards,
Mohan