#include "smtpqueue.h"
#include "smtp_clienthandlers.h"
+int SMTPClientDebugEnabled = 0;
const unsigned short DefaultMXPort = 25;
void DeleteSmtpOutMsg(void *v)
{
******************************************************************************/
inline void FinalizeMessageSend_1(AsyncIO *IO)
{
+ const char *Status;
SmtpOutMsg *Msg = IO->Data;
+
+ if (Msg->MyQEntry->Status == 2)
+ Status = "Delivery Successfull.";
+ else if (Msg->MyQEntry->Status == 5)
+ Status = "Delivery failed permanently; giving up.";
+ else
+ Status = "Delivery failed temporarily; will retry later.";
+
+ EVS_syslog(LOG_INFO,
+ "SMTP: %s Time[%fs] Recipient <%s> @ <%s> (%s) Statusmessage: %s\n",
+ Status,
+ Msg->IO.Now - Msg->IO.StartIO,
+ Msg->user,
+ Msg->node,
+ Msg->name,
+ ChrPtr(Msg->MyQEntry->StatusMessage));
+
+
Msg->IDestructQueItem = DecreaseQReference(Msg->MyQItem);
Msg->nRemain = CountActiveQueueEntries(Msg->MyQItem);
struct hostent *hostent;
QueryCbDone(IO);
+ EVS_syslog(LOG_DEBUG, "SMTP: %s Time[%fs]\n",
+ __FUNCTION__,
+ IO->Now - IO->DNS.Start);
hostent = Msg->HostLookup.VParsedDNSReply;
if ((Msg->HostLookup.DNSStatus == ARES_SUCCESS) &&
* - one of the mx'es
*/
- InitC_ares_dns(IO);
-
EVS_syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
EVS_syslog(LOG_DEBUG,
QueryCbDone(IO);
- EVS_syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
+ EVS_syslog(LOG_DEBUG, "SMTP: %s Time[%fs]\n",
+ __FUNCTION__,
+ IO->Now - IO->DNS.Start);
pp = &Msg->Relay;
while ((pp != NULL) && (*pp != NULL) && ((*pp)->Next != NULL))
return Finished;
}
+void LogDebugEnableSMTPClient(void)
+{
+ SMTPClientDebugEnabled = 1;
+}
+
CTDL_MODULE_INIT(smtp_eventclient)
{
+ if (!threading)
+ CtdlRegisterDebugFlagHook(HKEY("smtpeventclient"), LogDebugEnableSMTPClient);
return "smtpeventclient";
}