Ello group{s},
some time ago i mentioned something about having a fallback database in
case the first one doesnt respond. I found it really usefull in the following scenario.
I have domain.com and two MX records for it mx1.domain.com(5) and mx2.domain.com(10),
and i`m using dbmail, let say the db on mx1 is gone, what happens, mx2 wont help me, but
with this patch if dbmail service on mx1 cant connect to it`s primary db it`ll to the
secondary at mx2, where db1 and db2 are quite aware with it`s data in sense of
replication.
kinda
if(conn1 == fails){ tellus; conn2; if(conn2 == fails) { tellus; return _err; } }
of course with each connect N it`ll try to connect to db1 before falling back to db2;
ligthly tested with pgsql/mysql agains dbmail-1.1(from http://www.dbmai.org), it`s quite
simple, though i cant say how it`ll work on your mailservers.
let me know if i did something wrong. sometime (when i find it) i`ll try to change the
stuff to use more than 2 dbs and not to be so static. Hope Eelco, Roel would be keen on
impl something like this permanently?
(patch attached)
cheers
-lou
--
Lou Kamenov AEYE R&D lou.kamenov@aeye.net
FreeBSD BGUG http://www.freebsd-bg.org lou@FreeBSD-bg.org
Secureroot UK http://secureroot.org.uk phayze@secureroot.org.uk
Key Fingerprint - 936F F64A AD50 2D27 07E7 6629 F493 95AE A297 084A
One advantage of talking to yourself is that you know at least
somebody's listening. - Franklin P. Jones
some time ago i mentioned something about having a fallback database in
case the first one doesnt respond. I found it really usefull in the following scenario.
I have domain.com and two MX records for it mx1.domain.com(5) and mx2.domain.com(10),
and i`m using dbmail, let say the db on mx1 is gone, what happens, mx2 wont help me, but
with this patch if dbmail service on mx1 cant connect to it`s primary db it`ll to the
secondary at mx2, where db1 and db2 are quite aware with it`s data in sense of
replication.
kinda
if(conn1 == fails){ tellus; conn2; if(conn2 == fails) { tellus; return _err; } }
of course with each connect N it`ll try to connect to db1 before falling back to db2;
ligthly tested with pgsql/mysql agains dbmail-1.1(from http://www.dbmai.org), it`s quite
simple, though i cant say how it`ll work on your mailservers.
let me know if i did something wrong. sometime (when i find it) i`ll try to change the
stuff to use more than 2 dbs and not to be so static. Hope Eelco, Roel would be keen on
impl something like this permanently?
(patch attached)
cheers
-lou
--
Lou Kamenov AEYE R&D lou.kamenov@aeye.net
FreeBSD BGUG http://www.freebsd-bg.org lou@FreeBSD-bg.org
Secureroot UK http://secureroot.org.uk phayze@secureroot.org.uk
Key Fingerprint - 936F F64A AD50 2D27 07E7 6629 F493 95AE A297 084A
One advantage of talking to yourself is that you know at least
somebody's listening. - Franklin P. Jones