O/H Timo Sirainen έγραψε:
On Wed, 2008-12-24 at 16:26 +0200, Thanos Chatziathanassiou wrote:``Dec 24 15:36:29 mail dovecot: POP3(u...@domain): stat(/var/run/dovecot/imap-index/domain/user/.imap/INBOX) failed: Permission denied (euid=60107 egid=231 missing +x perm: /var/run/dovecot/imap-index/domain)''errors./var/run is a pretty bad place for indexes. Either disable them completely or point them to a directory that doesn't get deleted on reboots.
Indeed...though I do not reboot all that often and I overlooked this.
Since this is a (previous) linuxconf installation, they are located in ``/vhome/<domain>/home/<user>''- Is there something to configure to get rid of this ?Where are IMAP's non-INBOX mailboxes located? The index files should be in the same directory.
This is an NFS mounted directory in my case.Would I want to store the indexes there after disabling mmap(), using fcntl locks and adding ``mail_privileged_group = mail'' to dovecot.conf ?
Also, I have written a somewhat sloppy patch to determine the domain from the server's IP. That way it is not necessary to persuade all users to switch to logging in as ``u...@domain'' (which I've tried with very limited success).Would this be the correct place to post the patch and discuss ?Go ahead and post it. But I'm not sure if it really belongs to Dovecot itself, since it's possible to do with several passdbs already (at least SQL and checkpassword).
Attached. Rather crude though...
--- a/src/auth/auth-request.c Tue Jan 6 16:33:51 2009 +++ b/src/auth/auth-request.c Wed Dec 24 13:43:06 2008 @@ -1385,6 +1385,7 @@ { 'c', NULL }, { 'a', NULL }, { 'b', NULL }, + { 'v', NULL }, { '\0', NULL } }; struct var_expand_table *tab; @@ -1424,6 +1425,27 @@ tab[11].value = auth_request->secured ? "secured" : ""; tab[12].value = dec2str(auth_request->local_port); tab[13].value = dec2str(auth_request->remote_port); + + /* turn tab[14] into reverse lookup of local IP */ + if (tab[2].value == NULL) { + struct sockaddr_in adr; + inet_pton(AF_INET, tab[5].value, &adr.sin_addr); + + unsigned int len = sizeof(adr); + if (getsockname(0, (struct sockaddr*) &adr, &len) != 1) { + struct hostent *ent = NULL; + ent = gethostbyaddr((const char*) &adr.sin_addr, sizeof(adr.sin_addr.s_addr), AF_INET); + if (ent != NULL) { + tab[14].value = strchr(ent->h_name, '.'); + if (tab[14].value != NULL) { + tab[14].value++; + tab[2].value = tab[14].value; + auth_request_set_field(auth_request, "domain", tab[14].value, NULL); + } + } + } + } + return tab; }
smime.p7s
Description: S/MIME Cryptographic Signature