2 * This module is an SMTP and ESMTP implementation for the Citadel system.
3 * It is compliant with all of the following:
5 * RFC 821 - Simple Mail Transfer Protocol
6 * RFC 876 - Survey of SMTP Implementations
7 * RFC 1047 - Duplicate messages and SMTP
8 * RFC 1652 - 8 bit MIME
9 * RFC 1869 - Extended Simple Mail Transfer Protocol
10 * RFC 1870 - SMTP Service Extension for Message Size Declaration
11 * RFC 2033 - Local Mail Transfer Protocol
12 * RFC 2197 - SMTP Service Extension for Command Pipelining
13 * RFC 2476 - Message Submission
14 * RFC 2487 - SMTP Service Extension for Secure SMTP over TLS
15 * RFC 2554 - SMTP Service Extension for Authentication
16 * RFC 2821 - Simple Mail Transfer Protocol
17 * RFC 2822 - Internet Message Format
18 * RFC 2920 - SMTP Service Extension for Command Pipelining
20 * The VRFY and EXPN commands have been removed from this implementation
21 * because nobody uses these commands anymore, except for spammers.
23 * Copyright (c) 1998-2012 by the citadel.org team
25 * This program is open source software; you can redistribute it and/or modify
26 * it under the terms of the GNU General Public License version 3.
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
49 #include <sys/types.h>
52 #if TIME_WITH_SYS_TIME
53 # include <sys/time.h>
57 # include <sys/time.h>
66 #include <sys/socket.h>
67 #include <netinet/in.h>
68 #include <arpa/inet.h>
69 #include <libcitadel.h>
72 #include "citserver.h"
79 #include "internet_addressing.h"
82 #include "clientsocket.h"
83 #include "locate_host.h"
84 #include "citadel_dirs.h"
86 #include "ctdl_module.h"
88 #include "smtp_util.h"
89 #include "event_client.h"
90 #include "smtpqueue.h"
91 #include "smtp_clienthandlers.h"
93 int SMTPClientDebugEnabled = 0;
94 const unsigned short DefaultMXPort = 25;
95 void DeleteSmtpOutMsg(void *v)
98 AsyncIO *IO = &Msg->IO;
99 EVS_syslog(LOG_DEBUG, "%s Exit\n", __FUNCTION__);
101 /* these are kept in our own space and free'd below */
102 Msg->IO.ConnectMe = NULL;
104 ares_free_data(Msg->AllMX);
105 if (Msg->HostLookup.VParsedDNSReply != NULL)
106 Msg->HostLookup.DNSReplyFree(Msg->HostLookup.VParsedDNSReply);
107 FreeURL(&Msg->Relay);
108 FreeStrBuf(&Msg->msgtext);
109 FreeAsyncIOContents(&Msg->IO);
110 memset (Msg, 0, sizeof(SmtpOutMsg)); /* just to be shure... */
114 eNextState SMTP_C_Shutdown(AsyncIO *IO);
115 eNextState SMTP_C_Timeout(AsyncIO *IO);
116 eNextState SMTP_C_ConnFail(AsyncIO *IO);
117 eNextState SMTP_C_DispatchReadDone(AsyncIO *IO);
118 eNextState SMTP_C_DispatchWriteDone(AsyncIO *IO);
119 eNextState SMTP_C_DNSFail(AsyncIO *IO);
120 eNextState SMTP_C_Terminate(AsyncIO *IO);
121 eNextState SMTP_C_TerminateDB(AsyncIO *IO);
122 eReadState SMTP_C_ReadServerStatus(AsyncIO *IO);
124 eNextState mx_connect_ip(AsyncIO *IO);
125 eNextState get_one_mx_host_ip(AsyncIO *IO);
126 eNextState FinalizeMessageSendDB(AsyncIO *IO);
127 eNextState FinalizeMessageSend_DB1(AsyncIO *IO);
128 eNextState FinalizeMessageSend_DB2(AsyncIO *IO);
129 eNextState FinalizeMessageSend_DB3(AsyncIO *IO);
130 eNextState FinalizeMessageSend_DB4(AsyncIO *IO);
132 /******************************************************************************
133 * So, we're finished with sending (regardless of success or failure) *
134 * This Message might be referenced by several Queue-Items, if we're the last,*
135 * we need to free the memory and send bounce messages (on terminal failure) *
136 * else we just free our SMTP-Message struct. *
137 ******************************************************************************/
138 inline void FinalizeMessageSend_1(AsyncIO *IO)
141 SmtpOutMsg *Msg = IO->Data;
143 if (Msg->MyQEntry->Status == 2)
144 Status = "Delivery successful.";
145 else if (Msg->MyQEntry->Status == 5)
146 Status = "Delivery failed permanently; giving up.";
148 Status = "Delivery failed temporarily; will retry later.";
151 "%s Time[%fs] Recipient <%s> @ <%s> (%s) Status message: %s\n",
153 Msg->IO.Now - Msg->IO.StartIO,
157 ChrPtr(Msg->MyQEntry->StatusMessage));
160 Msg->IDestructQueItem = DecreaseQReference(Msg->MyQItem);
162 Msg->nRemain = CountActiveQueueEntries(Msg->MyQItem);
164 if (Msg->MyQEntry->Active &&
165 CheckQEntryIsBounce(Msg->MyQEntry))
167 /* are we casue for a bounce mail? */
168 Msg->MyQItem->SendBounceMail |= (1<<Msg->MyQEntry->Status);
171 if ((Msg->nRemain > 0) || Msg->IDestructQueItem)
172 Msg->QMsgData = SerializeQueueItem(Msg->MyQItem);
174 Msg->QMsgData = NULL;
176 eNextState FinalizeMessageSend(SmtpOutMsg *Msg)
178 return QueueDBOperation(&Msg->IO, FinalizeMessageSend_DB1);
181 inline void FinalizeMessageSend_DB_1(AsyncIO *IO)
183 SmtpOutMsg *Msg = IO->Data;
186 * Uncompleted delivery instructions remain, so delete the old
187 * instructions and replace with the updated ones.
189 EVS_syslog(LOG_DEBUG, "%ld", Msg->MyQItem->QueMsgID);
190 CtdlDeleteMessages(SMTP_SPOOLOUT_ROOM, &Msg->MyQItem->QueMsgID, 1, "");
192 eNextState FinalizeMessageSend_DB1(AsyncIO *IO)
194 FinalizeMessageSend_1(IO);
195 FinalizeMessageSend_DB_1(IO);
196 return NextDBOperation(IO, FinalizeMessageSend_DB2);
200 inline void FinalizeMessageSend_DB_2(AsyncIO *IO)
202 SmtpOutMsg *Msg = IO->Data;
204 if (Msg->IDestructQueItem)
205 smtpq_do_bounce(Msg->MyQItem, Msg->msgtext);
207 eNextState FinalizeMessageSend_DB2(AsyncIO *IO)
209 FinalizeMessageSend_DB_2(IO);
211 return NextDBOperation(IO, FinalizeMessageSend_DB3);
215 inline void FinalizeMessageSend_DB_3(AsyncIO *IO)
217 SmtpOutMsg *Msg = IO->Data;
219 if (Msg->nRemain > 0)
221 struct CtdlMessage *msg;
222 msg = malloc(sizeof(struct CtdlMessage));
223 memset(msg, 0, sizeof(struct CtdlMessage));
224 msg->cm_magic = CTDLMESSAGE_MAGIC;
225 msg->cm_anon_type = MES_NORMAL;
226 msg->cm_format_type = FMT_RFC822;
227 msg->cm_fields['M'] = SmashStrBuf(&Msg->QMsgData);
228 msg->cm_fields['U'] = strdup("QMSG");
229 Msg->MyQItem->QueMsgID =
230 CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM, QP_EADDR);
231 EVS_syslog(LOG_DEBUG, "%ld", Msg->MyQItem->QueMsgID);
232 CtdlFreeMessage(msg);
235 CtdlDeleteMessages(SMTP_SPOOLOUT_ROOM,
236 &Msg->MyQItem->MessageID,
239 FreeStrBuf(&Msg->QMsgData);
241 DecreaseShutdownDeliveries(Msg->MyQItem);
243 eNextState FinalizeMessageSend_DB3(AsyncIO *IO)
245 SmtpOutMsg *Msg = IO->Data;
246 FinalizeMessageSend_DB_3(IO);
247 if (!Msg->IDestructQueItem)
249 return NextDBOperation(IO, FinalizeMessageSend_DB4);
252 eNextState FinalizeMessageSend_DB4(AsyncIO *IO)
255 SmtpOutMsg *Msg = IO->Data;
257 Done = GetShutdownDeliveries(Msg->MyQItem);
259 return NextDBOperation(IO, FinalizeMessageSend_DB4);
264 eNextState FinalizeMessageSend_DB(AsyncIO *IO)
266 SmtpOutMsg *Msg = IO->Data;
268 RemoveContext(Msg->IO.CitContext);
269 if (Msg->IDestructQueItem)
270 RemoveQItem(Msg->MyQItem);
271 DeleteSmtpOutMsg(Msg);
275 eNextState FailOneAttempt(AsyncIO *IO)
277 SmtpOutMsg *Msg = IO->Data;
279 if (Msg->MyQEntry->Status == 2)
283 * possible ways here:
284 * - connection timeout
285 * - dns lookup failed
287 StopClientWatchers(IO);
289 if (Msg->pCurrRelay != NULL)
290 Msg->pCurrRelay = Msg->pCurrRelay->Next;
292 if (Msg->pCurrRelay == NULL) {
293 EVS_syslog(LOG_DEBUG, "%s Aborting\n", __FUNCTION__);
296 if (Msg->pCurrRelay->IsIP) {
297 EVS_syslog(LOG_DEBUG, "%s connecting IP\n", __FUNCTION__);
298 return mx_connect_ip(IO);
301 EVS_syslog(LOG_DEBUG,
302 "%s resolving next MX Record\n",
304 return get_one_mx_host_ip(IO);
309 void SetConnectStatus(AsyncIO *IO)
311 SmtpOutMsg *Msg = IO->Data;
317 if (IO->ConnectMe->IPv6) {
318 src = &IO->ConnectMe->Addr.sin6_addr;
321 struct sockaddr_in *addr;
323 addr = (struct sockaddr_in *)&IO->ConnectMe->Addr;
324 src = &addr->sin_addr.s_addr;
327 inet_ntop((IO->ConnectMe->IPv6)?AF_INET6:AF_INET,
332 if (Msg->mx_host == NULL)
333 Msg->mx_host = "<no MX-Record>";
336 "connecting to %s [%s]:%d ...\n",
339 Msg->IO.ConnectMe->Port);
341 Msg->MyQEntry->Status = 5;
342 StrBufPrintf(Msg->MyQEntry->StatusMessage,
343 "Timeout while connecting %s [%s]:%d ",
346 Msg->IO.ConnectMe->Port);
347 Msg->IO.NextState = eConnect;
350 /*****************************************************************************
351 * So we connect our Relay IP here. *
352 *****************************************************************************/
353 eNextState mx_connect_ip(AsyncIO *IO)
355 SmtpOutMsg *Msg = IO->Data;
357 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
359 IO->ConnectMe = Msg->pCurrRelay;
360 Msg->State = eConnectMX;
362 SetConnectStatus(IO);
364 return EvConnectSock(IO,
366 SMTP_C_ReadTimeouts[0],
370 eNextState get_one_mx_host_ip_done(AsyncIO *IO)
372 SmtpOutMsg *Msg = IO->Data;
373 struct hostent *hostent;
376 EVS_syslog(LOG_DEBUG, "%s Time[%fs]\n",
378 IO->Now - IO->DNS.Start);
380 hostent = Msg->HostLookup.VParsedDNSReply;
381 if ((Msg->HostLookup.DNSStatus == ARES_SUCCESS) &&
382 (hostent != NULL) ) {
383 memset(&Msg->pCurrRelay->Addr, 0, sizeof(struct in6_addr));
384 if (Msg->pCurrRelay->IPv6) {
385 memcpy(&Msg->pCurrRelay->Addr.sin6_addr.s6_addr,
386 &hostent->h_addr_list[0],
387 sizeof(struct in6_addr));
389 Msg->pCurrRelay->Addr.sin6_family =
391 Msg->pCurrRelay->Addr.sin6_port =
392 htons(DefaultMXPort);
395 struct sockaddr_in *addr;
397 * Bypass the ns lookup result like this:
398 * IO->Addr.sin_addr.s_addr = inet_addr("127.0.0.1");
399 * addr->sin_addr.s_addr =
400 * htonl((uint32_t)&hostent->h_addr_list[0]);
403 addr = (struct sockaddr_in*) &Msg->pCurrRelay->Addr;
405 memcpy(&addr->sin_addr.s_addr,
406 hostent->h_addr_list[0],
409 addr->sin_family = hostent->h_addrtype;
410 addr->sin_port = htons(DefaultMXPort);
412 Msg->mx_host = Msg->pCurrRelay->Host;
413 if (Msg->HostLookup.VParsedDNSReply != NULL) {
414 Msg->HostLookup.DNSReplyFree(Msg->HostLookup.VParsedDNSReply);
415 Msg->HostLookup.VParsedDNSReply = NULL;
417 return mx_connect_ip(IO);
420 if (Msg->HostLookup.VParsedDNSReply != NULL) {
421 Msg->HostLookup.DNSReplyFree(Msg->HostLookup.VParsedDNSReply);
422 Msg->HostLookup.VParsedDNSReply = NULL;
424 return FailOneAttempt(IO);
428 eNextState get_one_mx_host_ip(AsyncIO *IO)
430 SmtpOutMsg * Msg = IO->Data;
432 * here we start with the lookup of one host. it might be...
433 * - the relay host *sigh*
434 * - the direct hostname if there was no mx record
438 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
440 EVS_syslog(LOG_DEBUG,
441 "looking up %s-Record %s : %d ...\n",
442 (Msg->pCurrRelay->IPv6)? "aaaa": "a",
443 Msg->pCurrRelay->Host,
444 Msg->pCurrRelay->Port);
446 if (!QueueQuery((Msg->pCurrRelay->IPv6)? ns_t_aaaa : ns_t_a,
447 Msg->pCurrRelay->Host,
450 get_one_mx_host_ip_done))
452 Msg->MyQEntry->Status = 5;
453 StrBufPrintf(Msg->MyQEntry->StatusMessage,
454 "No MX hosts found for <%s>", Msg->node);
455 Msg->IO.NextState = eTerminateConnection;
456 return IO->NextState;
458 IO->NextState = eReadDNSReply;
459 return IO->NextState;
463 /*****************************************************************************
464 * here we try to find out about the MX records for our recipients. *
465 *****************************************************************************/
466 eNextState smtp_resolve_mx_record_done(AsyncIO *IO)
468 SmtpOutMsg * Msg = IO->Data;
473 EVS_syslog(LOG_DEBUG, "%s Time[%fs]\n",
475 IO->Now - IO->DNS.Start);
478 while ((pp != NULL) && (*pp != NULL) && ((*pp)->Next != NULL))
481 if ((IO->DNS.Query->DNSStatus == ARES_SUCCESS) &&
482 (IO->DNS.Query->VParsedDNSReply != NULL))
483 { /* ok, we found mx records. */
487 = IO->DNS.Query->VParsedDNSReply;
488 while (Msg->CurrMX) {
490 for (i = 0; i < 2; i++) {
493 p = (ParsedURL*) malloc(sizeof(ParsedURL));
494 memset(p, 0, sizeof(ParsedURL));
495 p->Priority = Msg->CurrMX->priority;
497 p->Port = DefaultMXPort;
499 p->Host = Msg->CurrMX->host;
503 ParsedURL *ppp = *pp;
505 while ((ppp->Next != NULL) &&
506 (ppp->Next->Priority <= p->Priority))
509 (ppp->Priority > p->Priority)) {
519 Msg->CurrMX = Msg->CurrMX->next;
521 Msg->CXFlags = Msg->CXFlags & F_HAVE_MX;
523 else { /* else fall back to the plain hostname */
525 for (i = 0; i < 2; i++) {
528 p = (ParsedURL*) malloc(sizeof(ParsedURL));
529 memset(p, 0, sizeof(ParsedURL));
531 p->Port = DefaultMXPort;
538 Msg->CXFlags = Msg->CXFlags & F_DIRECT;
540 if (Msg->MyQItem->FallBackHost != NULL)
542 Msg->MyQItem->FallBackHost->Next = *pp;
543 *pp = Msg->MyQItem->FallBackHost;
545 Msg->pCurrRelay = Msg->Relay;
546 return get_one_mx_host_ip(IO);
549 eNextState resolve_mx_records(AsyncIO *IO)
551 SmtpOutMsg * Msg = IO->Data;
553 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
554 /* start resolving MX records here. */
555 if (!QueueQuery(ns_t_mx,
559 smtp_resolve_mx_record_done))
561 Msg->MyQEntry->Status = 5;
562 StrBufPrintf(Msg->MyQEntry->StatusMessage,
563 "No MX hosts found for <%s>", Msg->node);
564 return IO->NextState;
566 Msg->IO.NextState = eReadDNSReply;
567 return IO->NextState;
572 /******************************************************************************
573 * so, we're going to start a SMTP delivery. lets get it on. *
574 ******************************************************************************/
576 SmtpOutMsg *new_smtp_outmsg(OneQueItem *MyQItem,
577 MailQEntry *MyQEntry,
582 Msg = (SmtpOutMsg *) malloc(sizeof(SmtpOutMsg));
583 memset(Msg, 0, sizeof(SmtpOutMsg));
586 Msg->MyQEntry = MyQEntry;
587 Msg->MyQItem = MyQItem;
588 Msg->pCurrRelay = MyQItem->URL;
590 InitIOStruct(&Msg->IO,
593 SMTP_C_ReadServerStatus,
595 SMTP_C_DispatchWriteDone,
596 SMTP_C_DispatchReadDone,
603 Msg->IO.ErrMsg = Msg->MyQEntry->StatusMessage;
608 void smtp_try_one_queue_entry(OneQueItem *MyQItem,
609 MailQEntry *MyQEntry,
611 /*KeepMsgText allows us to use MsgText as ours.*/
617 SMTPC_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
619 Msg = new_smtp_outmsg(MyQItem, MyQEntry, MsgCount);
620 if (KeepMsgText) Msg->msgtext = MsgText;
621 else Msg->msgtext = NewStrBufDup(MsgText);
623 if (smtp_resolve_recipients(Msg)) {
626 ((CitContext *)Msg->IO.CitContext)->cs_host,
628 sizeof(((CitContext *)
629 Msg->IO.CitContext)->cs_host));
631 SMTPC_syslog(LOG_DEBUG, "Starting: [%ld] <%s> CC <%d> \n",
632 Msg->MyQItem->MessageID,
633 ChrPtr(Msg->MyQEntry->Recipient),
634 ((CitContext*)Msg->IO.CitContext)->cs_pid);
635 if (Msg->pCurrRelay == NULL)
636 QueueEventContext(&Msg->IO,
638 else { /* oh... via relay host */
639 if (Msg->pCurrRelay->IsIP) {
640 QueueEventContext(&Msg->IO,
644 /* uneducated admin has chosen to
645 add DNS to the equation... */
646 QueueEventContext(&Msg->IO,
652 /* No recipients? well fail then. */
654 (Msg->MyQEntry == NULL)) {
655 Msg->MyQEntry->Status = 5;
656 StrBufPlain(Msg->MyQEntry->StatusMessage,
657 HKEY("Invalid Recipient!"));
659 FinalizeMessageSend_1(&Msg->IO);
660 FinalizeMessageSend_DB_1(&Msg->IO);
661 FinalizeMessageSend_DB_2(&Msg->IO);
662 FinalizeMessageSend_DB_3(&Msg->IO);
663 FinalizeMessageSend_DB(&Msg->IO);
672 /*****************************************************************************/
673 /* SMTP CLIENT DISPATCHER */
674 /*****************************************************************************/
676 void SMTPSetTimeout(eNextState NextTCPState, SmtpOutMsg *Msg)
678 double Timeout = 0.0;
679 AsyncIO *IO = &Msg->IO;
681 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
683 switch (NextTCPState) {
687 Timeout = SMTP_C_SendTimeouts[Msg->State];
688 if (Msg->State == eDATABody) {
689 /* if we're sending a huge message,
692 Timeout += StrLength(Msg->msgtext) / 512;
696 Timeout = SMTP_C_ReadTimeouts[Msg->State];
697 if (Msg->State == eDATATerminateBody) {
699 * some mailservers take a nap before accepting
700 * the message content inspection and such.
702 Timeout += StrLength(Msg->msgtext) / 512;
712 case eTerminateConnection:
716 SetNextTimeout(&Msg->IO, Timeout);
718 eNextState SMTP_C_DispatchReadDone(AsyncIO *IO)
720 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
721 SmtpOutMsg *Msg = IO->Data;
724 rc = ReadHandlers[Msg->State](Msg);
728 SMTPSetTimeout(rc, Msg);
732 eNextState SMTP_C_DispatchWriteDone(AsyncIO *IO)
734 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
735 SmtpOutMsg *Msg = IO->Data;
738 rc = SendHandlers[Msg->State](Msg);
739 SMTPSetTimeout(rc, Msg);
744 /*****************************************************************************/
745 /* SMTP CLIENT ERROR CATCHERS */
746 /*****************************************************************************/
747 eNextState SMTP_C_Terminate(AsyncIO *IO)
749 SmtpOutMsg *Msg = IO->Data;
751 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
752 return FinalizeMessageSend(Msg);
754 eNextState SMTP_C_TerminateDB(AsyncIO *IO)
756 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
757 return FinalizeMessageSend_DB(IO);
759 eNextState SMTP_C_Timeout(AsyncIO *IO)
761 SmtpOutMsg *Msg = IO->Data;
763 Msg->MyQEntry->Status = 4;
764 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
765 StrBufPlain(IO->ErrMsg, CKEY(ReadErrors[Msg->State]));
766 if (Msg->State > eRCPT)
769 return FailOneAttempt(IO);
771 eNextState SMTP_C_ConnFail(AsyncIO *IO)
773 SmtpOutMsg *Msg = IO->Data;
775 Msg->MyQEntry->Status = 4;
776 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
777 StrBufPlain(IO->ErrMsg, CKEY(ReadErrors[Msg->State]));
778 return FailOneAttempt(IO);
780 eNextState SMTP_C_DNSFail(AsyncIO *IO)
782 SmtpOutMsg *Msg = IO->Data;
783 Msg->MyQEntry->Status = 4;
784 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
785 return FailOneAttempt(IO);
787 eNextState SMTP_C_Shutdown(AsyncIO *IO)
789 EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
790 SmtpOutMsg *Msg = IO->Data;
792 Msg->MyQEntry->Status = 3;
793 StrBufPlain(Msg->MyQEntry->StatusMessage,
794 HKEY("server shutdown during message submit."));
795 return FinalizeMessageSend(Msg);
800 * @brief lineread Handler;
801 * understands when to read more SMTP lines, and when this is a one-lined reply.
803 eReadState SMTP_C_ReadServerStatus(AsyncIO *IO)
805 eReadState Finished = eBufferNotEmpty;
807 while (Finished == eBufferNotEmpty) {
808 Finished = StrBufChunkSipLine(IO->IOBuf, &IO->RecvBuf);
811 case eMustReadMore: /// read new from socket...
814 case eBufferNotEmpty: /* shouldn't happen... */
815 case eReadSuccess: /// done for now...
816 if (StrLength(IO->IOBuf) < 4)
818 if (ChrPtr(IO->IOBuf)[3] == '-')
819 Finished = eBufferNotEmpty;
823 case eReadFail: /// WHUT?
831 void LogDebugEnableSMTPClient(const int n)
833 SMTPClientDebugEnabled = n;
836 CTDL_MODULE_INIT(smtp_eventclient)
839 CtdlRegisterDebugFlagHook(HKEY("smtpeventclient"), LogDebugEnableSMTPClient, &SMTPClientDebugEnabled);
840 return "smtpeventclient";