- /* Local mail - put a copy in the recipient's mailbox. */
- /* FIX here's where we have to handle expiry, stuffed boxes, etc. */
- if (mailtype == M_LOCAL) {
- if (lgetuser(&tempUS,rec)==0) {
-
- cdbmb = cdb_fetch(CDB_MAILBOXES,
- &tempUS.usernum, sizeof(long));
- if (cdbmb != NULL) {
- memcpy(dmailbox, cdbmb->ptr, cdbmb->len);
- dnum_mails = cdbmb->len / sizeof(long);
- cdb_free(cdbmb);
- }
- else {
- dmailbox = NULL;
- dnum_mails = 0;
- }
-
- ++dnum_mails;
- if (dmailbox == NULL) {
- dmailbox = malloc(sizeof(long) * dnum_mails);
- }
- else {
- dmailbox = realloc(dmailbox,
- sizeof(long) * dnum_mails);
- }
-
- dmailbox[dnum_mails - 1] = newmsgid;
- cdb_store(CDB_MAILBOXES, &tempUS.usernum, sizeof(long),
- dmailbox, (dnum_mails * sizeof(long)) );
- lputuser(&tempUS,rec);
- free(dmailbox);
- }
- }
-