

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
12 messages in net.sourceforge.lists.courier-usersRE: [courier-users] Howto enable cryp...| From | Sent On | Attachments |
|---|---|---|
| Daniel Bachler | May 16, 2003 7:28 am | |
| Stefan Hornburg | May 16, 2003 7:58 am | |
| Joe Laffey | May 16, 2003 9:01 am | |
| Joe Laffey | May 16, 2003 9:13 am | |
| Joe Laffey | May 16, 2003 9:52 am | |
| tibyke | May 17, 2003 12:15 am | |
| Daniel Bachler | May 18, 2003 7:01 am | |
| Joe Laffey | May 18, 2003 9:27 am | |
| James A Baker | May 18, 2003 10:55 am | |
| cour...@interfacelounge.net | May 18, 2003 8:04 pm | |
| Joshua E Warchol | May 20, 2003 11:54 am | |
| Randy | May 20, 2003 12:13 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | RE: [courier-users] Howto enable crypted pwds for authmysql with php? | Actions... |
|---|---|---|
| From: | cour...@interfacelounge.net (cour...@interfacelounge.net) | |
| Date: | May 18, 2003 8:04:46 pm | |
| List: | net.sourceforge.lists.courier-users | |
This is a bit of code I wrote a while ago to change courier mysql passwords, it takes an existing password from the DB, checks it and changes it to a new password. I haven't used it for a while so can't remember just how well it works but should be fine as a starting point.
<?php // $db_passwd is pulled from the DB ;)
if ($db_passwd == "" OR $_POST['newpassword'] != $_POST['newpassword2']) { echo "Error with Username or password<br />\n"; die; }
$old_passwd = crypt($_POST['password']); $passwd = crypt($passwd,$db_passwd);
$salt = substr($passwd, 0, 12); $salted_passwd = crypt($_POST['password'], $salt); $new_passwd = crypt($_POST['newpassword']);
// debug stuff echo ("Email: \"" . $_POST['username'] . "\"<br />\n"); echo ("Old passwd: \"" . $old_passwd . "\"<br />\n"); echo ("DB passwd: \"" . $db_passwd . "\"<br />\n"); echo ("DB passwd Length: \"" . strlen($db_passwd) . "\"<br />\n"); echo ("Crypted DB passwd: \"" . $passwd . "\"<br />\n"); echo ("Salted Old DB passwd: \"" . $salted_passwd . "\"<br />\n"); echo ("Salted Old DB passwd Length: \"" . strlen($salted_passwd) . "\"<br />\n");
if (trim($db_passwd) == trim($salted_passwd)) { echo "Password verified!<br />\n"; } else { echo "Error with Username or password<br />\n"; die; }
// do the rest.. add to db etc ?>
Hope it helps,
hunter
-----Original Message----- From: cour...@lists.sourceforge.net [mailto:cour...@lists.sourceforge.net] On Behalf Of James A Baker Sent: Monday, 19 May 2003 3:54 AM To: cour...@lists.sourceforge.net Subject: Re: [courier-users] Howto enable crypted pwds for authmysql with php?
On Sunday, May 18, 2003, at 09:06 US/Central, Daniel Bachler wrote:
On Sat, 17 May 2003 00:04:57 -0500, James A Baker <jaba...@mac.com> wrote:
Courier's "userdbpw" will create both crypted and md5 passwords that work fine in postgres. Does it not work for you? -- Or did I miss something here?
I'm afraid I did not find it. Could you tell me where to look for it? I did a find on userdbpw in the courier directory but it did not turn up with anything. Is this tool optional?
Thanks for your patience, Daniel
Well, not precisely... not without knowing your install paths anyway. But I can tell you that on my system, it was installed as: /usr/lib/courier/sbin/userdbpw
AFAIK, it is installed by default. But I don't know that for sure. If you perhaps didn't install the authuserdb module at all (i.e. used the --without-authuserdb option to configure), then maybe it doesn't get installed either. I'm just not sure.
HTH.
-jab
------------------------------------------------------- This SF.net email is sponsored by: If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________ courier-users mailing list cour...@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users







