From: Art Cancro Date: Sat, 26 Jan 2002 21:33:38 +0000 (+0000) Subject: * More internet addressing and global directory stuff. I think it's all working now X-Git-Tag: v7.86~6568 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=3c201b1624a4213b903757401538d74cd1d7dfa9 * More internet addressing and global directory stuff. I think it's all working now except for the purging of old entries. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 72a94ba9c..5f1cf4d7e 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 590.93 2002/01/26 21:33:38 ajc + * More internet addressing and global directory stuff. I think it's all working now + except for the purging of old entries. + Revision 590.92 2002/01/26 11:02:37 error * citadel.spec cleaned up @@ -3259,4 +3263,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index a263bf42c..306339502 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -270,119 +270,6 @@ void process_rfc822_addr(char *rfc822, char *user, char *node, char *name) -/* - * Back end for convert_internet_address() - * (Compares an internet name [buffer1] and stores in [buffer2] if found) - */ -void try_name(struct usersupp *us, void *data) { - struct passwd *pw; - struct trynamebuf *tnb; - tnb = (struct trynamebuf *)data; - - if (!strncasecmp(tnb->buffer1, "cit", 3)) - if (atol(&tnb->buffer1[3]) == us->usernum) - strcpy(tnb->buffer2, us->fullname); - - if (!collapsed_strcmp(tnb->buffer1, us->fullname)) - strcpy(tnb->buffer2, us->fullname); - - if (us->uid != BBSUID) { - pw = getpwuid(us->uid); - if (pw != NULL) { - if (!strcasecmp(tnb->buffer1, pw->pw_name)) { - strcpy(tnb->buffer2, us->fullname); - } - } - } -} - - -/* - * Convert an Internet email address to a Citadel user/host combination - */ -int convert_internet_address(char *destuser, char *desthost, char *source) -{ - char user[SIZ]; - char node[SIZ]; - char name[SIZ]; - struct quickroom qrbuf; - int i; - int hostalias; - struct trynamebuf tnb; - char buf[SIZ]; - int passes = 0; - char sourcealias[1024]; - - safestrncpy(sourcealias, source, sizeof(sourcealias) ); - alias(sourcealias); - -REALIAS: - /* Split it up */ - process_rfc822_addr(sourcealias, user, node, name); - lprintf(9, "process_rfc822_addr() converted to <%s@%s> (%s)\n", - user, node, name); - - /* Map the FQDN to a Citadel node name - */ - hostalias = CtdlHostAlias(node); - switch(hostalias) { - case hostalias_localhost: - strcpy(node, config.c_nodename); - break; - - case hostalias_gatewaydomain: - extract_token(buf, node, 0, '.'); - safestrncpy(node, buf, sizeof buf); - } - - /* Now try to resolve the name - * FIXME ... do the multiple-addresses thing - */ - if (!strcasecmp(node, config.c_nodename)) { - - - /* First, see if we hit an alias. Don't do this more than - * a few times, in case we accidentally hit an alias loop - */ - strcpy(sourcealias, user); - alias(user); - if ( (strcasecmp(user, sourcealias)) && (++passes < 3) ) - goto REALIAS; - - /* Try all local rooms */ - if (!strncasecmp(user, "room_", 5)) { - strcpy(name, &user[5]); - for (i=0; inum_internet = 0; ret->num_ignet = 0; ret->num_error = 0; + ret->num_room = 0; if (recipients == NULL) { num_recps = 0; @@ -2213,6 +2216,14 @@ struct recptypes *validate_recipients(char *recipients) { mailtype = alias(this_recp); mailtype = alias(this_recp); mailtype = alias(this_recp); + for (j=0; j<=strlen(this_recp); ++j) { + if (this_recp[j]=='_') { + this_recp_cooked[j] = ' '; + } + else { + this_recp_cooked[j] = this_recp[j]; + } + } invalid = 0; switch(mailtype) { case MES_LOCAL: @@ -2232,6 +2243,22 @@ struct recptypes *validate_recipients(char *recipients) { } strcat(ret->recp_local, this_recp); } + else if (getuser(&tempUS, this_recp_cooked) == 0) { + ++ret->num_local; + strcpy(this_recp, tempUS.fullname); + if (strlen(ret->recp_local) > 0) { + strcat(ret->recp_local, "|"); + } + strcat(ret->recp_local, this_recp); + } + else if ( (!strncasecmp(this_recp, "room_", 5)) + && (!getroom(&tempQR, &this_recp_cooked[5])) ) { + ++ret->num_room; + if (strlen(ret->recp_room) > 0) { + strcat(ret->recp_room, "|"); + } + strcat(ret->recp_room, &this_recp_cooked[5]); + } else { ++ret->num_error; invalid = 1;