FORMER 03 | Baltasar Cevc escribió: > Hi Timo! > > On Sun, 05 Aug 2007 20:02:28 +0300 > Timo Sirainen <[EMAIL PROTECTED]> wrote: > >> On Sun, 2007-08-05 at 12:41 +0200, FORMER 03 | Baltasar Cevc wrote: >>> Is there any possibility to achieve what I need without having two >>> completely separated instances of Dovecot running? >> It depends on what passdb you want to use. SQL would be simple. >> CheckPassword script would be possible. Others might, or might not. > > I authenticate against a MySQL database. What I've figured out is how > to disable IMAP - I do it using the following line in dovecot-sql.conf > (I use prefetch, so that's the only query done): > > password_query = SELECT username AS user, password_enc AS password FROM > mail_users WHERE username = '%u' AND ( (IF('%a'='143', `imap`,'0'))='Y' > OR (IF('%a '='110', `pop3`, '0') = 'Y') OR 1 ) > > But I'd need some possibility to have two different IMAP listeners > (e.g. one on port 144 for webmail) or something similar, as I currently > disallow webmail (which connects to localhost via IMAP), too.
Test for %s instead of %a and use %r to allow your web server (or %l as it connects to localhost). It just SQL-foo :) For a full list of available variables: http://wiki.dovecot.org/Variables -- Angel Marin http://anmar.eu.org/