1

Topic: bulk create domains and users

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
==== ==== Required information ====
- iRedMail version: 0.8.1
- Store mail accounts in which backend (MySQL):
- Linux/BSD distribution name and version: CentOS6.2
- Related log if you're reporting an issue:
====

Dear Zhang,

We got about 200 domains and 1500 user accounts under these domains need to be migrated to new server and we are considering purchase your iRedadmin-pro panel, but we want to know is there any script available for bulk creating these domains and users with preset default values such as config and quota. Really appreciate if you may assist on such script.

We will pull domain names and user accounts from old mail server with mysql db as well but has different structure tables.

----

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

2

Re: bulk create domains and users

- To create users, take a look at scripts shipped in iRedMail: iRedMail-0.8.1/tools/create_mail_user_MySQL.sh.
- To create domains, just insert records in table "vmail.domain" with proper values.

3

Re: bulk create domains and users

Dear Zhang,

How about the dbs and tables for iredadmin-pro? Is there any script to read from a csv file of email accounts and bulk populate those tables with accounts and default constraint values such as domain and user level smtp throttle quota? Thanks.

4

Re: bulk create domains and users

pang wrote:

How about the dbs and tables for iredadmin-pro?

iRedAdmin-Pro manages mail accounts stored in "vmail" database. It doesn't have special data you need to care about during creating new accounts.

pang wrote:

Is there any script to read from a csv file of email accounts and bulk populate those tables with accounts and default constraint values such as domain and user level smtp throttle quota? Thanks.

Take a look at iRedMail-0.8.1/tools/create_mail_user_OpenLDAP.py. It reads CSV file and generates a LDIF file used to import mail users. Note: It doesn't create mail domains.

There's no script used to import throttling settings. Sorry. Please refer to Policyd official document instead, it should be easy:
http://policyd.sourceforge.net/readme.html

5

Re: bulk create domains and users

Hi Zhang

I am importing old mail server data to table vmail.domain, there are following fields:

mailboxes - domain mailbox number limit
maxquota - domain space quota limit
quota - what is this for?
aliases - is it for domain alias number limit?

for table vmail.used_quota, do we need to import data into it or those usage data will be automatically calculated and populated after emails being migrated to storage base folder?

BTW, If we do not have paypal account and make payment of iredadmin-pro by credit card, how can we get the product relevant info? Thanks.

6

Re: bulk create domains and users

pang wrote:

quota - what is this for?

Column "quota" is not used in iRedMail.
It's a historical issue, we use PostfixAdmin SQL structure in the beginning, but didn't remove it when we don't use it anymore. Sorry about the confusion.

pang wrote:

aliases - is it for domain alias number limit?

Yes. With aliases=20, admin can create up to 20 mail alias accounts.
Note: mailboxes and aliases are limited by admin panel, not in Postfix or Dovecot.

pang wrote:

for table vmail.used_quota, do we need to import data into it or those usage data will be automatically calculated and populated after emails being migrated to storage base folder?

You don't need to touch it.
vmail.used_quota will be updated by Dovecot automatically. For example:
- user first login, dovecot will insert a new record with the initial mailbox quota size and message numbers.
- user delete a message, dovecot will update it with new quota size and message numbers.
- ...

I updated comments in iRedMail/samples/iredmail.mysql with above info. Hope it won't cause confusion anymore.

pang wrote:

BTW, If we do not have paypal account and make payment of iredadmin-pro by credit card, how can we get the product relevant info? Thanks.

After you click "Buy now" link in purchase page (http://www.iredmail.org/admin_buy.html), you will be redirected to PayPal.com, you can either purchase it with an existing PayPal account, or a credit card (which supported by PayPal) without PayPal account.

Hope it's ok for you.

7

Re: bulk create domains and users

Hi Zhang,

Thanks for your prompt reply smile just to confirm will the email address that we put in credit card payment fields be the admin contact email for you to send product relevant info and invoice? Thanks.

8

Re: bulk create domains and users

pang wrote:

just to confirm will the email address that we put in credit card payment fields be the admin contact email for you to send product relevant info and invoice?

Yes.

After payment completed, it will trigger a script to send an email with download link (no invoice, sorry) immediately to the email address you input. But don't worry, feel free to contact me (support _at_ iredmail.org) to update contact, ask for an invoice, etc.

9

Re: bulk create domains and users

Hi we just purchased pro version of iRedMail.

I prepare small cli script. It can be well used for importing domains and user accounts or aliases.

http://www.vojcik.net/command-line-tool … kend-only/

https://github.com/rvojcik/iredmail-cli

10

Re: bulk create domains and users

hi wiro,

Thanks very much for your purchase and sharing. smile