zlib-plugin.c revision 8b2bf21c1f902bfd81b528dfea8102c9a7604d16
/* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "istream-zlib.h"
#include "home-expand.h"
#include "istream.h"
#include "maildir/maildir-storage.h"
#include "maildir/maildir-uidlist.h"
#include "index-mail.h"
#include "zlib-plugin.h"
#include <fcntl.h>
#define ZLIB_CONTEXT(obj) \
#define ZLIB_MAIL_CONTEXT(obj) \
const char *zlib_plugin_version = PACKAGE_VERSION;
static void (*zlib_next_hook_mail_storage_created)
(struct mail_storage *storage);
{
const unsigned char *zheader;
/* Peek in to the mail and see if it looks like it's compressed
(it has the correct 2 byte zlib header). This also means that users
can try to exploit security holes in zlib by APPENDing a specially
crafted mail. So let's hope zlib is free of holes. */
return 0;
i_stream_seek(mail, 0);
}
struct message_size *hdr_size,
struct message_size *body_size,
{
int fd;
stream_r);
}
return -1;
if (fd == -1)
i_error("zlib plugin: dup() failed: %m");
if (fd == -1)
return -1;
}
}
static struct mail *
struct mailbox_header_lookup_ctx *wanted_headers)
{
union mail_module_context *zmail;
struct mail_private *mail;
return _mail;
}
{
union mailbox_module_context *zbox;
}
static struct mailbox *
{
/* Looks like a .gz mbox file */
const char *path;
bool is_file;
/* it's a single file mailbox. we can handle this. */
int fd;
if (fd != -1)
}
}
if (zlib_input != NULL)
return box;
}
{
union mail_storage_module_context *qstorage;
}
void zlib_plugin_init(void)
{
}
void zlib_plugin_deinit(void)
{
}