******************************************************************************/
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 Recipient <%s> @ <%s> (%s) Statusmessage: %s\n",
+ Status,
+ Msg->user,
+ Msg->node,
+ Msg->name,
+ ChrPtr(Msg->MyQEntry->StatusMessage));
+
+
Msg->IDestructQueItem = DecreaseQReference(Msg->MyQItem);
Msg->nRemain = CountActiveQueueEntries(Msg->MyQItem);
eNextState FinalizeMessageSend_DB4(AsyncIO *IO)
{
- int n;
+ int Done;
SmtpOutMsg *Msg = IO->Data;
- n = GetShutdownDeliveries(Msg->MyQItem);
- if (n > 0)
+ Done = GetShutdownDeliveries(Msg->MyQItem);
+ if (!Done)
return NextDBOperation(IO, FinalizeMessageSend_DB4);
else
return eAbort;
addr->sin_port = htons(DefaultMXPort);
}
Msg->mx_host = Msg->pCurrRelay->Host;
+ if (Msg->HostLookup.VParsedDNSReply != NULL) {
+ Msg->HostLookup.DNSReplyFree(Msg->HostLookup.VParsedDNSReply);
+ Msg->HostLookup.VParsedDNSReply = NULL;
+ }
return mx_connect_ip(IO);
}
- else
+ else {
+ if (Msg->HostLookup.VParsedDNSReply != NULL) {
+ Msg->HostLookup.DNSReplyFree(Msg->HostLookup.VParsedDNSReply);
+ Msg->HostLookup.VParsedDNSReply = NULL;
+ }
return FailOneAttempt(IO);
+ }
}
eNextState get_one_mx_host_ip(AsyncIO *IO)
* - one of the mx'es
*/
- InitC_ares_dns(IO);
-
EVS_syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
EVS_syslog(LOG_DEBUG,