[Dovecot] domain stripping -SOLVED

PA razor at meganet.net
Thu Jan 20 17:04:40 EET 2011


Basically after thinking about it I added another SQL user/password DB
lookup that has a default domain name on the sql query.


passdb {
  args = /usr/local/etc/dovecot/sql.conf.ext
  driver = sql
}


passdb {
  
  args = /usr/local/etc/dovecot/sql.conf2.ext
  driver = sql
}

passdb {
  driver = pam
}

userdb {
  driver = prefetch
}

userdb {
  args = /usr/local/etc/dovecot/sql.conf.ext
  driver = sql
}


userdb {
  
  args = /usr/local/etc/dovecot/sql.conf2.ext
  driver = sql
}



password_query = SELECT username as user, password,
concat('/var/vmail/test2000.com/', maildir) as userdb_home,
concat('maildir:/var/vmail/test2000.com/', maildir) as userdb_mail, 101 as
userdb_uid, 502 as userdb_gid, concat('user quota:messages=+:storage=+',
quota) AS userdb_quota_rule FROM mailbox WHERE username = '%n at test2000.com'

user_query = SELECT maildir, 101 AS uid, 502 AS gid, concat('user
quota:messages=+:storage=+', quota) as quota_rule FROM mailbox WHERE
username = '%n at test2000.com' AND active = '1'



-----Original Message-----
From: dovecot-bounces+razor=meganet.net at dovecot.org
[mailto:dovecot-bounces+razor=meganet.net at dovecot.org] On Behalf Of PA
Sent: Wednesday, January 19, 2011 12:36 PM
To: 'Dovecot Mailing List'
Subject: [Dovecot] domain stripping

Hi, using dovecot 2.0 and I'm using a couple of user DBs, sql/prefetch and
pam. Currently if the user logins with username at domain it authenticates off
the sql DB and works fine. If the user logins with username with no @domain
it fails on the sql lookup and succeeds on the pam user DB.

However I was wondering if I can have another sql DB lookup that says when
the user logins and fails against the first two user DBs, sql/pam db, to try
this last sql user DB and appends a default domain to it, because the sql DB
lists username with the domain. Currently I have all users login in with no
realm on the older mail server and I wanted to migrate these users to
dovecot 2.x with minimal impact and wanted to have the ability for these
virtual users to login with and without a realm.

 

 Thanks paul.




More information about the dovecot mailing list