*** webmail/auth.c Sun May 16 03:43:47 2004 --- webmail.patched/auth.c Sun Sep 5 21:48:43 2004 *************** *** 52,78 **** char buf[512]; static char *my_hostname=0; FILE *f; if (my_hostname == 0) { ! buf[0]=0; ! if ((f=fopen(HOSTNAMEFILE, "r")) != 0) { ! char *p; ! ! fgets(buf, sizeof(buf), f); ! fclose(f); ! if ((p=strchr(buf, '\n')) != 0) ! *p=0; ! } ! if (buf[0] == 0 && gethostname(buf, sizeof(buf)-1)) ! strcpy(buf, "localhost"); ! if ((my_hostname=malloc(strlen(buf)+1)) == 0) ! enomem(); ! strcpy(my_hostname, buf); } return (my_hostname); } --- 52,86 ---- char buf[512]; static char *my_hostname=0; FILE *f; + char *vhostname= getenv("VHOST_MAILDOMAIN"); if (my_hostname == 0) { ! if (vhostname!=NULL) { ! if ((my_hostname=malloc(strlen(vhostname)+1))==0) ! enomem(); ! strcpy(my_hostname, vhostname); ! } else { ! buf[0]=0; ! if ((f=fopen(HOSTNAMEFILE, "r")) != 0) ! { ! char *p; ! ! fgets(buf, sizeof(buf), f); ! fclose(f); ! if ((p=strchr(buf, '\n')) != 0) ! *p=0; ! } ! if (buf[0] == 0 && gethostname(buf, sizeof(buf)-1)) ! strcpy(buf, "localhost"); ! if ((my_hostname=malloc(strlen(buf)+1)) == 0) ! enomem(); ! strcpy(my_hostname, buf); ! } } return (my_hostname); } *** webmail/sqwebmail.h Sun Mar 7 05:06:15 2004 --- webmail.patched/sqwebmail.h Sun Sep 5 22:13:23 2004 *************** *** 49,55 **** strncmp((p), "SCRIPT_", 7) == 0 || \ strncmp((p), "SERVER_", 7) == 0 || \ strncmp((p), "CONTENT_", 8) == 0 || \ ! strncmp((p), "PATH_INFO=", 10) == 0) /* Where we keep the IP address we authenticated from */ --- 49,56 ---- strncmp((p), "SCRIPT_", 7) == 0 || \ strncmp((p), "SERVER_", 7) == 0 || \ strncmp((p), "CONTENT_", 8) == 0 || \ ! strncmp((p), "PATH_INFO=", 10) == 0 || \ ! strncmp((p), "VHOST_MAILDOMAIN", 16) == 0) /* Where we keep the IP address we authenticated from */