hi daniel!
> Some time ago I made a modification to SQWebmail that took the URI and
> grabbed the domain, and appended it to the username if the username was
> not specified with a domain. I had also e-mailed this code to another on
> the list who wanted the same functionality, what I would like is if that
> person, Mark or Mike, or something similar (if my memory serves me
> correctly) to e-mail me that section of code, during an upgrade it got
> lost...
Martin? ;-)
here is your code.
how about an implementation of that in the sqwebmail source code?
greets
Martin
--
http://www.kos.li/ martin<at>kos<dot>li +41-76-384-93-33
ICQ# 13556143 Fax +49-89-244-323-681
Say NO to HTML in mail and news
Proudly running Debian GNU/Linux. See http://www.debian.org/
if (*(u=cgi("username")))
/* Request to log in */
{
const char *p=cgi("password");
const char *mailboxid;
const char *u2=cgi("logindomain");
char *uri= getenv("HTTP_HOST");
char *ubuf=malloc(strlen(u)+strlen(u2)+2+strlen(uri));
int can_changepwd;
strcpy(ubuf, u);
/* Is this NOW a fully qualified mail address ?
- If not we tack the domain name onto the end */
if(index(ubuf, '@') == NULL ) {
if (*u2) {
strcat(strcat(ubuf, "@"), u2);
} else {
/* No other clue in the form, steal the domain name from the
URI */
char *thing;
if((thing=strstr(uri, "webmail."))!=NULL)
uri=thing+8;
strcat(strcat(ubuf, "@"), uri);
}
}
/*fprintf(stderr, "Fucked up username=\"%s\"\n", ubuf);*/