Msg->IDestructQueItem = DecreaseQReference(Msg->MyQItem);
- Msg->nRemain = CountActiveQueueEntries(Msg->MyQItem);
+ Msg->nRemain = CountActiveQueueEntries(Msg->MyQItem, 0);
if (Msg->MyQEntry->Active &&
+ !Msg->MyQEntry->StillActive &&
CheckQEntryIsBounce(Msg->MyQEntry))
{
/* are we casue for a bounce mail? */
Msg->MyQItem->QueMsgID = -1;
if (Msg->IDestructQueItem)
- smtpq_do_bounce(Msg->MyQItem, Msg->msgtext);
+ smtpq_do_bounce(Msg->MyQItem, Msg->msgtext, Msg->pCurrRelay);
if (Msg->nRemain > 0)
{
if (Msg->pCurrRelay != NULL)
Msg->pCurrRelay = Msg->pCurrRelay->Next;
+ if ((Msg->pCurrRelay != NULL) &&
+ !Msg->pCurrRelay->IsRelay &&
+ Msg->MyQItem->HaveRelay)
+ {
+ EVS_syslog(LOG_DEBUG, "%s Aborting; last relay failed.\n", __FUNCTION__);
+ return eAbort;
+ }
if (Msg->pCurrRelay == NULL) {
EVS_syslog(LOG_DEBUG, "%s Aborting\n", __FUNCTION__);
if (KeepMsgText) Msg->msgtext = MsgText;
else Msg->msgtext = NewStrBufDup(MsgText);
- if (smtp_resolve_recipients(Msg)) {
-
+ if (((!MyQItem->HaveRelay ||
+ (MyQItem->URL != NULL)) &&
+ smtp_resolve_recipients(Msg)))
+ {
safestrncpy(
((CitContext *)Msg->IO.CitContext)->cs_host,
Msg->node,
/* No recipients? well fail then. */
if (Msg->MyQEntry != NULL) {
Msg->MyQEntry->Status = 5;
- StrBufPlain(Msg->MyQEntry->StatusMessage,
- HKEY("Invalid Recipient!"));
+ if (StrLength(Msg->MyQEntry->StatusMessage) == 0)
+ StrBufPlain(Msg->MyQEntry->StatusMessage,
+ HKEY("Invalid Recipient!"));
}
FinalizeMessageSend_DB(&Msg->IO);
DeleteSmtpOutMsg(&Msg->IO);
EVS_syslog(LOG_DEBUG, "%s\n", __FUNCTION__);
SmtpOutMsg *Msg = IO->Data;
+ switch (IO->NextState) {
+ case eSendDNSQuery:
+ case eReadDNSReply:
+
+ /* todo: abort c-ares */
+ case eConnect:
+ case eSendReply:
+ case eSendMore:
+ case eSendFile:
+ case eReadMessage:
+ case eReadMore:
+ case eReadPayload:
+ case eReadFile:
+ StopClientWatchers(IO, 1);
+ break;
+ case eDBQuery:
+
+ break;
+ case eTerminateConnection:
+ case eAbort:
+ break;
+ }
Msg->MyQEntry->Status = 3;
StrBufPlain(Msg->MyQEntry->StatusMessage,
HKEY("server shutdown during message submit."));