whobbs.c sendcommand.c mime_parser.c base64.c qpdecode.c getutline.c \
auth.c chkpwd.c client_icq.c html.c vcard.c serv_upgrade.c \
serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \
- domain.c clientsocket.c serv_inetcfg.c serv_rwho.c
+ domain.c clientsocket.c serv_inetcfg.c serv_rwho.c ignet.c
DEP_FILES=$(SOURCES:.c=.d)
msgbase.ro config.ro sysdep.ro locate_host.ro housekeeping.ro \
database.ro control.ro logging.ro policy.ro dynloader.ro tools.ro \
mime_parser.ro html.ro internet_addressing.ro \
- parsedate.ro genstamp.ro clientsocket.ro \
+ parsedate.ro genstamp.ro clientsocket.ro ignet.ro \
$(AUTH) $(LIBOBJS:.o=.ro)
citserver: $(SERV_OBJS)
--- /dev/null
+/*
+ * $Id$
+ *
+ */
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <signal.h>
+#include <pwd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <string.h>
+#include <limits.h>
+#include "citadel.h"
+#include "server.h"
+#include <time.h>
+#include "sysdep_decls.h"
+#include "citserver.h"
+#include "support.h"
+#include "config.h"
+#include "tools.h"
+#include "msgbase.h"
+#include "internet_addressing.h"
+#include "ignet.h"
+#include "user_ops.h"
+#include "room_ops.h"
+#include "parsedate.h"
+
+
+
+/*
+ * Returns nonzero if the specified nodename is on the Citadel network
+ */
+
+int is_ignet(char *node) {
+
+ return 0; /* FIXME */
+
+}
+
+
+int ignet_spool_to(char *node, long msgnum) {
+
+ return 1; /* FIXME */
+
+}
+
+
+
+
+
#include "msgbase.h"
#include "tools.h"
#include "internet_addressing.h"
+#include "ignet.h"
#include "genstamp.h"
#include "domain.h"
#include "clientsocket.h"
/* Parse out the host portion of the recipient address */
process_rfc822_addr(addr, user, node, name);
+
+ if (is_ignet(node)) {
+ if (ignet_spool_to(node, msgnum) == 0) {
+ strcpy(dsn, "Delivery via Citadel network successful");
+ *status = 2;
+ }
+ else {
+ strcpy(dsn, "Delivery via Citadel network failed");
+ *status = 5;
+ }
+ return;
+ }
+
lprintf(9, "Attempting SMTP delivery to <%s> @ <%s> (%s)\n",
user, node, name);
* Run through the queue sending out messages.
*/
void smtp_do_queue(void) {
+ static int doing_queue = 0;
+
+ /*
+ * This is a simple concurrency check to make sure only one queue run
+ * is done at a time. We could do this with a mutex, but since we
+ * don't really require extremely fine granularity here, we'll do it
+ * with a static variable instead.
+ */
+ if (doing_queue) return;
+ doing_queue = 1;
+
+ /*
+ * Go ahead and run the queue
+ */
lprintf(5, "SMTP: processing outbound queue\n");
if (getroom(&CC->quickroom, SMTP_SPOOLOUT_ROOM) != 0) {
CtdlForEachMessage(MSGS_ALL, 0L, SPOOLMIME, NULL, smtp_do_procmsg);
lprintf(5, "SMTP: queue run completed\n");
+ doing_queue = 0;
}