1

Topic: import users / export

Hi

I need to import a csv file of users. How can i do?

config : debian 5 / iredmail-0.6.0 ldap / iredamin-pro-1.1.1

I need my users configure a mail forwarding. How can I give that access? And how get stats of users with no mail forwarding?

Thanks

2

Re: import users / export

You can use tool script in iRedMail to import user accounts: http://iredmail.googlecode.com/hg/iRedMail/tools/ (File name: create_mail_user_OpenLDAP.py).

Users can set mail forwarding in Roundcube webmail in 'Filter' table.

What do you mean 'get stats of users with no mail forwarding'?

3

Re: import users / export

ZhangHuangbin wrote:

You can use tool script in iRedMail to import user accounts: http://iredmail.googlecode.com/hg/iRedMail/tools/ (File name: create_mail_user_OpenLDAP.py).

Users can set mail forwarding in Roundcube webmail in 'Filter' table.

What do you mean 'get stats of users with no mail forwarding'?

many thanks for your answer.

About stats, it's just to check if users have a mail forwarding or not.

4

Re: import users / export

ZhangHuangbin wrote:

You can use tool script in iRedMail to import user accounts: http://iredmail.googlecode.com/hg/iRedMail/tools/ (File name: create_mail_user_OpenLDAP.py).

Users can set mail forwarding in Roundcube webmail in 'Filter' table.

What do you mean 'get stats of users with no mail forwarding'?


For the mail fowarding, i need a global forwarding without keeping a copy of mail on the server.

5

Re: import users / export

if you use iRedAdmin-Pro to set per-user mail forwarding, you can use 'ldapsearch' or phpLDAPadmin to search your ldap server with below ldap filter:

(&(objectclass=mailUser)(mailForwardingAddress=*@*))

If set mail forwarding via Roundcube webmail, you should use 'grep' to find forwarding under /var/vmail/ (Default mailbox storage).

6

Re: import users / export

odaraujo wrote:
ZhangHuangbin wrote:

You can use tool script in iRedMail to import user accounts: http://iredmail.googlecode.com/hg/iRedMail/tools/ (File name: create_mail_user_OpenLDAP.py).

Users can set mail forwarding in Roundcube webmail in 'Filter' table.

What do you mean 'get stats of users with no mail forwarding'?

many thanks for your answer.

About stats, it's just to check if users have a mail forwarding or not.

I tried your import script. I've no error message. the file ldif seems ok. but nothing in the vmail folder. It's for a virtual domain.

Thanks

7

Re: import users / export

odaraujo wrote:

I tried your import script. I've no error message. the file ldif seems ok. but nothing in the vmail folder. It's for a virtual domain.

Dovecot will create maildir automaticly when user login via POP3/IMAP.

8

Re: import users / export

ZhangHuangbin wrote:
odaraujo wrote:

I tried your import script. I've no error message. the file ldif seems ok. but nothing in the vmail folder. It's for a virtual domain.

Dovecot will create maildir automaticly when user login via POP3/IMAP.

There is nothing in iRedAdmin and login via roundcubemail fail.

I think the problem is here :
# Prompt to import user data.
'''
Would you like to import them now?""" % (ldif_file)

answer = raw_input('[Y|n] ').lower().strip()

if answer == '' or answer == 'y':
    # Import data.
    conn = ldap.initialize(LDAP_URI)
    conn.set_option(ldap.OPT_PROTOCOL_VERSION, 3)   # Use LDAP v3
    conn.bind_s(BINDDN, BINDPW)
    conn.unbind()
else:
    pass
'''

9

Re: import users / export

how to check if ldap import data works fine?

    # Import data.
    conn = ldap.initialize(LDAP_URI)
    conn.set_option(ldap.OPT_PROTOCOL_VERSION, 3)   # Use LDAP v3
    conn.bind_s(BINDDN, BINDPW)
    conn.unbind()

10

Re: import users / export

For information the import of the ldif file in ldapadmin works fine