--- dovecot-request@dovecot.org Wrote:
From: Timo Sirainen tss@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.