[sork] PASSWD with MySQL, Postfix, VirtualDomains/Users

Jan Schneider jan at horde.org
Mon Dec 3 18:13:06 UTC 2007


Zitat von Gustavo Verduzco Vazquez <info at gustavoverduzco.org>:

> Hi!
>
> I have a custom Postfix/MySQL Virtual Domains/Users setup that I
> access using Horde as the webmail client. I am trying to get this
> setup to work with PASSWD but so far I am out of luck.
>
> I have a database called "mail" with a table called "users" where I
> store the following fields: "email" and "password". My users log into
> Horde with their full email address as their username and the password
> is stored in the database encrypted with the ENCRYPT SQL function.
>
> While I was reading the information on the "backends.php.dist" file I
> didn't find a way to store the password on the database using the
> ENCRYPT SQL function. I even tried setting a custom query to store the
> password but I got a syntax error from PHP. ( 'query_modify' =>
> 'UPDATE `mail`.`users` SET `password` = ENCRYPT( '%p' ) WHERE CONVERT(
> `users`.`email` USING utf8 ) = `%U`' )

Sounds like this query should do what you want:

'UPDATE users SET password = ENCRYPT(\'%p\') WHERE email = \'%U\''

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the sork mailing list