- StrBuf *QMessage;
- HashPos *It;
- const char *Key;
- long len;
- void *vQE;
-
- QMessage = NewStrBufPlain(NULL, SIZ);
- StrBufPrintf(QMessage, "Content-type: %s\n", SPOOLMIME);
-
-// "attempted|%ld\n" "retry|%ld\n",, (long)time(NULL), (long)retry );
- StrBufAppendBufPlain(QMessage, HKEY("\nmsgid|"), 0);
- StrBufAppendPrintf(QMessage, "%ld", MyQItem->MessageID);
-
- if (StrLength(MyQItem->BounceTo) > 0) {
- StrBufAppendBufPlain(QMessage, HKEY("\nbounceto|"), 0);
- StrBufAppendBuf(QMessage, MyQItem->BounceTo, 0);
- }
-
- if (StrLength(MyQItem->EnvelopeFrom) > 0) {
- StrBufAppendBufPlain(QMessage, HKEY("\nenvelope_from|"), 0);
- StrBufAppendBuf(QMessage, MyQItem->EnvelopeFrom, 0);
- }
-
- It = GetNewHashPos(MyQItem->MailQEntries, 0);
- while (GetNextHashPos(MyQItem->MailQEntries, It, &len, &Key, &vQE))
- {
- MailQEntry *ThisItem = vQE;
- int i;
-
- if (!ThisItem->Active)
- continue; /* skip already sent ones from the spoolfile. */
-
- for (i=0; i < ThisItem->nAttempts; i++) {
- StrBufAppendBufPlain(QMessage, HKEY("\nretry|"), 0);
- StrBufAppendPrintf(QMessage, "%ld",
- ThisItem->Attempts[i].retry);
-
- StrBufAppendBufPlain(QMessage, HKEY("\nattempted|"), 0);
- StrBufAppendPrintf(QMessage, "%ld",
- ThisItem->Attempts[i].when);
- }
- StrBufAppendBufPlain(QMessage, HKEY("\nremote|"), 0);
- StrBufAppendBuf(QMessage, ThisItem->Recipient, 0);
- StrBufAppendBufPlain(QMessage, HKEY("|"), 0);
- StrBufAppendPrintf(QMessage, "%d", ThisItem->Status);
- StrBufAppendBufPlain(QMessage, HKEY("|"), 0);
- StrBufAppendBuf(QMessage, ThisItem->StatusMessage, 0);
- }
- DeleteHashPos(&It);
- StrBufAppendBufPlain(QMessage, HKEY("\n"), 0);
- return QMessage;