Alessio Cecchi
2008-Jun-13 11:03 UTC
[Dovecot] "Disable non webmail IMAP access" in vpopmail and Dovecot
Hello, i'm using in my installation qmail+vpopmail and now I have migrated from courier-imap to dovecot. Dovecot is very much faster with large mailbox than courier-imap. But I have a problem. vpopmail has a feature that allows you to "Disable non webmail IMAP access", many webmail using imap as if they were, and they are, a client IMAP. vpopmail give me the ability to disabile IMAP, expect for 127.0.0.1, both for individual users than for single domain. So i can grant IMAP access, from remote client, only for some users but webmail access for all. Here you can read some of my messages in the vpopmail's list: http://www.mail-archive.com/vchkpw at inter7.com/msg25880.html But with dovecot this feature seems not to be compatible. A friend of the vpopmail's list sent me a patch for dovecot but I can not get it to work:>->->->->->->->->->->->->->->->->->->->->->->->->->->Hi Alessio, i spent over 5 hours looking for a solution to this problem and i found one working for me in dovecot sources edit src/auth/passdb-vpopmail.c than add char *remotehost = net_ip2addr(&auth_request->remote_ip); auth_request_log_info(auth_request, "vpopmail", "remote ip is: %s", remotehost); before if (((vpw->pw_gid & NO_IMAP) != 0 && line than modify the condition line to look like: if (((vpw->pw_gid & NO_IMAP) != 0 && ? ? ? ? ? ? ?strcmp(auth_request->service, "IMAP") == 0 *&& strcmp(remotehost, "127.0.0.1") != 0*) || ? ? ? ? ? ? ((vpw->pw_gid & NO_POP) != 0 && ? ? ? ? ? ? ?strcmp(auth_request->service, "POP3") == 0)) { ? ? ? ? ? ? ? ? auth_request_log_info(auth_request, "vpopmail", ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "%s disabled", auth_request->service); ? ? ? ? ? ? ? ? password = NULL; ? ? ? ? ? ? ? ? *result_r = PASSDB_RESULT_USER_DISABLED; ? ? ? ? } else ............... this way you will preserve webmail access and cut imap from external in case -i limit is defined in vpopmail hope it helps <-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-< Can someone help me in making compatible this useful feature of vpopmail with dovecot? Thank you -- Alessio Cecchi is: @ ILS -> http://www.linux.it/~alessice/ Assistenza Sistemi GNU/Linux -> http://www.cecchi.biz/ @ PLUG -> ex-Presidente, adesso senatore a vita, http://www.prato.linux.it @ LOLUG -> neo-Socio http://www.lolug.net