mbox-file.c revision be5773cb4d6edae8a5d9f300c3c7375cdd33826e
/* Copyright (c) 2002-2017 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "mbox-storage.h"
#include "mbox-sync-private.h"
#include "mbox-file.h"
#include "istream-raw-mbox.h"
#include <utime.h>
#define MBOX_READ_BLOCK_SIZE IO_BLOCK_SIZE
{
int fd;
/* read-only mbox stream */
return 0;
}
}
if (fd == -1) {
return -1;
}
i_close_fd(&fd);
return -1;
}
return 0;
}
{
}
}
{
return 0;
/* read-only mbox stream */
} else {
if (mbox_file_open(mbox) < 0)
return -1;
}
if (mbox->mbox_writeonly) {
i_stream_create_from_data("", 0);
} else {
}
}
return 0;
}
{
/* we've seen recent messages which we want to keep recent.
keep file's atime lower than mtime so \Marked status
gets shown while listing */
return;
}
/* EPERM can happen with shared mailboxes */
}
}
}
{
/* if we read anything, fix the atime if needed */
/* read-only mbox stream */
} else {
}
}
}
struct mail_index_view *view,
{
const void *data;
bool deleted;
if (deleted)
return -1;
"Cached message offset lost for seq %u in mbox file %s",
return 0;
}
return 1;
}
{
int ret;
if (ret <= 0) {
return ret;
}
if (offset == 0) {
"Mailbox isn't a valid mbox file");
return -1;
}
return 0;
"Cached message offset %s is invalid for mbox file %s",
return 0;
}
/* we're dirty - make sure this is the correct mail */
return 0;
}
return 1;
}