Hello, I have a farm of dovecot 1.1 servers (debian lenny). Mailboxes are in Maildir format. Is there any way to manually update indexes? Does it worth? I mean... Our problem is that mail is delivered via dovecot lda, but, because we have a farm of servers, we don't guarantee that mail is delivered through the same server that the user is using for his imap connection, so the imap server could have this index unupdated. So I want to force an update (or at least nearly updated) in order to have the index updated in all servers at the time the user get to work. -- Angel L. Mateo Mart?nez Secci?n de Telem?tica ?rea de Tecnolog?as de la Informaci?n _o) y las Comunicaciones Aplicadas (ATICA) / \\ http://www.um.es/atica _(___V Tfo: 868887590 Fax: 868888337
On Fri, 19 Aug 2011 11:13:21 +0200, "Angel L. Mateo" <amateo at um.es> wrote:> Is there any way to manually update indexes?As far as I understood, you just have to delete the index files and Dovecot will regenerate them when a user logs in the next time. Regards Patrick
El 19/08/11 12:15, Patrick Westenberg escribi?:> On Fri, 19 Aug 2011 11:13:21 +0200, "Angel L. Mateo" <amateo at um.es> wrote: > >> Is there any way to manually update indexes? > > As far as I understood, you just have to delete the index files and > Dovecot will regenerate them when a user logs in the next time. >But I want the index to be generated (or updated) before the user login. -- Angel L. Mateo Mart?nez Secci?n de Telem?tica ?rea de Tecnolog?as de la Informaci?n _o) y las Comunicaciones Aplicadas (ATICA) / \\ http://www.um.es/atica _(___V Tfo: 868887590 Fax: 868888337
Angel L. Mateo writes:> I have a farm of dovecot 1.1 servers (debian lenny). Mailboxes are in > Maildir format. > > Is there any way to manually update indexes? > > Does it worth? I mean... Our problem is that mail is delivered via > dovecot lda, but, because we have a farm of servers, we don't guarantee > that mail is delivered through the same server that the user is using > for his imap connection, so the imap server could have this index > unupdated. So I want to force an update (or at least nearly updated) > in order to have the index updated in all servers at the time the user > get to work.Upgrading to Dovecot2 would allow you to solve this in various ways: - use "doveadm force-resync" - user director to bind to a particular server You could put the indices on a shared filesystem. If neither an update nor shared indices are feasible, maybe you can enable the master user feature, and run a script that logs in as each user and do an IMAP operation that will force a resync of the INBOX indices. For example, # On IMAP server with a localhost interface for u in $users; do echo "1 login $u*master masterpw\n2 SELECT INBOX\n3 logout" | \ nc 127.0.0.1 143 done Joseph Tam <jtam.home at gmail.com>
On 19.8.2011, at 12.13, Angel L. Mateo wrote:> I have a farm of dovecot 1.1 servers (debian lenny). Mailboxes are in Maildir format. > > Is there any way to manually update indexes?v2.0 has "doveadm index" command to do this. There's no other good way to do this.> Does it worth? I mean... Our problem is that mail is delivered via dovecot lda, but, because we have a farm of servers, we don't guarantee that mail is delivered through the same server that the user is using for his imap connection, so the imap server could have this index unupdated. So I want to force an update (or at least nearly updated) in order to have the index updated in all servers at the time the user get to work.Doing it via IMAP won't guarantee that everything the user's client needs is indexed/cached. Different clients need different things, Dovecot only indexes stuff that client requests. You'd have to look up from index files what the client wants indexed and then perform IMAP commands requesting those fields. Even the act of doing this may mess up caching decisions, because user may have changed client and now it's indexing unnecessary fields. (Actually now that I think of it, doveadm index has this same problem. Have to get that fixed.) With v2.0 you could if you use Dovecot proxy (or director) you can also proxy doveadm connections through it, so a "doveadm index" would always go to the correct server. http://wiki2.dovecot.org/Director at the bottom has some info how to set this up (works also with plain proxy, without director).