X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fsmtp%2Fserv_smtpqueue.c;h=00b60f8fa85281f6fca198c92cb7fcc38e3ecb2e;hb=ded2dfcfba9d0b30ff8f31086d03833d9bd75457;hp=e9053981e1e28053bb94240d402f0b0d94074e6d;hpb=df417b479cb81f3bc0c042dd6568eca5aa1e684f;p=citadel.git diff --git a/citadel/modules/smtp/serv_smtpqueue.c b/citadel/modules/smtp/serv_smtpqueue.c index e9053981e..00b60f8fa 100644 --- a/citadel/modules/smtp/serv_smtpqueue.c +++ b/citadel/modules/smtp/serv_smtpqueue.c @@ -196,6 +196,29 @@ void HFreeQueItem(void *Item) * - 3/4 (transient errors * were experienced and it's time to try again) */ +int CheckQEntryActive(MailQEntry *ThisItem) +{ + if ((ThisItem->Status == 0) || + (ThisItem->Status == 3) || + (ThisItem->Status == 4)) + { + return 1; + } + else + return 0; +} +int CheckQEntryIsBounce(MailQEntry *ThisItem) +{ + if ((ThisItem->Status == 3) || + (ThisItem->Status == 4) || + (ThisItem->Status == 5)) + { + return 1; + } + else + return 0; +} + int CountActiveQueueEntries(OneQueItem *MyQItem) { HashPos *It; @@ -209,9 +232,8 @@ int CountActiveQueueEntries(OneQueItem *MyQItem) while (GetNextHashPos(MyQItem->MailQEntries, It, &len, &Key, &vQE)) { MailQEntry *ThisItem = vQE; - if ((ThisItem->Status == 0) || - (ThisItem->Status == 3) || - (ThisItem->Status == 4)) + + if (CheckQEntryActive(ThisItem)) { ActiveDeliveries++; ThisItem->Active = 1; @@ -326,11 +348,6 @@ StrBuf *SerializeQueueItem(OneQueItem *MyQItem) { MailQEntry *ThisItem = vQE; - if (!ThisItem->Active) - { - /* skip already sent ones from the spoolfile. */ - continue; - } StrBufAppendBufPlain(QMessage, HKEY("\nremote|"), 0); StrBufAppendBuf(QMessage, ThisItem->Recipient, 0); StrBufAppendBufPlain(QMessage, HKEY("|"), 0); @@ -478,6 +495,9 @@ void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt) syslog(LOG_DEBUG, "smtp_do_bounce() called\n"); + if (!MyQItem->SendBounceMail) + return; + if ( (ev_time() - MyQItem->Submitted) > SMTP_GIVE_UP ) { give_up = 1;/// TODO: replace time by libevq timer get }