Saturday, July 30, 2011

IndiMail Quick Installation .!

IndiMail supports two types of virtual domains

1. Non-Clustered domain - A domain existing on a single server
2. Clustered domain - A domain extended across multiple servers, with each
server having its own set of users.

You must decide if you want Non-clustered setup or a clustered setup. If you have millions
of users, then you must chose clustered setup. Even if you chose to install a non-clustered
setup, you can always migrate to a clustered setup later.

IndiMail has yum / RPM / Debian repositories for most of the Linux Distros at

http://download.opensuse.org/repositories/home:/indimail/

The latest RPM (for yet to be released version) can be found at

http://download.opensuse.org/repositories/home:/mbhangui/

Download the RPM for either of the two above repository and proceed below

--------------------------------------------------------------------------------------

Creating a non-clustered Domain
-------------------------------

Install IndiMail from RPM / Debian
% sudo rpm -ivh indimail-1.8.2-1.1.i386.rpm (for RPM)
or
% sudo dpkg -i indimail_1.8.2-1_i386.deb (for Debian)

Create a basic configuration file required by IndiMail
% cd /var/indimail/control
% su
# echo "localhost:indimail:ssh-1.5-:/tmp/mysql.sock" > host.mysql

Start IndiMail
# /var/indimail/sbin/initsvc -on
# exit

x------------------------------------------------------------------------------------x
| NOTE: replace localhost, indimail, ssh-1.5-, /tmp/mysql.sock as relevant to your |
| MySQL installation. You can use 3306 instead of /tmp/mysql.sock in case your MySQL |
| database is on another host. |
| you must use host:user:password:socket or host:user:password:port format |
| for host.mysql (for IndiMail 1.6.9 and above). Also set your PATH to |
| have /var/indimail/bin in the path. |
| If you change the socket/port then you have to edit /var/indimailcontrol/host.* |
| and /var/indimail/etc/indimail.cnf to change the socket path / port |
| |
| Instead of the above initsvc command, you can also do (a more portable way) |
| |
| % sudo service indimail start |
x------------------------------------------------------------------------------------x

Ensure MySQL is running

The RPM installation creates MySQL service in down state. The MySQL service
will not come up unless you use the command svc -u. Also to ensure that the
service comes up automatically after system reboot, remove the file 'down'
Also check the MySQl configuration file /var/indimail/etc/indimail.cnf
for the port and socket parameter.
[client]
port = 3306
socket = /tmp/mysql.sock

% sudo /bin/rm /service/mysql.3306/down
% sudo /var/indimail/bin/svc -u /service/mysql.3306

% sudo /var/indimail/bin/svstat /service/mysql.3306
/service/mysql.3306: up (pid 11936) 5 seconds

Create a virtual domain and do various operations
% sudo /var/indimail/bin/vadddomain example.com pass
% /var/indimail/bin/vuserinfo postmaster@example.com
% sudo /var/indimail/bin/vadduser testuser1@example.com pass
% /var/indimail/bin/vuserinfo testuser1@example.com
% /var/indimail/bin/vpasswd testuser1@example.com newpass
% /var/indimail/bin/vmoduser -q 50000000 testuser1@example.com

--------------------------------------------------------------------------------------

Creating a Clustered Domain
---------------------------

Install IndiMail from RPM / Debian
% sudo rpm -ivh indimail-1.8.2-1.1.i386.rpm
or
% sudo dpkg -i indimail_1.8.2-1_i386.deb (for Debian)

Create basic configuration files required by IndiMail
% cd /var/indimail/control
% su
# echo "localhost:indimail:ssh-1.5-:/tmp/mysql.sock" > host.cntrl
# ln -s host.cntrl host.master
# echo 192.168.1.100 > hostip (replace 192.168.1.100 with your mailserver IP)

Start IndiMail
# /var/indimail/sbin/initsvc -on
# exit

x------------------------------------------------------------------------------------x
| NOTE: replace localhost, indimail, ssh-1.5-, /tmp/mysql.sock as relevant to your |
| MySQL installation. You can use 3306 instead of /tmp/mysql.sock in case your MySQL |
| database is on another host. |
| you must use host:user:password:socket or host:user:password:port format |
| for host.cntrl (for IndiMail 1.6.9 and above). Also set your PATH to |
| have /var/indimail/bin in the path. |
| If you change the socket/port then you have to edit /var/indimailcontrol/host.* |
| and /var/indimail/etc/indimail.cnf to change the socket path / port |
| |
| Instead of the above initsvc command, you can also do (a more portable way) |
| |
| % sudo service indimail start |
x------------------------------------------------------------------------------------x

Ensure MySQL is running

The RPM installation creates MySQL service in down state. The service will
not come up unless you use the command svc -u. Also to ensure that the
service comes up automatically after system reboot, remove the file 'down'

% sudo /bin/rm /service/mysql.3306/down
% sudo /var/indimail/bin/svc -u /service/mysql.3306

% sudo /var/indimail/bin/svstat /service/mysql.3306
/service/mysql.3306: up (pid 11936) 7 seconds

Create a virtual domain and do various operations
% sudo /var/indimail/bin/vadddomain -D indimail -S localhost \
-U indimail -P ssh-1.5- -p 3306 -c example.com pass
% /var/indimail/bin/vuserinfo postmaster@example.com
% sudo /var/indimail/bin/vadduser testuser1@example.com pass
% /var/indimail/bin/vuserinfo testuser1@example.com
% /var/indimail/bin/vpasswd testuser1@example.com newpass
% /var/indimail/bin/vmoduser -q 50000000 testuser1@example.com

Query the cluster definition
% /var/indimail/bin/dbinfo -s

--------------------------------------------------------------------------------------

Send / Receive Mails
--------------------

At this stage, your setup is ready to send mails to the outside world. To receive
mails, you need to create your actual domain (instead of example.com) using vadddomain
and setup a mail exchanger record for your domain (MX record).
To send mails, you can either use SMTP or use a sendmail (IndiMail's sendmail replacement
/var/indimail/bin/sendmail).

% ( echo 'First M. Last'; uname -a) | mail -s "IndiMail Installation" manvendra@indimail.org

Replace First M. Last with your name.

--- * --- * ---- * --- * --- THE END --- * --- * --- * --- * ---

x------------------------------------------------------------------------------------x
|NOTE: You can email me at manvendra@indimail.org, if you find this confusing or |
|need any help/clarification. |
x------------------------------------------------------------------------------------x

No comments:

Post a Comment