$Log$
+ Revision 580.80 2001/12/01 05:26:01 ajc
+ * Added a command "SMTP" to the Citadel protocol, to do some unimportant
+ utility/diagnostic functions.
+
Revision 580.79 2001/11/27 17:08:29 ajc
* When calling an external editor, set the environment variable
WINDOW_TITLE to an appropriate value.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
long SYM_SMTP;
long SYM_SMTP_RECP;
+int run_queue_now = 0; /* Set to 1 to ignore SMTP send retry times */
+
/*****************************************************************************/
}
}
-
/*
* Postpone delivery if we've already tried recently.
*/
- if ( (time(NULL) - last_attempted) < retry) {
+ if (((time(NULL) - last_attempted) < retry) && (run_queue_now == 0)) {
lprintf(7, "Retry time not yet reached.\n");
phree(instr);
return;
SPOOLMIME, NULL, smtp_do_procmsg, NULL);
lprintf(7, "SMTP: queue run completed\n");
+ run_queue_now = 0;
doing_queue = 0;
}
+/*****************************************************************************/
+/* SMTP UTILITY COMMANDS */
+/*****************************************************************************/
+
+void cmd_smtp(char *argbuf) {
+ char cmd[SIZ];
+ char node[SIZ];
+ char buf[SIZ];
+ int i;
+ int num_mxhosts;
+
+ if (CtdlAccessCheck(ac_aide)) return;
+
+ extract(cmd, argbuf, 0);
+
+ if (!strcasecmp(cmd, "mx")) {
+ extract(node, argbuf, 1);
+ num_mxhosts = getmx(buf, node);
+ cprintf("%d %d MX hosts listed for %s\n",
+ LISTING_FOLLOWS, num_mxhosts, node);
+ for (i=0; i<num_mxhosts; ++i) {
+ extract(node, buf, i);
+ cprintf("%s\n", node);
+ }
+ cprintf("000\n");
+ return;
+ }
+
+ else if (!strcasecmp(cmd, "runqueue")) {
+ run_queue_now = 1;
+ cprintf("%d All outbound SMTP will be retried now.\n", OK);
+ return;
+ }
+
+ else {
+ cprintf("%d Invalid command.\n", ERROR+ILLEGAL_VALUE);
+ }
+
+}
+
+
+
+
/*****************************************************************************/
/* MODULE INITIALIZATION STUFF */
/*****************************************************************************/
create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1);
CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
+ CtdlRegisterProtoHook(cmd_smtp, "SMTP", "SMTP utility commands");
return "$Id$";
}
occurred, in which case it returns ERROR. Please note that no checking is
done on the supplied data; if the requested message does not exist, the SEEN
command simply returns OK without doing anything.
+
+
+ SMTP (utility commands for the SMTP gateway)
+
+ This command, accessible only by Aides, supports several utility operations
+which examine or manipulate Citadel's SMTP support. The first command argument
+is a subcommand telling the server what to do. The following subcommands are
+supported:
+
+ SMTP mx|hostname (display all MX hosts for 'hostname')
+ SMTP runqueue (attempt immediate delivery of all messages
+ in the outbound SMTP queue, ignoring any
+ retry times stored there)
-
ASYN (ASYNchronous message support)