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)
{