[Dovecot] 2nd postgresql server to connect when 1st fail
I need to have mail service working even when my postgresql server will fail. In postfix i set 2 different servers and if 1st fail, postfix try to use 2nd. Is there any way to do this in dovecot?
Zostan internetowa dziewczyna wakacji! > http://link.interia.pl/f18ac
On 17.8.2005, at 02:39, Krzysztof A. Adamski wrote:
I need to have mail service working even when my postgresql server will fail. In postfix i set 2 different servers and if 1st fail, postfix try to use 2nd. Is there any way to do this in dovecot?
Currently not. It works with mysql code though, so all that's needed is to implement similar connection pooling for Postgresql code. Although I guess that pooling code could be made common to all SQL driver implementations.. Anyway, it's pretty low priority for me currently.
Dnia Wed, 17 Aug 2005 02:51:04 +0300, Timo Sirainen napisał(a):
On 17.8.2005, at 02:39, Krzysztof A. Adamski wrote:
I need to have mail service working even when my postgresql server will fail. In postfix i set 2 different servers and if 1st fail, postfix try to use 2nd. Is there any way to do this in dovecot?
Currently not. It works with mysql code though, so all that's needed is to implement similar connection pooling for Postgresql code. Although I guess that pooling code could be made common to all SQL driver implementations.. Anyway, it's pretty low priority for me currently.
Thanks for your answer, i have another if it's no problem for U. What about MultipleAuth in Dovecot 1.0. Can i make something like this?:
auth default { mechanisms = plain
passdb sql { args = /etc/dovecot-sql-1.conf } passdb sql { args = /etc/dovecot-sql-2.conf }
userdb sql { args = /etc/dovecot-sql-1.conf } userdb sql { args = /etc/dovecot-sql-2.conf }
} And in dovecot-sql-1.conf set host = dbserver1, in dovecot-sql-2.conf set host = dbserver2
And when dovecot 1.0 (stable) is planed ?
Zostan internetowa dziewczyna wakacji! > http://link.interia.pl/f18ac
Hi all,
somebody know how to know when a mail is moved from a folder to
another ?
My goal :
Each imap mail account have at least a folder named 'Spam' where all
mail tagged spam by spamassassin are going.
I've a script who check if a non-spam tagged mail is added to this
folder by a user to permit to spamassassin to learn it as spam.
There are few mail in spam folder, so this solution is good for me.
In the same idea, I want to know if a mail is moved from spam folder
to another folder to permit to spamassassin to learn moved mail as
non-spam.
Cause all mailbox have more than ten thousand of mail, I can't use
the same system.
If anyone have an idea ...
Thanks,
Cyril Feraudet
I do this by having a "razor submissions" folder as well as my normal junk folder.
spamassassin-tagged spam goes into Junk.
other mail I identify as spam goes into Junk as well (via the Junk mail button in Mail.app)
Every now and then I review the contents of Junk, take out any false matches, and drag the rest into my "razor submissions folder".
Then I have a small script that runs every 2 minutes from cron, taking each message from "razor submissions" and reporting it to spamassassin (and razor, dcc etc)
Works fairly well.
Darrin
#!/bin/sh
cd $HOME/"Maildir/.Razor Submissions"
# Quick exit if lockfile exists [ -e .submitting.lock ] && exit 0
lockfile -l60 .submitting.lock
cd new for i in *; do [ -e $i ] && mv $i ../cur/ done
cd ..
for i in cur/*; do [ -e $i ] && /usr/bin/spamassassin -r < $i && rm $i done
rm -f .submitting.lock
On Wed, 2005-08-17 at 11:15 +0200, Cyril Feraudet wrote:
somebody know how to know when a mail is moved from a folder to
another ?
Use a plugin. http://johannes.sipsolutions.net/Projects - click on the dovecot/dspam link.
johannes
Hi Johannes,
thank you for you plugin,
I want to modify your plugin for make it working with spamassassin,
do you know (I'm a beginner in C and in english ;-)) if it's easy to
pipe the source of the message to an
external programme instead of calling dspam with the dspam's signature ?
spamassassin need the source of the message to learn or de-learn spam :
spamassassin -r < message # to de-learn
spamassassin -k < message # to de-learn
Thanks,
Cyril
Le 17 août 05 à 13:18, Johannes Berg a écrit :
On Wed, 2005-08-17 at 11:15 +0200, Cyril Feraudet wrote:
somebody know how to know when a mail is moved from a folder to another ?
Use a plugin. http://johannes.sipsolutions.net/Projects - click on the dovecot/dspam link.
johannes
Hi,
You're welcome. I don't really know how to get the full text of the message in dovecot, you'll have to play with the internal dovecot api to do that. Sorry, but I can't help you further.
johannes
On Wed, 2005-08-17 at 10:57 +0200, Krzysztof A. Adamski wrote:
Thanks for your answer, i have another if it's no problem for U. What about MultipleAuth in Dovecot 1.0. Can i make something like this?:
auth default { mechanisms = plain
passdb sql { args = /etc/dovecot-sql-1.conf } passdb sql { args = /etc/dovecot-sql-2.conf }
I suppose that will work.. :) Of course that means that for failed authentications it asks from both of the servers then.
And when dovecot 1.0 (stable) is planed ?
"When it works". I think I'll release 1.0alpha in a few days.
Dnia Wed, 17 Aug 2005 12:19:28 +0300, Timo Sirainen napisał(a):
On Wed, 2005-08-17 at 10:57 +0200, Krzysztof A. Adamski wrote:
Thanks for your answer, i have another if it's no problem for U. What about MultipleAuth in Dovecot 1.0. Can i make something like this?:
auth default { mechanisms = plain
passdb sql { args = /etc/dovecot-sql-1.conf } passdb sql { args = /etc/dovecot-sql-2.conf }
I suppose that will work.. :) Of course that means that for failed authentications it asks from both of the servers then.
It will be enough for start i think. But how long will it take to decide that 2nd database should be used (i mean. how big is timeout for database connection?). And.. maybe there is a way to do something similiar in 0.99.14 ? I dont need really great solution but buckup connection if main wont work. Problems with first database shouldn't take too long so 2nd server will always be only temporary solution. I just need something like:
if(!conect_to_db(host1)) { if(!connect_to_db(host2)) { error } }
Najwiekszy MOTO-serwis w Polsce >>> http://link.interia.pl/f18a9
On 17.8.2005, at 12:58, Krzysztof A. Adamski wrote:
I suppose that will work.. :) Of course that means that for failed authentications it asks from both of the servers then.
It will be enough for start i think. But how long will it take to decide that 2nd database should be used (i mean. how big is timeout for database connection?).
There is no timeout currently, so it takes as long as connect() takes to succeed or fail. If the database really is down and the TCP connection just gets refused, it's aborted immediately. If the database accepts the TCP connection but doesn't answer anything to requests, it's longer. There are no timeouts implemented currently so I guess it'll wait forever..
And.. maybe there is a way to do something similiar in 0.99.14 ? I dont need really great solution but buckup connection if main wont work. Problems with first database shouldn't take too long so 2nd server will always be only temporary solution. I just need something like:
if(!conect_to_db(host1)) { if(!connect_to_db(host2)) { error } }
I guess something like that could work. The code is implemented asynchronously so it's not that simple, but probably not too difficult.
participants (5)
-
Cyril Feraudet
-
Darrin Smart
-
Johannes Berg
-
Krzysztof A. Adamski
-
Timo Sirainen