Commit 11bb126a 11bb126aa6a6d0a3ffd448f5b930e0e04f238d19 by Sergey Poznyakoff

(mh_append_message): Scan the mailbox if it has not been scanned yet.

1 parent 70760383
......@@ -604,6 +604,14 @@ mh_append_message (mailbox_t mailbox, message_t msg)
if (!mhm)
return ENOMEM;
/* If we did not start a scanning yet do it now. */
if (mhd->msg_count == 0)
{
status = mh_scan0 (mailbox, 1, NULL);
if (status != 0)
return status;
}
mhm->mhd = mhd;
mhm->seq_number = _mh_next_seq (mhd);
mhm->message = msg;
......@@ -1016,7 +1024,7 @@ mh_scan0 (mailbox_t mailbox, size_t msgno, size_t *pcount)
if (mhd->uidvalidity == 0)
{
mhd->uidvalidity = (unsigned long)time (NULL);
//FIXME mhd->uidnext = mhd->msg_count + 1;
/* FIXME mhd->uidnext = mhd->msg_count + 1;*/
/* Tell that we have been modified for expunging. */
if (mhd->msg_head)
mhd->msg_head->attr_flags |= MU_ATTRIBUTE_MODIFIED;
......