Thursday, April 2, 2015

Setup your MAIL Exchange server with zarafa on CentOS 6 Part 3

now the actual setup of zarafa server after all the work we have done in part1 and part2.

Start the mysql server using command

# service mysqld start
Let us create a database called “zarafadb” and database user “zarafauser” with password “centos”. Change these values with your own values.
Log in to mysql server using command:
# mysql -u root -p
Create database “zarafadb” and assign the full permission to the user “zarafauser” over zarafadb.
mysql> create database zarafadb;
mysql> GRANT ALL ON zarafadb.* TO zarafauser@localhost IDENTIFIED BY 'somepass';
mysql> flush privileges;
mysql> exit
Add the database details to the zarafa server configuration file.
Edit file /etc/zarafa/server.cfg,
# vi /etc/zarafa/server.cfg
Find the following lines and Change the zarafa database values.
[...]

# The user under which we connect with MySQL
mysql_user              = zarafauser

# The password for the user (leave empty for no password)
mysql_password          = somepass

# Override the default MySQL socket to access mysql locally
# Works only if the mysql_host value is empty or 'localhost'
mysql_socket            =

# Database to connect to
mysql_database          = zarafadb

[...]
Now start all zarafa services.
# service zarafa-server start
# service zarafa-dagent start
# service zarafa-gateway start
# service zarafa-spooler start
# chkconfig zarafa-server on
# chkconfig zarafa-dagent on
# chkconfig zarafa-gateway on
# chkconfig zarafa-spooler on
Wait, We didn’t finish yet, we have to create public store where all emails stored and mail users.
Create Public store and users
Create public store using command:
# zarafa-admin -s
Then create users. For example, here i am going to create two users called “navneet” and “mohit”.
# useradd navneet
# useradd mohit
# passwd priyanka
# passwd arun
Now let us assign mail id’s to them as shown below.
# zarafa-admin -c navneet-p centos -e navneet@rathi.com -f "navneet" 
# zarafa-admin -c mohit-p centos -e mohit@rathi.com-f "mohit"
Where,
-c – Create user
-p – password
-e – email
-f – full name
To create administrative user, you should use -a parameter with value “1”.
# zarafa-admin -c nrathi-p sompass-e nrathi@rathi.com -f "nrathi" -a 1
Where,
-a – administrative user
1 – describes administrative user, You can use 0(zero) for non-administrative users.
To delete users, use -d parameter.
Ex.
# zarafa-admin -d nrathi
Access Zarafa webmail
We have done with configuration, Let us log in to Zarafa webmail. Navigate to http://ip-address/webaccess orhttp://domainname/webaccess.
Enter the username and password to log in. and you are done