Re: Example records for SQL AUTH
On 11/3/2014 4:29 PM, Jorge Bastos wrote:
Hi,
Where can I get examples for the records for the "users" table?
If I understand your question properly and you're looking for examples of creating new virtual users, then this guide covers that:
https://www.linode.com/docs/email/email-with-postfix-dovecot-and-mysql
You would have to adjust to fit your chosen schema of course as theirs is a much simpler setup that excludes the uid, gid, and home values.
For SHA512-CRYPT, I tried:
replace into users values ('a@a.com','a.com',ENCRYPT('b', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))),'',0,0,'true');
schema is:
CREATE TABLE
users(
usernamevarchar(255) NOT NULL,
domainvarchar(255) NOT NULL,
passwordvarchar(255) NOT NULL,
homevarchar(255) NOT NULL,
uidint(11) NOT NULL,
gidint(11) NOT NULL,
activeenum('true','false') NOT NULL DEFAULT 'true',PRIMARY KEY (
username)) ENGINE=InnoDB DEFAULT CHARSET=utf8
Password_query:
password_query = select username, domain,password from users where username='%u' and domain='%d' and active='true'
What does your auth-sql-conf.ext file look like? With as much information as you already have in your database schema you may want to look at using the Prefetch userdb.
http://wiki2.dovecot.org/UserDatabase/Prefetch
P.S.
Apologies for the duplication. I forgot to reply to the list with my last response.
participants (1)
-
deoren