View | Details | Raw Unified
Collapse All | Expand All

(-) vpopmail.c (-40 / +34 lines)
 Lines 1012-1062    Link Here 
 int  buff_size;
 int  buff_size;
{
{
 int i;
 int i;
 int j;
 int n;
 int k;
 int len;
 int found;
 char *at = NULL;
    for( i=0,j=0,found=0; found==0 && j<buff_size && email[i]!=0; ++i,++j) {
  lowerit(email);
        for(k=0;ATCHARS[k]!=0;++k){
            if ( email[i] == ATCHARS[k] ) {
  len = strlen(ATCHARS);
                found = 1;
  for(i=0;i<len; ++i ) if ((at=strchr(email,ATCHARS[i]))) break;
                continue;
            }
  if ( at!=NULL ) {
        }
    n = at - email + 1;
        if ( found == 0 )  { 
    if ( n > buff_size ) n = buff_size;
          user[j] = email[i];
    strncpy(user, email, n);
        }
    user[n-1] = 0;
    }
    strncpy(domain, ++at, buff_size);
    user[j] = 0;
    domain[buff_size-1] = 0;
    lowerit(user);
  } else {
    strncpy(user, email, buff_size);
    user[buff_size-1] = 0;
    domain[0] = 0;
    domain[0] = 0;
    if (email[i]!=0) {
  }
        for(j=0;j<buff_size&&email[i]!=0&&email[i]!='@';++i,++j) {
            domain[j] = email[i];
        }
        domain[j] = 0;
        lowerit(domain);
    }
    if ( is_username_valid( user ) != 0 ) {
       printf("user invalid %s\n", user);
       return(-1);
    }
    if ( is_domain_valid( domain ) != 0 ) {
  if ( is_username_valid( user ) != 0 ) {
       printf("domain invalid %s\n", domain);
    printf("user invalid %s\n", user);
       return(-1);
    return(-1);
    }
  }
    /* if the domain is blank put in the default domain 
  if ( is_domain_valid( domain ) != 0 ) {
     * if it was configured with --enable-default-domain=something
    printf("domain invalid %s\n", domain);
     */
    return(-1);
    vset_default_domain(domain);
  }
    vget_real_domain(domain, buff_size);
  /* if the domain is blank put in the default domain 
   * if it was configured with --enable-default-domain=something
   */
  vset_default_domain(domain);
  vget_real_domain(domain, buff_size);
    return(0);
  return(0);
} 
} 
/*
/*