mbox-expunge.c revision 20a03ce664138ba52e2b533eea79d94e3e1030cc
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "iobuffer.h"
#include "mbox-index.h"
#include "mbox-storage.h"
#include "mbox-lock.h"
#include <fcntl.h>
#include <unistd.h>
{
unsigned int uid;
unsigned char *data;
int expunges;
if (seq == 1)
end_offset = 0;
else {
/* we need to find offset to beginning of From-line.
not the fastest way maybe, but easiest.. */
return FALSE;
/* get back to the deleted record */
}
return FALSE;
/* save UID before deletion */
return FALSE;
if (expunge_func != NULL)
seq--;
if (!expunges) {
/* first expunged record, seek to position
where we want to begin writing */
return FALSE;
}
} else if (expunges) {
/* seek to wanted input position, and copy
this messages */
/* we're writing to beginning of mbox, so we
don't want the [\r]\n there */
&size, 1);
}
copy_size) < 0)
return FALSE;
}
seq++;
}
/* copy the rest as well, should be only \n but someone might
as well just appended more data.. but if we've deleted all mail,
don't write the only \n there. */
return TRUE;
else
}
{
unsigned int seq;
int failed;
return FALSE;
/* no deleted messages */
return TRUE;
}
return FALSE;
return FALSE;
}
/* we moved some of the data. move the rest as well so there
won't be invalid holes in mbox file */
}
"for mbox file %s: %m",
}
return !failed;
}