HI SAM:
      I help sqwebmail can  clustering work with qmail-ldap.
   excuse my english , best regard !

xie 

this is my modify:

1. modify authldaprc:
  #add mailhost , is options 
  LDAP_MAILHOST    mailhost

2.modify cgi/cgihttpscriptptr.c
 /*  char *p=getenv("HTTP_HOST"); */
     char *p=getenv("MAILHOST");

3. modify auth/success.c :

  authsuccess(
  const char *homedir,
  const char *username,
  const char *uid,
  const char *gid,
  const char *authaddr,
  const char *authfullname,
  const char *authmailhost ) /* add mailhost */
      
  if (!authmailhost) authmailhost=getenv("HTTP_HOST");
 /* i assume mailhost is webserver 
   if mailhost is't exist , replace getenv("HTTP_HOST") replace */

  authmailhost_buf= (char *)malloc(sizeof("MAILHOST=")+strlen(authmailhost));
 if(!authmailhost_buf)
 {
  perror("mailoc"); 
  authexit(1);
 }
 strcat(strcpy(authmailhost_buf,"MAILHOST="),authmailhost);

 putenv(authmailhost_buf);

4. modify authlib/authlib.c 

  
authsuccess(a->homedir,0,a->sysuserid,&a->sysgroupid,a->address,a->fullname,a->mailhost)
 /* add a->mailhost parameter */

5.modify authlib/authldaplib.c
  struct ldap_info
{
  const char *hostname;
  .
  const char *mailhost; /* add mailhost */
}

modify function authldap_read_config 

6 modify authlib/auth.h

 authsucess 
{
 const char *,
 const char *.
...
..
const cahr *); /* add mailhost */

 

  

  
 
 

 

************************************
�����Ƴ����л���ͼ��
http://map.china.com

Reply via email to