View Single Post
  #1  
Old 25th October 2012, 23:38
quickfox quickfox is offline
Junior Member
 
Join Date: Jan 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Angry dovecot MasterUser

Hi guys,

Trying to follow this: http://wiki.dovecot.org/Authentication/MasterUsers

To let me set up a master user so that I can migrate all mail away from ISPConfig for one domain.

I made a new boolean field on the mail_user table called "master_user". I set this to '1' for all desired users.

Here is a snippet from my dovecot.conf & then the 2 sql queries I am using.

Code:
auth_master_user_separator=*                                                                                                                                                    
auth default {                                                                                                                                                                  
  mechanisms = plain login                                                                                                                                                      
                                                                                                                                                                                
  # SQL database <doc/wiki/AuthDatabase.SQL.txt>                                                                                                                                
  passdb sql {                                                                                                                                                                  
    # Path for SQL configuration file                                                                                                                                           
    args = /etc/dovecot/dovecot-sql-master.conf                                                                                                                                 
        master = yes                                                                                                                                                            
        pass = yes                                                                                                                                                              
  }                                                                                                                                                                             
                                                                                                                                                                                
  passdb sql {                                                                                                                                                                  
    args = /etc/dovecot/dovecot-sql.conf                                                                                                                                        
  }
userdb prefetch {                                                                                                                                                             
  }                                                                                                                                                                             
                                                                                                                                                                                
  userdb sql {                                                                                                                                                                  
    args = /etc/dovecot/dovecot-sql.conf                                                                                                                                        
  }
Here is my dovecot-sql-master.conf (without the mysql detail)

Code:
default_pass_scheme = CRYPT                                                                                                                                                     
password_query = SELECT login as user, 'masterPassword' as password FROM mail_user WHERE login = '%u' AND master_user = true
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n'
Here is my dovecot-sql.conf

Code:
default_pass_scheme = CRYPT                                                                                                                                                     

password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n'
I still can't auth via telnet when I try the following:

1 login user@mydomain.com*master@mydomain.com masterPassword

Can anyone tell me what I am doing incorrectly?
Reply With Quote
Sponsored Links