Hi - I've got two copies of Dovecot installed on my server (don't worry, talking to two different sockets for authentication, with two different sets of filenames using options in configure), and I found at least one instance where the index file for my INBOX (on my own account, in fact) got corrupted. So badly so that when I connected via IMAP and selected my INBOX, it said there were no messages there - but if I logged in via sqWebMail (ugh), it said all my messages were there. Note that it didn't give the 'NO can't use index file' message. I moved the .INBOX directory to another filename, and then re-logged in and found that all was well (it regenerated the index files correctly). Would my old, corrupted index files be of any use to anyone? I still have that directory sitting somewhere. Is it perhaps 'bad' to run two copies of Dovecot? I don't know exactly what I was doing, but I can easily imagine accessing one of my Dovecots using my webmail setup, and one using straight IMAP - is that an unsupported setup? I'd also be happy to discuss why I'm using two copies of Dovecot, but that's a whole other discussion :)
Brady Wetherington <brady at netservnyc.com> writes:> Would my old, corrupted index files be of any use to anyone? I still > have that directory sitting somewhere. Is it perhaps 'bad' to run two > copies of Dovecot? I don't know exactly what I was doing, but I can > easily imagine accessing one of my Dovecots using my webmail setup, and > one using straight IMAP - is that an unsupported setup?I'd think the way to go is to use one Dovecot installation for both IMAP logins by remote clients as well as the webmail system. -- Matthias Andree
--- dovecot-request at dovecot.org Wrote:> From: Matthias Andree <matthias.andree at gmx.de> > Brady Wetherington <brady at netservnyc.com> writes: > > > Would my old, corrupted index files be of any use to anyone? I still > > have that directory sitting somewhere. Is it perhaps 'bad' to run two > > copies of Dovecot? I don't know exactly what I was doing, but I can > > easily imagine accessing one of my Dovecots using my webmail setup, and > > one using straight IMAP - is that an unsupported setup? > > I'd think the way to go is to use one Dovecot installation for both IMAP > logins by remote clients as well as the webmail system. > > -- > Matthias AndreeI would think the exact same thing, and I would _love_ to run only one copy of Dovecot. But I run vpopmail, and I need to make IMAP available only to users who have IMAP 'enabled' (the guys who pay more money). But I need webmail available for _all_ users (even the cheapskates), and my webmail of course uses IMAP behind the scenes. So my solution is one copy of regular Dovecot on port 143, which respects the NO_IMAP flag from vpopmail, and one copy of modified Dovecot, which I patched to ignore the NO_IMAP flag, on port 144 - and then I configured my webmail software to talk to port 144. That copy of Dovecot will eventually only listen to the local network for connections, though currently it listens for anyone. A solution I already tried was having Dovecot run by being invoked from a copy of tcpserver, which used a .cdb 'rules' database which set certain environment variables based upon the users IP address. I patched my copy of Dovecot to listen for those environment variables and pay attention/ignore NO_IMAP based upon those environment variables, but it looks like environment variables get clobbered when dovecot invokes the authenticator process from within imap-login (And the code seems to say that it blows out the environment, too). And I'm willing to bet that it would only work on first invoke of dovecot from imap-login, too, even if it didn't blow out the environment (because the authentication process stays running). All this stuff is, I'm sure, a thousand times easier in something like courier-imap, but I like Dovecot, so I'd rather run two copies of Dovecot than one of courier-imap. So if anyone has any possible direction to go on a solution that lets me run only one Dovecot, I'd love that. Until then, I'm stuck with my hack-ey two-Dovecot solution. I also _think_ I found out the problem, what was corrupting my indexes, though I'm not sure. I think one of the messages in my Maildir was 'unreadable' by Dovecot (well, that's what the logs say). Which seems to completely blow out the index. I got rid of the file, so lets keep fingers crossed that that solves it...
--- dovecot-request at dovecot.org Wrote:> From: Timo Sirainen <tss at iki.fi>> On 13.12.2004, at 21:26, Brady Wetherington wrote: > > > A solution I already tried was having Dovecot run by being invoked from > > a copy of tcpserver, which used a .cdb 'rules' database which set > > certain environment variables based upon the users IP address. I > > patched > > my copy of Dovecot to listen for those environment variables and pay > > attention/ignore NO_IMAP based upon those environment variables, but it > > looks like environment variables get clobbered when dovecot invokes the > > authenticator process from within imap-login (And the code seems to say > > that it blows out the environment, too). And I'm willing to bet that it > > would only work on first invoke of dovecot from imap-login, too, even > > if > > it didn't blow out the environment (because the authentication process > > stays running). > > You could do this by first getting the remote IP address transferred to > dovecot-auth (http://dovecot.org/patches/pam-rhost.patch) then checking > the IP in vpopmail code to see if you want to check NO_IMAP with the > IP.That sounds like that's the direction I want to go - I will definitely take a look into that, and possibly tweak it if I can. The way I was thinking about doing it was either respecting one or the other of NO_IMAP or NO_WEBMAIL depending on if you're coming from a local address or a remote one. I might stick with tcpserver using a tcprules.cdb to set environment variables and modify the patch to pass those environment variable(s) onward...we'll see. Or I might just suffer with my many dovecots.> > > I also _think_ I found out the problem, what was corrupting my indexes, > > though I'm not sure. I think one of the messages in my Maildir was > > 'unreadable' by Dovecot (well, that's what the logs say). Which seems > > to > > completely blow out the index. I got rid of the file, so lets keep > > fingers crossed that that solves it... > > If there's a repeateable way to break Dovecot with some specific > message even after indexes have been recreated, I'd like to see the > message. > > Unless, of course, you meant that 'unreadable' was because there was no > file system permissions to read it?Yes, unfortunately, the file was unreadable because there was no file system permissions to read it. That actually made dovecot make indices which imply there's nothing in the mailbox. How a file with no FS perms got into my maildir is rather embarassing and I'll skip unless it's important, but it was there and it did hose my indexes.