Re: [Indimail-support] some troubles - Workarounds

3 views
Skip to first unread message

Manvendra Bhangui

unread,
Apr 27, 2017, 1:21:21 PM4/27/17
to Pablo Esteban J, indimail...@lists.sourceforge.net
On 27 April 2017 at 16:33, Pablo Esteban J <pa...@nroot.es> wrote:
vadddomain -v -D indimail -S localhost -U indimail -P ssh-1.5- -p 3306 -c test.org password


I have found the issue on my fedora too. It has nothing to do with debian.  The current mysql server has this
--explicit-defaults-for-timestamp 

earlier versions of mysql did not enforce this defaults.

Due to this, insert into dbinfo fails because the query does not explicitly use the timestamp in the insert query. Rather it depends on MySQL to automatically fill the value for the timestamp column. This will require me to modify dbinfo.c. But there is a workaround that you can do. This workaround has to be done only once on each host where you want to have the clustered domain. vadduser, vdeluser, vuserinfo will work without issues.

For each host which is going to be part of the cluster, create /etc/indimail/control/hostid with a unique value. Let me assume you have two hosts with ip_adddress1 and ip_address2. Assign 100 as hostid for the first host and 101 for the 2nd host. I am assuming that you have already created host.master and host.cntrl in the cntrl directory.

Then update the host_table using the vhostid program. e.g.

vhostid -i ip_address1 100
vhostid -i ip_address2 101

Then on host1 run vadddomain

# vadddomain example.com some_password

Now you have the domain example.com on host1 but no domain on host2.

Now create a file /etc/indimail/control/mcdinfo. Let us say ip_address1 is 192.168.1.100 and ip_address2 is 192.168.1.101 and mysql server is on 192.168.1.100

# cat > /etc/indimail/control/mcdinfo
domain   example.com                     1
server   192.168.1.100
mdahost  192.168.1.100
port     3306
database indimail
user     indimail
pass     ssh-1.5-

domain   example.com                     1
server   192.168.1.100
mdahost  192.168.1.101
port     3306
database indimail
user     indimail
pass     ssh-1.5-

cntrl-d

Now the last step would be to populate the dbinfo table. Run the following command

# dbinfo -s

This command will work because it uses update query and uses the timestamp of the file mcdinfo. It does not use insert statement and hence it succeeds.

Now you can scp the file mcdinfo to host2, run dbinfo -s on that host and then run vadddomain on host2 also (you might get error saying user postmaster exists, etc, but it can be ignored). 

If you do vadduser on host1, it will get added to host1
if you do vadduser on host2, it will get added to host2

If you send an email on host1 to a  user created on host2, the mail will get routed to host2 by vdellivermail calling qmail-remote
If you send an email on host1 to a user created on host1, it will be directly delivered on host1

Whenever you want to add a new host, just edit the file mcdinfo on any host, it will get updated on other hosts too, when you run dbinfo -s on that host.

If you have doubts, let me know
Reply all
Reply to author
Forward
0 new messages