* The VRFY and EXPN commands have been removed from this implementation
* because nobody uses these commands anymore, except for spammers.
*
- * Copyright (c) 1998-2018 by the citadel.org team
+ * Copyright (c) 1998-2021 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
#include <errno.h>
#include <sys/types.h>
#include <syslog.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
+#include <time.h>
#include <sys/wait.h>
#include <ctype.h>
#include <string.h>
}
-void smtp_cleanup(void)
-{
- DeleteHash(&SMTPCmds);
-}
-
/*
* Here's where our SMTP session begins its happy day.
*/
return; // already got it
}
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) {
return;
}
{
struct CitContext *CCC = CC;
char message_to_spammer[SIZ];
- recptypes *valid = NULL;
+ struct recptypes *valid = NULL;
citsmtp *sSMTP = SMTP;
if (StrLength(sSMTP->from) == 0) {
struct CtdlMessage *msg = NULL;
long msgnum = (-1L);
char nowstamp[SIZ];
- recptypes *valid;
+ struct recptypes *valid;
int scan_errors;
int i;
citsmtp *sSMTP = SMTP;
return;
}
- CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
CM_SetField(msg, eOriginalRoom, HKEY(MAILROOM));
if (sSMTP->preferred_sender_name != NULL)
CM_SetField(msg, eAuthor, SKEY(sSMTP->preferred_sender_name));
CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
if (!validemail) {
- if (sSMTP->preferred_sender_email != NULL)
+ if (sSMTP->preferred_sender_email != NULL) {
CM_SetField(msg, erFc822Addr, SKEY(sSMTP->preferred_sender_email));
- else
+ }
+ else {
CM_SetField(msg, erFc822Addr, CCC->cs_inet_email, strlen(CCC->cs_inet_email));
+ }
}
}
}
else { /* Ok, we'll accept this message. */
- msgnum = CtdlSubmitMsg(msg, valid, "", 0);
+ msgnum = CtdlSubmitMsg(msg, valid, "");
if (msgnum > 0L) {
StrBufPrintf(sSMTP->OneRcpt, "250 Message accepted.\r\n");
}
NULL,
CitadelServiceSMTP_LMTP_UNF);
- CtdlRegisterCleanupHook(smtp_cleanup);
CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP, PRIO_STOP + 250);
}