Hello!
I got the password plugin working. The problem I have is that the SASL-users are also located in a MySQL-table named sasl.
Now when a user changes her password I want to change also the password in the SASL-table.
I tried with two password_queries
$rcmail_config['password_query'] = 'UPDATE mailbox SET password=%p WHERE username=%u AND password=%o LIMIT 1'; $rcmail_config['password_query'] = 'UPDATE sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1';
but that does not work. Then I tried the following but that also did not work.
$rcmail_config['password_query'] = 'UPDATE mailbox, sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1';
I don't know how to join or concatenate this two queris to one.
Can somebody help?
Greetings
Andreas
On 04/10/2014 07:29 PM, Andreas Meyer wrote:
but that does not work. Then I tried the following but that also did not work.
$rcmail_config['password_query'] = 'UPDATE mailbox, sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1';
Create function/trigger
http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html
Am 10.04.2014 20:18, schrieb A.L.E.C:
On 04/10/2014 07:29 PM, Andreas Meyer wrote:
but that does not work. Then I tried the following but that also did not work.
$rcmail_config['password_query'] = 'UPDATE mailbox, sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1';
Create function/trigger
http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html
oh my god, that's to much for me.
Andreas
On Thu, Apr 10, 2014 at 11:30 AM, Andreas Meyer anmeyer@anup.de wrote:
Am 10.04.2014 20:18, schrieb A.L.E.C:
On 04/10/2014 07:29 PM, Andreas Meyer wrote:
but that does not work. Then I tried the following but that also did not work. $rcmail_config['password_query'] = 'UPDATE mailbox, sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1';
Create function/trigger http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html
oh my god, that's to much for me.
Untested, but try making two SQL commands:
$rcmail_config['password_query'] = 'UPDATE mailbox SET password=%p WHERE username=%u AND password=%o LIMIT 1; UPDATE sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1;'
Although I do have to ask, why do you have two tables with identical information? This is the perfect case for all backend services to be using a common table for the user/pass with a JOIN to tie other bits of data together with that auth info.
The total budget at all receivers for solving senders' problems is $0. If you want them to accept your mail and manage it the way you want, send it the way the spec says to. --John Levine
Hello!
Todd Lyons tlyons@ivenue.com schrieb am 11.04.14 um 06:26:03 Uhr:
$rcmail_config['password_query'] = 'UPDATE mailbox, sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1';
Create function/trigger http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html
oh my god, that's to much for me.
Untested, but try making two SQL commands:
$rcmail_config['password_query'] = 'UPDATE mailbox SET password=%p WHERE username=%u AND password=%o LIMIT 1; UPDATE sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1;'
Thank you, I'll try that this evening! Looks good! I tried with one update querie over the two tables with funny results ;)
Although I do have to ask, why do you have two tables with identical information? This is the perfect case for all backend services to be using a common table for the user/pass with a JOIN to tie other bits of data together with that auth info.
Yes you are right. It is because first I put the SASL users in a table some month ago. The dovecot useraccounts were in a plain password file. The users complained they can not change their password so I decided to put the users also into another table some days ago. This is the reason for I have two tables now.
I will put them together in one. Sadly I don't know SQL very well so I will have my fun with creating the join you mentioned.
...Todd
Andreas
Hello!
Todd Lyons tlyons@ivenue.com schrieb am 11.04.14 um 06:26:03 Uhr:
Create function/trigger http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html
oh my god, that's to much for me.
Untested, but try making two SQL commands:
$rcmail_config['password_query'] = 'UPDATE mailbox SET password=%p WHERE username=%u AND password=%o LIMIT 1; UPDATE sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1;'
Unfortunatly that doesn't work. I get a blank screen and this in the log:
[11-Apr-2014 16:34:17 UTC] PHP Parse error: syntax error, unexpected T_VARIABLE in /serverroot/esystem/plugins/password/config.inc.php on line 79 [11-Apr-2014 16:38:01 UTC] PHP Parse error: syntax error, unexpected T_VARIABLE in /serverroot/esystem/plugins/password/config.inc.php on line 83 [11-Apr-2014 16:39:09 UTC] PHP Parse error: syntax error, unexpected T_VARIABLE in /serverroot/esystem/plugins/password/config.inc.php on line 108 ...
and so on. It subjects all lines with the $rcmail_config variable.
Andreas
Hello!
Todd Lyons tlyons@ivenue.com schrieb am 11.04.14 um 06:26:03 Uhr:
Untested, but try making two SQL commands:
$rcmail_config['password_query'] = 'UPDATE mailbox SET password=%p WHERE username=%u AND password=%o LIMIT 1; UPDATE sasl SET password=%p WHERE username=%u AND password=%o LIMIT 1;'
Although I do have to ask, why do you have two tables with identical information? This is the perfect case for all backend services to be using a common table for the user/pass with a JOIN to tie other bits of data together with that auth info.
I'm blind. This is how postfix queries the sasl table:
pwcheck_method: auxprop auxprop_plugin: sql mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5 sql_engine: mysql sql_hostnames: 127.0.0.1 sql_user: xxx sql_passwd: xxx sql_database: mailxxx sql_select: SELECT password FROM sasl WHERE username = '%u@%r'
so I just had to change the querie to the table 'mailbox'. How easy it can be.
Thanks for the help and this nice piece of software!
Andreas