int a, b;
char aaa[300], bbb[300];
+ TRACE;
remove_any_whitespace_to_the_left_or_right_of_at_symbol(name);
+ TRACE;
fp = fopen("network/mail.aliases", "r");
if (fp == NULL)
fp = fopen("/dev/null", "r");
if (fp == NULL)
return (MES_ERROR);
+ TRACE;
strcpy(aaa, "");
strcpy(bbb, "");
while (fgets(aaa, sizeof aaa, fp) != NULL) {
if (!strcasecmp(name, aaa))
strcpy(name, bbb);
}
+ TRACE;
fclose(fp);
lprintf(7, "Mail is being forwarded to %s\n", name);
}
/* determine local or remote type, see citadel.h */
+ TRACE;
for (a = 0; a < strlen(name); ++a)
if (name[a] == '!')
return (MES_INTERNET);
+ TRACE;
for (a = 0; a < strlen(name); ++a)
if (name[a] == '@')
for (b = a; b < strlen(name); ++b)
if (name[b] == '.')
return (MES_INTERNET);
b = 0;
+ TRACE;
for (a = 0; a < strlen(name); ++a)
if (name[a] == '@')
++b;
GETSN: do {
a = getstring(fp, aaa);
} while ((a >= 0) && (strcasecmp(aaa, bbb)));
+ TRACE;
a = getstring(fp, aaa);
if (!strncmp(aaa, "use ", 4)) {
strcpy(bbb, &aaa[4]);
goto GETSN;
}
fclose(fp);
+ TRACE;
if (!strncmp(aaa, "uum", 3)) {
strcpy(bbb, name);
for (a = 0; a < strlen(bbb); ++a) {
}
return (MES_ERROR);
}
+ TRACE;
lprintf(9, "returning MES_LOCAL\n");
return (MES_LOCAL);
}
-void usergoto(char *where, int display_result)
+void usergoto(char *where, int display_result, int *retmsgs, int *retnew)
{
int a;
int new_messages = 0;
strcpy(truncated_roomname, &truncated_roomname[11]);
}
+ if (retmsgs != NULL) *retmsgs = total_messages;
+ if (retnew != NULL) *retnew = new_messages;
+
if (display_result)
cprintf("%d%c%s|%d|%d|%d|%d|%ld|%ld|%d|%d|%d|%d\n",
OK, CtdlCheckExpress(),
/* let internal programs go directly to any room */
if (CC->internal_pgm) {
- usergoto(towhere, 1);
+ usergoto(towhere, 1, NULL, NULL);
return;
}
((ra & UA_KNOWN) == 0)) {
goto NOPE;
} else {
- usergoto(towhere, 1);
+ usergoto(towhere, 1, NULL, NULL);
return;
}
}
if (kill_ok) {
strcpy(deleted_room_name, CC->quickroom.QRname);
delete_room(&CC->quickroom); /* Do the dirty work */
- usergoto(BASEROOM, 0); /* Return to the Lobby */
+ usergoto(BASEROOM, 0, NULL, NULL); /* Return to the Lobby */
/* tell the world what we did */
sprintf(aaa, "%s> killed by %s\n",
void cmd_lkrn (char *argbuf);
void cmd_lkro (char *argbuf);
void cmd_lzrm (char *argbuf);
-void usergoto (char *where, int display_result);
+void usergoto (char *where, int display_result, int *msgs, int *new);
void cmd_goto (char *gargs);
void cmd_whok (void);
void cmd_rdir (void);
int ok = 0;
int ra = 0;
struct quickroom QRscratch;
+ int msgs, new;
extract_token(towhere, parms, 0, ' ');
return;
}
- /* FIXME */
+ /*
+ * usergoto() formally takes us to the desired room, happily returning
+ * the number of messages and number of new messages.
+ */
+ usergoto(augmented_roomname, 0, &msgs, &new);
+
+ cprintf("* %d EXISTS\r\n", msgs);
+ cprintf("* %d RECENT\r\n", new);
+ cprintf("* OK [UIDVALIDITY 0] UIDs valid\r\n");
cprintf("%s OK [FIXME] SELECT completed\r\n", tag);
}
char *Dynamic_Module_Init(void)
{
SYM_IMAP = CtdlGetDynamicSymbol();
- CtdlRegisterServiceHook(1143, /* FIXME put in config setup */
+ CtdlRegisterServiceHook(2243, /* FIXME put in config setup */
NULL,
imap_greeting,
imap_command_loop);
/* Run any cleanup routines registered by loadable modules */
PerformSessionHooks(EVT_LOGIN);
- usergoto(BASEROOM,0); /* Enter the lobby */
+ usergoto(BASEROOM, 0, NULL, NULL); /* Enter the lobby */
rec_log(CL_LOGIN,CC->curr_user);
}
CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
lputuser(&CC->usersupp);
cprintf("%d Ok\n",OK);
- usergoto(BASEROOM, 0);
+ usergoto(BASEROOM, 0, NULL, NULL);
}
/*