[Dovecot] Mail replication
Hello,
I am running an asynchronously replicated mail setup. 2 servers are each running an smtp server which uses dovecot as the LDA. I am using unison to replicate mail files between servers. Before, I was using Maildir format and after reading so much good papers about the very good performance of dbox format, I decided to switch to dbox. However, I now have a very annoying problem, as mails are created with names like u.1234 and numbers are following each others. So, if there is for example a mail stored as u.1001 on both servers, and now 2 mails arrive at about the same time, 1 on each server. Then, they will both be created as u.1002, that means unison will encounter a conflict as both files are different. So my question would be, is there a way to tell the servers to increment by 2 instead of 1 and have each an offset (like you can do with mysql with auto incrementing tables for example)? That way, with former example, one mail would be stored as u.1002 and the other as u.1003.
Thanks
On Apr 18, 2009, at 12:41 PM, Renaud Allard wrote:
I am running an asynchronously replicated mail setup. 2 servers are
each running an smtp server which uses dovecot as the LDA. I am using unison to replicate mail files between servers. Before, I was using Maildir format and after reading so much good
papers about the very good performance of dbox format, I decided to switch
to dbox. However, I now have a very annoying problem, as mails are created with names like u.1234 and numbers are following each others. So, if
there is for example a mail stored as u.1001 on both servers, and now 2 mails arrive at about the same time, 1 on each server. Then, they will
both be created as u.1002, that means unison will encounter a conflict as both files are different.
Are you saying that both the servers are accepting and writing mails?
That can't really work unless they can also do global file locking.
So my question would be, is there a way to tell the servers to
increment by 2 instead of 1 and have each an offset (like you can do with mysql with auto incrementing tables for example)? That way, with former example, one mail would be stored as u.1002 and the other as u.1003.
Even if u.* files didn't conflict, index files would still break. And
even if index files somehow could be made not to break, this would
break IMAP protocol and IMAP clients might not download some of the
mails anyway. I'm kind of surprised that it already wasn't breaking
with Maildir.
Timo Sirainen wrote:
On Apr 18, 2009, at 12:41 PM, Renaud Allard wrote:
Are you saying that both the servers are accepting and writing mails? That can't really work unless they can also do global file locking.
Indeed, but only one of them is accepting imap connections. The other one accepts imap only if the first one is down (virtual IPs)
Even if u.* files didn't conflict, index files would still break. And even if index files somehow could be made not to break, this would break IMAP protocol and IMAP clients might not download some of the mails anyway. I'm kind of surprised that it already wasn't breaking with Maildir.
Indexes were also replicated, but indeed they could break the same way. Is there already some sort of replication in dovecot?
On Apr 18, 2009, at 12:58 PM, Renaud Allard wrote:
Timo Sirainen wrote:
On Apr 18, 2009, at 12:41 PM, Renaud Allard wrote:
Are you saying that both the servers are accepting and writing mails? That can't really work unless they can also do global file locking.
Indeed, but only one of them is accepting imap connections. The other one accepts imap only if the first one is down (virtual IPs)
That kind of a setup would work reliably with maildir only if the
other server's LDA didn't update any index/control files. But dbox's
good performance comes from being able to trust that everything is
always up-to-date in the index files, so that wouldn't really work.
Is there already some sort of replication in dovecot?
Not yet. Hopefully this year.
participants (2)
-
Renaud Allard
-
Timo Sirainen