> Hi
> 
> I have been running Spamassassin now for 2 months and are 
> extremely happy
> with it. However, I run  mail account for family and friend 
> and am sick and
> get sick and tired of adding whitelist and blacklist entries for them.
> 
> So I though I would run Spamassassin with MySql and the PHP front-end.
> Spamassassin happy communications with MySql.
> 
> I have followed all the various documents I can find on 
> setting up the PHP
> interface for spamassassin, but I am still unable to past the 
> user login.
> 
> Can someone point me in the right direction or offer some 
> suggestions as to
> why the authentication is failing.
> 

Are you using vpopmail?  I hacked up my own authentication scheme on vpopmail and 
would be happy to share how I did it.  You also have to extend the 'username' field in 
the userpref table to varchar(64) or more depending on your domain name sizes

Anyhow.. here is what I use in login.php

--------------------------
list($pw_name,$pw_domain) = split("@", $username);
                
$pw_name = strtolower($pw_name);
$pw_domain = strtolower($pw_domain);
$username = strtolower($username);
                
$link = mysql_connect("$dbvpophost", "$dbvpopuser", "$dbvpoppass")
        or die ("Could not connect");
mysql_select_db ("$dbvpopname")
        or die ("Could not select database");
         
$cmd = "select pw_clear_passwd from vpopmail where pw_name = '$pw_name' AND pw_domain 
= '$pw_domain'";
$result = mysql_query($cmd);   
         
while($row=mysql_fetch_array($result)) {
        if($row[pw_clear_passwd] == $password) {
                $status = 0;
        } else {
                $status = 1;
        }
}
--------------------------

Note, my vpopmail table is set for many domains, so I have a pw_domain column.  If you 
did not configure with many domains, then you will need to modify that code a little 
because pw_domain will not be a column, and instead, your table name will be 
domain_com.

Now, if you do not store pw_clear_passwd in vpopmail table, you will need to run 
$password through crypt() or md5() depending on which encryption method you store your 
encrypted passwords with in mysql.

You can see my SA-php setup at https://mail.hutchnet.com/spamassassin/ - login/pass: 
[EMAIL PROTECTED]/test

Dallas
 
 

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to