This post will explain how to create users and mailboxes for Zarafa.
I’ve tested it with CentOS 5.4 X86_64 and Zarafa 6.30.9 but it will fit with nearly all installation.
First of all you have to create a test file with all the users you want to create, providing the following information :
- username
- password
- email address
- name
- surname
For example :
johndoe password johndoe@example.com John Doe
janedoe password janedoe@example.com Jane Doe
Save the text file whatever you want.
The following is the shell script that read your text file and create all Zarafa users.
If you use the script, all the users will not be administrator, so you have to create manually and administrator.
#!/bin/bash # Written by Matteo Predieri - m.predieri_AT_damsistemi_DOT_it # Written by Riccardo Riva - r.riva_AT_damsistemi_DOT_it # # Simple and raw script to create zarafa users and mailboxes from a test file # # The full fill-in of the text file is mandatory # So fill in both "Name" and "Surname" with the following syntax # # username password email name surname # USERS_LIST=/tmp/userlists.txt ZARAFA_CMD=/usr/bin/zarafa-admin LOGFILE=/tmp/zara_user_creation.log echo "Zarafa User Creation Log" > $LOGFILE what="user"; for item in $( cat $USERS_LIST ); do if [ $what = "user" ]; then user=$item; what="passwd"; else if [ $what = "passwd" ]; then passwd=$item; what="email"; else if [ $what = "email" ]; then email=$item; what="name"; else if [ $what = "name" ]; then name=$item; what="surname"; else surname=$item; echo "Result in creating User: $user, with password: $passwd, with email address: $email with Full Name: $name $surname :" >> $LOGFILE FULLNAME="'$name $surname'" $ZARAFA_CMD -c $user -p $passwd -e $email -f "$FULLNAME" -a0 >> $LOGFILE echo -ne "-------------------------------\n" >> $LOGFILE what="user"; fi fi fi fi done # --- End of file ---
You’ve done.
Hope this help
Bye
Riccardo
Print This Post























