mbox-save.c revision 18d06b7e210b3855420f41144ea36f332c480af8
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "hostpid.h"
#include "ostream.h"
#include "write-full.h"
#include "mbox-index.h"
#include "mbox-lock.h"
#include "mbox-storage.h"
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netdb.h>
{
else {
"Error writing to mbox file %s: %m", mbox_path);
}
return FALSE;
}
{
char ch;
"fstat() failed for mbox file %s: %m", mbox_path);
return FALSE;
}
return TRUE;
"lseek() failed for mbox file %s: %m", mbox_path);
return FALSE;
}
"read() failed for mbox file %s: %m", mbox_path);
return FALSE;
}
if (ch != '\n') {
*pos += 1;
}
return TRUE;
}
const char *mbox_path)
{
return TRUE;
}
{
if (*my_hostdomain == '\0') {
hostpid_init();
/* failed, use just the hostname */
name = my_hostname;
}
}
/* save in local timezone, no matter what it was given with */
return TRUE;
}
const char *mbox_path,
{
const char *str;
unsigned int field;
int i;
if (flags == 0)
return TRUE;
}
"\n", NULL);
}
if (flags & MAIL_CUSTOM_FLAGS_MASK) {
if (o_stream_send_str(output,
custom_flags[i]) < 0)
}
}
}
return TRUE;
}
{
const char *mbox_path;
int failed;
return FALSE;
}
/* we don't need the real flag positions, easier to keep using our own.
real_flags = flags;
return FALSE;
return FALSE;
else {
t_push();
data_stack_pool, 4096,
0, FALSE);
internal_date) ||
custom_flags) ||
/* failed, truncate file back to original size.
output stream needs to be flushed before truncating
so unref() won't write anything. */
}
t_pop();
}
/* kludgy.. for copying inside same mailbox. */
if (!ibox->delay_save_unlocking) {
return FALSE;
}
return !failed;
}