X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fsmtp%2Fserv_smtp.c;h=a698065941b5b541ea0ee1a2861cf132c7284bd7;hb=f096b14739c2edfe2b6a0f29c077be80991ce2c1;hp=eeace012e618b2837f1c0097548f87bf43bcfea0;hpb=7f9d699a7f73ac27bcbde2075a8758744036fb98;p=citadel.git diff --git a/citadel/modules/smtp/serv_smtp.c b/citadel/modules/smtp/serv_smtp.c index eeace012e..a69806594 100644 --- a/citadel/modules/smtp/serv_smtp.c +++ b/citadel/modules/smtp/serv_smtp.c @@ -20,7 +20,7 @@ * The VRFY and EXPN commands have been removed from this implementation * because nobody uses these commands anymore, except for spammers. * - * Copyright (c) 1998-2020 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. @@ -42,18 +42,7 @@ #include #include #include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - +#include #include #include #include @@ -129,11 +118,6 @@ void registerSmtpCMD(const char *First, long FLen, } -void smtp_cleanup(void) -{ - DeleteHash(&SMTPCmds); -} - /* * Here's where our SMTP session begins its happy day. */ @@ -709,7 +693,7 @@ void smtp_rcpt(long offset, long flags) { struct CitContext *CCC = CC; char message_to_spammer[SIZ]; - recptypes *valid = NULL; + struct recptypes *valid = NULL; citsmtp *sSMTP = SMTP; if (StrLength(sSMTP->from) == 0) { @@ -808,7 +792,7 @@ void smtp_data(long offset, long flags) struct CtdlMessage *msg = NULL; long msgnum = (-1L); char nowstamp[SIZ]; - recptypes *valid; + struct recptypes *valid; int scan_errors; int i; citsmtp *sSMTP = SMTP; @@ -907,10 +891,12 @@ void smtp_data(long offset, long flags) 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)); + } } } @@ -948,7 +934,7 @@ void smtp_data(long offset, long flags) } 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"); } @@ -1190,7 +1176,6 @@ CTDL_MODULE_INIT(smtp) NULL, CitadelServiceSMTP_LMTP_UNF); - CtdlRegisterCleanupHook(smtp_cleanup); CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP, PRIO_STOP + 250); }