/* $Id$ */
-#define SMTP_PORT 2525
-
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
#include "msgbase.h"
#include "tools.h"
#include "internet_addressing.h"
+#include "genstamp.h"
struct citsmtp { /* Information about the current session */
char from[256];
char recipient[256];
int number_of_recipients;
+ int delivery_mode;
};
enum { /* Command states for login authentication */
smtp_password
};
+enum { /* Delivery modes */
+ smtp_deliver_local,
+ smtp_deliver_remote
+};
+
#define SMTP ((struct citsmtp *)CtdlGetUserData(SYM_SMTP))
long SYM_SMTP;
strcpy(SMTP->recipient, &argbuf[3]);
striplt(SMTP->recipient);
+ alias(SMTP->recipient);
cvt = convert_internet_address(user, node, SMTP->recipient);
switch(cvt) {
char *body;
struct CtdlMessage *msg;
int retval;
+ char nowstamp[256];
if (strlen(SMTP->from) == 0) {
cprintf("503 Need MAIL command first.\n");
}
cprintf("354 Transmit message now; terminate with '.' by itself\n");
- body = CtdlReadMessageBody(".", config.c_maxmsglen);
+
+ generate_rfc822_datestamp(nowstamp, time(NULL));
+ body = mallok(4096);
+ if (body != NULL) sprintf(body,
+ "Received: from %s\n"
+ " by %s;\n"
+ " %s\n",
+ "FIX.FIX.com",
+ config.c_fqdn,
+ nowstamp);
+
+ body = CtdlReadMessageBody(".", config.c_maxmsglen, body);
if (body == NULL) {
cprintf("550 Unable to save message text: internal error.\n");
return;
}
-
char *Dynamic_Module_Init(void)
{
SYM_SMTP = CtdlGetDynamicSymbol();
CtdlRegisterServiceHook(SMTP_PORT,
smtp_greeting,
smtp_command_loop);
+ create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0);
return "$Id$";
}
+