[sork] Re: passwd 2.2.1-RC1 + vpopmail + mysql

Chip Bell cbell at msbv.com
Wed May 19 11:42:23 PDT 2004


Did this work for you Darren...anyone?

 

"Chris Nojima" <chris at toastedpixel.com> wrote in message
news:chris-29E22B.14302709042004 at sea.gmane.org...

> > > right, your problem stems from the use of "--disable-many-domains"
at
> > > the configuration point of your vpopmail (which creates a table
for each
> > > virtual domain instead of storing all users in a single table).  i
think
> > > you mentioned using a qmail-toaster distribution.  curious that it
came
> > > this way, as iirc, that's not a default option at configuration
time.
> > 
> > I installed the toaster with all defaults, except I disallowed
roaming
> > relay.
> 
> roaming relay isn't the same thing here.  that setting records IPs 
> addresses temporarily so that your users can use your qmail-smtpd to 
> send out email (say from home, on the road, at work, etc.).  it has
very 
> little to do with the problem you're having now.
> 
> > 
> > > passwd currently doesn't seem to support that particular part of
> > > vpopmail.
> > 
> > I'm noticing. I wish I could start over, but I've got too many user
accounts
> > as it is.
> > 
> 
> i don't know how comfortable you are editing your passwd install, but 
> try this out (since it can't break something that isn't broken
already) 
> =p.  the lines below assume you saved the patch to "patch.txt" and
that 
> it is copied to the same directory as "vpopmail.php".
> 
> cd /path/to/your/horde/passwd/lib/Driver
> cp vpopmail.php vpopmail.orig
> patch -p0 vpopmail.php patch.txt
> 
> /*** patch starts below
***********************************************/
> 
> --- vpopmail.orig Fri Apr  9 14:15:35 2004
> +++ vpopmail.new  Fri Apr  9 14:17:30 2004
> @@ -124,10 +124,12 @@
>  
>          list($name,$domain)=explode("@",$user);
>  
> -        // Build the SQL query.
> -        $query  = 'SELECT ' . $this->_params['passwd'] . ' FROM ' . 
> $this->_params['table'];
> -        $query .= ' WHERE ' . $this->_params['name'] . ' = ' . 
> $this->_db->quote($name);
> -        $query .= ' AND ' . $this->_params['domain'] . ' = ' . 
> $this->_db->quote($domain);
> +        $this->_params['table'] = strtr($this->_params['domain'],
'.', 
> '_');
> +
> +        $query  = 'SELECT ' . $this->_params['passwd'] . ' FROM ' . 
> +        $this->_params['table'];
> +        $query .= ' WHERE ' . $this->_params['name'] . ' = ' . 
> +        $this->_db->quote($name);
>  
>          // Execute the query.
>          $result = $this->_db->query($query);
> @@ -168,13 +170,17 @@
>          $newPassword = $this->encryptPassword($newPassword);
>  
>          // Build the SQL query.
> +        $this->_params['table'] = strtr($this->_params['domain'],
'.', 
> '_');
> +        
>          $query = 'UPDATE ' . $this->_params['table'];
> -        $query .= ' SET ' . $this->_params['passwd'] . ' = ' . 
> $this->_db->quote($newPassword);
> -    if($this->_params['use_clear_passwd']) {
> -     $query.= ' , ' . $this->_params['clear_passwd'] . ' = ' . 
> $this->_db->quote($clearPassword);
> -    }
> -        $query .= ' WHERE ' . $this->_params['name'] . ' = ' . 
> $this->_db->quote($name);
> -        $query .= ' AND ' . $this->_params['domain'] . ' = ' . 
> $this->_db->quote($domain);
> +        $query .= ' SET ' . $this->_params['passwd'] . ' = ' . 
> +        $this->_db->quote($newPassword);
> +        if($this->_params['use_clear_passwd']) {
> +        $query.= ' , ' . $this->_params['clear_passwd'] . ' = ' . 
> +        $this->_db->quote($clearPassword);
> +        }
> +        $query .= ' WHERE ' . $this->_params['name'] . ' = ' . 
> +        $this->_db->quote($name);
>  
>          // Execute the query.
>          $result = $this->_db->query($query);
> 
> 
> /*** patch ends
*******************************************************/
> 
> 
> i *think* this will work for you, but i can't test it because i don't 
> have the same setup as you.
> 
> let me know if it worked/didn't, and if you can get a mysql log of the

> query (success or failure) that'd be great!
> 
> -chris nojima
>



More information about the sork mailing list