fts-parser-script.c revision 73caa98b591756eacaa73632dcb19bb4424df6e5
/* Copyright (c) 2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "network.h"
#include "istream.h"
#include "write-full.h"
#include "module-context.h"
#include "rfc822-parser.h"
#include "rfc2231-parser.h"
#include "message-parser.h"
#include "mail-user.h"
#include "fts-parser.h"
#define SCRIPT_USER_CONTEXT(obj) \
#define SCRIPT_HANDSHAKE "VERSION\tscript\t3\t0\nnoreply\n"
struct content {
const char *content_type;
const char *const *extensions;
};
struct fts_parser_script_user {
};
struct script_fts_parser {
struct fts_parser parser;
int fd;
char *path;
unsigned char outbuf[IO_BLOCK_SIZE];
bool failed;
bool shutdown;
};
{
const char *path;
int fd;
return -1;
if (*path != '/')
if (fd == -1)
else
return fd;
}
{
char **args;
int fd;
if (fd == -1)
return -1;
return -1;
}
/* <content-type> <extension> [<extension> ...] */
break;
}
continue;
}
}
if (!eof_seen)
i_error("parser script didn't send empty EOF line");
return 0;
}
const char **content_type,
const char *extension)
{
}
if (script_contents_read(user) < 0)
return FALSE;
}
return FALSE;
return TRUE;
}
}
} else {
return TRUE;
}
}
return FALSE;
}
static void parse_content_disposition(const char *content_disposition,
const char **extension_r)
{
struct rfc822_parser_context parser;
const char *const *results;
*extension_r = NULL;
if (content_disposition == NULL)
return;
(void)rfc822_skip_lwsp(&parser);
/* type; param; param; .. */
return;
break;
}
}
}
static struct fts_parser *
const char *content_type,
const char *content_disposition)
{
struct script_fts_parser *parser;
int fd;
return NULL;
if (fd == -1)
return NULL;
return NULL;
}
}
struct message_block *block)
{
/* first we'll send everything to the script */
}
} else {
}
/* read the result from the script */
if (ret < 0)
else {
}
}
}
{
}
struct fts_parser_vfuncs fts_parser_script = {
};