[Dovecot] How to disable imap of some user

邓卫华 dengwh at bestcheer.com
Tue Feb 22 08:53:08 EET 2011


  

Hi,all 

 i have resolved this problem, when i am modify
password_query parameter. 

password_query = 
 SELECT username AS
user,password 
 FROM (select username,password,disableimap as imap
,disablepop3 as pop3,disablesmtp as smtp,disablesieve as sieve 
 FROM
mailbox WHERE username = '%u' AND active='1') as tb1 where %s='0'


thanks. 

Deng 

On Tue, 22 Feb 2011 11:22:07 +0800, 邓卫华 wrote: 

>
Hi, Pascal 
> 
> thanks, that's great. it's work in our test
>
environment. but i have a problem in mail server. 
> 
> i have a user
manage
> program of mail server, runing on mysql. it had a disableIMAP
>
disablePOP3, disablesmtp column in user table. 
> 
> that's easy if i
can
> modify password_query. 
> 
> i had writed :" select user,password
from user
> where username='%u' and contact('disable',%s)='0' " in
password_query,
> but it is not work and i got 
> 
> "Password query
failed: Column count of
> mysql.proc is wrong. Expected 20, found 16.
Created with MySQL 50077" in
> maillog file. 
> 
> so ,how to modify
password_query to get work? 
> 
> Thanks.
> 
> Deng 
> 
> On Sat, 19 Feb
2011 23:23:19 +0100, Pascal Volk wrote: 
> 
>> On
> 02/19/2011 02:20 PM
邓卫华 wrote: 
> 
>>> Dear Pascal, thanks for your reply
> ASAP. can i only
add pop3 and imap column in the password table, and not to add sieve and
smtp column? can password not verified if there have not existing smtp
and sieve column? you use Dovecot's SASL¹ for
> not. you did not need to
add the smtp column. When you don't add the sieve column but provide
ManageSieve, the login will always fail because an SQL error '… unknown
column sieve …' The first example query was wrong, sorry. The correct
one would be: SELECT user, password FROM tbl WHERE user = '%u' AND %s
See also http://wiki.dovecot.org/Variables [1] [1] for further details.
Regards, Pascal -- 1 = http://wiki.dovecot.org/Sasl [2] [2]

-- 
Best
Cheer (XiaMen) Stone Works CO.,LTP.
Phone: 0592-7221600
 


Links:
------
[1] http://wiki.dovecot.org/Variables
[2]
http://wiki.dovecot.org/Sasl


More information about the dovecot mailing list