On Wed, 4 Jun 2003 10:37:41 -0400 (EDT)
Moshe Jacobson <[EMAIL PROTECTED]> wrote:

> On Tue, 3 Jun 2003, Ken Jones wrote:
> > Does anyone have any code changes they would like to get into the
> > next release? I want to put together a new stable version 5.4. 
> > Hopefully release it in the next few weeks.
> 
> There seems to be a problem in th maildir_to_email() function in
> vdelivermail.c.  If the domain dir is not directly under the
> DOMAINS_DIR, e.g. /home/vpopmail/domains/1/example.com, then a user
> [EMAIL PROTECTED] will have a maildir of:
> 
>     /home/vpopmail/domains/1/example.com/joe/Maildir/
> 
> and maildir_to_email() returns an email address of [EMAIL PROTECTED] instead of
> [EMAIL PROTECTED]
> 
> This should definitely be fixed as it is a simple and obvious bug.
> 
> My (untested) fix is as follows.  Change the following block located
> near the bottom of maildir_to_email():
> 
> ----
> for( pnt = last + (strlen(DOMAINS_DIR)+2); (*pnt && *pnt != '/' && j < 255); ++pnt, 
> ++j ) {
>   email[j] = *pnt;
> }
> ----
> 
> to:
> 
> ----
> pnt = last + strlen(DOMAINS_DIR) + 2;
> while( *(pnt+1) == '/' ) pnt+=2;
> for( ; (*pnt && *pnt != '/' && j < 255); ++pnt, ++j ) {
>   email[j] = *pnt;
> }
> ----
> 
> Moshe
> 
> -- 
> Moshe Jacobson 
> http://runslinux.net 
> AIM: Jehsom
> 
it seems to me a far more permanent and scalable solution would be to select pw_name, 
pw_domain where pw_dir=DIR in the database. it is conceivable that [EMAIL PROTECTED]'s 
maildir be located in /some/where/else/joe/Maildir

Reply via email to