Mercurial > dovecot > original-hg > dovecot-1.2
diff src/auth/passdb-vpopmail.c @ 8262:b51344f37d88 HEAD
vpopmail: Use pw_flags field if vpopmail has it.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 11 Oct 2008 13:50:47 +0300 |
parents | 7f7cef2b5552 |
children | 0691f5294bb9 |
line wrap: on
line diff
--- a/src/auth/passdb-vpopmail.c Sat Oct 11 13:39:10 2008 +0300 +++ b/src/auth/passdb-vpopmail.c Sat Oct 11 13:50:47 2008 +0300 @@ -17,6 +17,11 @@ #define VPOPMAIL_DEFAULT_PASS_SCHEME "CRYPT" +/* pw_flags was added in vpopmail 5.4, olders use pw_gid field */ +#ifndef VQPASSWD_HAS_PW_FLAGS +# define pw_flags pw_gid +#endif + struct vpopmail_passdb_module { struct passdb_module module; @@ -31,19 +36,19 @@ (struct vpopmail_passdb_module *)_module; if (strcmp(request->service, "IMAP") == 0) { - if ((vpw->pw_gid & NO_IMAP) != 0) { + if ((vpw->pw_flags & NO_IMAP) != 0) { /* IMAP from webmail IP may still be allowed */ if (!net_ip_compare(&module->webmail_ip, &request->remote_ip)) return TRUE; } - if ((vpw->pw_gid & NO_WEBMAIL) != 0) { + if ((vpw->pw_flags & NO_WEBMAIL) != 0) { if (net_ip_compare(&module->webmail_ip, &request->remote_ip)) return TRUE; } } - if ((vpw->pw_gid & NO_POP) != 0 && + if ((vpw->pw_flags & NO_POP) != 0 && strcmp(request->service, "POP3") == 0) return TRUE; return FALSE;