mbox-append.c revision b646fdb90f75ab80ea7feca42fa2e1f8e788b004
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "ioloop.h"
#include "ibuffer.h"
#include "hex-binary.h"
#include "md5.h"
#include "mbox-index.h"
#include "mail-index-util.h"
{
return NULL;
return rec;
}
{
const unsigned char *data;
unsigned char md5_digest[16];
int failed;
/* get the From-line */
pos = 0;
break;
}
break;
}
/* a) no \n found, or line too long
b) not a From-line */
"From-line not found where expected",
return FALSE;
}
/* parse the From-line */
if (internal_date <= 0)
/* now, find the end of header. also stops at "\nFrom " if it's
found (broken messages) */
/* add message to index */
return FALSE;
/* location = offset to beginning of headers in message */
&abs_start_offset, sizeof(uoff_t));
/* parse the header and cache wanted fields. get the message flags
from Status and X-Status fields. temporarily limit the buffer size
so the message body is parsed properly */
/* save MD5 */
md5_digest, sizeof(md5_digest));
else {
/* save message flags */
}
return !failed;
}
{
/* no new data */
return TRUE;
}
return FALSE;
for (;;) {
/* we're at the [\r]\n before the From-line,
skip it */
if (!mbox_skip_crlf(inbuf)) {
"Error indexing mbox file %s: "
"LF not found where expected",
return FALSE;
}
}
break;
return FALSE;
}
return TRUE;
}