$Log$
+Revision 1.440 2000/01/13 03:32:36 ajc
+* techdoc/delivery-list.txt: added (syntax for delivery lists)
+* domain.*: added (will contain MX lookup code)
+* internet_addressing.c, logging.c: fixed some buffer overflow bugs
+
Revision 1.439 2000/01/12 03:56:27 ajc
* sysdep.c: start the housekeeping thread *after* dropping root perms.
Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Initial CVS import
-
support.c sysdep.c tools.c user_ops.c userlist.c serv_expire.c \
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
+ serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \
+ domain.c
DEP_FILES=$(SOURCES:.c=.d)
modules/serv_test.mo: serv_test.mo
ln -f serv_test.mo modules
-modules/serv_smtp.so: serv_smtp.mo
- $(LINK_SHARED) -o modules/serv_smtp.so serv_smtp.mo
-
-modules/serv_smtp.mo: serv_smtp.mo
- ln -f serv_smtp.mo modules
-
modules/serv_pop3.so: serv_pop3.mo
$(LINK_SHARED) -o modules/serv_pop3.so serv_pop3.mo
modules/vcard.mo: vcard.mo
ln -f vcard.mo modules
+modules/serv_smtp.so: serv_smtp.mo domain.mo
+ $(LINK_SHARED) -o modules/serv_smtp.so serv_smtp.mo domain.mo
+
+modules/serv_smtp.mo: serv_smtp.mo
+ ln -f serv_smtp.mo modules
+
+modules/domain.mo: domain.mo
+ ln -f domain.mo modules
+
aidepost: aidepost.o config.o $(LIBOBJS)
$(CC) aidepost.o config.o $(LIBOBJS) $(LDFLAGS) -o aidepost
--- /dev/null
+#include <stdlib.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+#include "domain.h"
+
+#define SMART_HOST "gatekeeper.wdcs.com"
+
+/*
+ * getmx()
+ *
+ * Return one or more MX's for a mail destination.
+ *
+ * Upon success, it fills 'mxbuf' with one or more MX hosts, separated by
+ * vertical bar characters, and returns the number of hosts as its return
+ * value. If no MX's are found, it returns 0.
+ *
+ */
+int getmx(char *mxbuf, char *dest) {
+ char answer[1024];
+ int ret;
+ int i;
+
+
+ /* If we're configured to send all mail to a smart-host, then our
+ * job here is really easy.
+ */
+ if (1) { /* FIX */
+ strcpy(mxbuf, SMART_HOST);
+ return(1);
+ }
+
+ /* No smart-host? Look up the best MX for a site.
+ */
+ ret = res_query(
+ dest,
+ C_IN, T_MX, answer, sizeof(answer) );
+
+ lprintf(9, "res_query() returned %d\n", ret);
+ return(0); /* FIX not yet working!! */
+}
--- /dev/null
+int getmx(char *mxbuf, char *dest);
}
else if (!strcasecmp(key, "From")) {
- user = mallok(strlen(value));
- node = mallok(strlen(value));
- name = mallok(strlen(value));
+ user = mallok(1024);
+ node = mallok(1024);
+ name = mallok(1024);
process_rfc822_addr(value, user, node, name);
lprintf(9, "Converted to <%s@%s> (%s)\n", user, node, name);
if (msg->cm_fields['A'] == NULL)
time(&now);
fp = fopen("citadel.log", "a");
- fprintf(fp, "%ld|%u|%s\n", (long)now, lrtype, name);
- fclose(fp);
+ if (fp != NULL) {
+ fprintf(fp, "%ld|%u|%s\n", (long)now, lrtype, name);
+ fclose(fp);
}
+}
--- /dev/null
+Description of the custom MIME type "application/x-citadel-delivery-list"
+
+ This MIME type may be found in the outbound queue room on Citadel systems,
+which is typically called "__CitadelSMTPspoolout__". The room is flagged as
+private, but we will eventually hide it even to Aides.
+
+ Messages in this format contain delivery instructions. Therefore, for each
+message in the queue to be delivered to one or more recipients, there will be
+*two* messages in the room: one containing the actual message, and the other
+containing delivery instructions. It is expected that the instructions
+message may be replaced at any time (using an Extended ID field) if delivery
+to only some of the recipients has been accomplished.
+
+ Citadel keeps reference counts of each message on disk. Therefore if a
+message contains a mixture of local and remote recipients, there may be two
+or more references to the message itself, one of them being the one in the
+queue.
+
+ A delivery list contains one or more lines of text, each line containing
+a single instruction (usually a recipient). Fields are separated by the
+vertical bar character ("|") and there will always be at least one field on
+each line.
+
+
+
+ INSTRUCTION: msgid
+ SYNTAX: msgid|0000000
+ DESCRIPTION:
+ Defines the actual message for which we are providing delivery
+ instructions. This instruction must precede all the others. When
+ all deliveries have either succeeded or failed, both the instructions and
+ the copy of the message itself in the queue room should be deleted. The
+ second parameter specifies the message ID in the local database.
+
+
+ INSTRUCTION: local
+ SYNTAX: local|Friko Mumjiboolean|0
+ DESCRIPTION:
+ Indicates the name of a recipient on the local system to which the
+ message must be delivered. Almost never seen because most code delivers
+ directly.
+
+
+ INSTRUCTION: room
+ SYNTAX: room|Lobby|0
+ DESCRIPTION:
+ Indicates the name of a room on the local system to which the message
+ must be copied. Same implications as 'local'.
+
+
+ INSTRUCTION: remote
+ SYNTAX: remote|billg@microsoft.com|0
+ DESCRIPTION:
+ Names a recipient on a remote system to which the message should be
+ delivered. (FIX ... this is where we have to keep track of multiple
+ delivery attempts and transient errors)
+
+
+ INSTRUCTION: ignet
+ SYNTAX: ignet|uncnsrd|Lobby|0
+ DESCRIPTION:
+ Names a room on another Citadel node to which this message needs to be
+ spooled over the network.