$Log$
+Revision 1.474 2000/03/03 04:12:37 ajc
+* Finished the inbound side of gateway domain service
+
Revision 1.473 2000/02/27 04:55:51 ajc
* Added "keymenu()" generic menu-maker to commands.c
* Blocked non-numeric input to intprompt() (fixes bug #16)
Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Initial CVS import
-
char buf[256];
int passes = 0;
char sourcealias[1024];
- int msgtype = 0;
safestrncpy(sourcealias, source, sizeof(sourcealias) );
- msgtype = alias(sourcealias);
- lprintf(9, "msgtype(1) for <%s> is %d\n", msgtype, user);
+ alias(sourcealias);
REALIAS:
/* Split it up */
* a few times, in case we accidentally hit an alias loop
*/
strcpy(sourcealias, user);
- msgtype = alias(user);
- lprintf(9, "msgtype(2) for <%s> is %d\n", msgtype, user);
+ alias(user);
if ( (strcasecmp(user, sourcealias)) && (++passes < 3) )
goto REALIAS;
strcpy(destuser, user);
strcpy(desthost, node);
- if (msgtype == MES_BINARY) return(rfc822_address_on_citadel_network);
+ if (hostalias == hostalias_gatewaydomain)
+ return(rfc822_address_on_citadel_network);
return(rfc822_address_nonlocal);
}
* (This is kind of ugly. IGnet should be done using clean server-to-server
* code instead of the old style spool.)
*/
-void smtp_deliver_ignet(struct CtdlMessage *msg, char *user, char *room) {
+void smtp_deliver_ignet(struct CtdlMessage *msg, char *user, char *dest) {
struct ser_ret smr;
char *hold_R, *hold_D;
FILE *fp;
+ char filename[256];
+ static int seq = 0;
+
+ lprintf(9, "smtp_deliver_ignet(msg, %s, %s)\n", user, dest);
hold_R = msg->cm_fields['R'];
hold_D = msg->cm_fields['D'];
msg->cm_fields['R'] = user;
- msg->cm_fields['D'] = room;
+ msg->cm_fields['D'] = dest;
serialize_message(&smr, msg);
msg->cm_fields['D'] = hold_D;
if (smr.len != 0) {
- fp = fopen(tmpnam("./network/spoolin/"), "wb");
+ sprintf(filename, "./network/spoolin/%s.%04x.%04x",
+ dest, getpid(), ++seq);
+ lprintf(9, "spool file name is <%s>\n", filename);
+ fp = fopen(filename, "wb");
if (fp != NULL) {
fwrite(smr.ser, smr.len, 1, fp);
fclose(fp);
/* Delivery over the local Citadel network (IGnet) */
if (!strcasecmp(dtype, "ignet")) {
- smtp_deliver_ignet(msg, user, room);
+ extract(user, buf, 1);
+ extract(node, buf, 2);
+ smtp_deliver_ignet(msg, user, node);
}
/* Remote delivery */