#include "tools.h"
#include "internet_addressing.h"
#include "user_ops.h"
+#include "room_ops.h"
#include "parsedate.h"
char user[256];
char node[256];
char name[256];
+ struct quickroom qrbuf;
+ int i;
/* Split it up */
process_rfc822_addr(source, user, node, name);
strcpy(node, config.c_nodename);
}
- /* Return an error condition if the node is not known.
- * FIX ... make this work for non-local systems
- */
- if (strcasecmp(node, config.c_nodename)) {
- return(rfc822_address_invalid);
- }
-
/* Now try to resolve the name
* FIX ... do the multiple-addresses thing
*/
if (!strcasecmp(node, config.c_nodename)) {
+ /* Try all local rooms */
+ if (!strncasecmp(user, "room_", 5)) {
+ strcpy(name, &user[5]);
+ for (i=0; i<strlen(name); ++i)
+ if (name[i]=='_') name[i]=' ';
+ if (getroom(&qrbuf, name) == 0) {
+ strcpy(destuser, qrbuf.QRname);
+ strcpy(desthost, config.c_nodename);
+ return rfc822_room_delivery;
+ }
+ }
+
+ /* Try all local users */
strcpy(destuser, user);
strcpy(desthost, config.c_nodename);
strcpy(CC->buffer1, user);
return(rfc822_address_locally_validated);
}
+ strcpy(destuser, user);
+ strcpy(desthost, node);
return(rfc822_address_invalid); /* unknown error */
}