/* Copyright (c) 2011-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "net.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"
struct content {
const char *content_type;
const char *const *extensions;
};
struct fts_parser_script_user {
};
struct script_fts_parser {
int fd;
char *path;
bool failed;
bool shutdown;
};
{
const char *path;
int fd;
return -1;
if (*path != '/')
if (fd == -1)
else
return fd;
}
{
char **args;
if (fd == -1)
return -1;
i_close_fd(&fd);
return -1;
}
/* <content-type> <extension> [<extension> ...] */
break;
}
continue;
}
}
if (input->stream_errno != 0) {
ret = -1;
} else if (!eof_seen) {
i_error("parser script didn't send any data");
else
i_error("parser script didn't send empty EOF line");
}
return ret;
}
const char **content_type,
const char *filename)
{
const char *extension;
}
if (script_contents_read(user) < 0)
return FALSE;
}
return FALSE;
return FALSE;
return TRUE;
}
}
} else {
return TRUE;
}
}
return FALSE;
}
const char **filename_r)
{
*filename_r = NULL;
if (content_disposition == NULL)
return;
/* type; param; param; .. */
return;
break;
}
}
if (*filename_r == NULL) {
/* RFC 2231 style non-ascii filename. we don't really care
much about the filename actually, just about its extension */
*filename_r = filename2;
}
}
static struct fts_parser *
{
int fd;
return NULL;
if (fd == -1)
return NULL;
i_close_fd(&fd);
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 {
}
}
}
const char **retriable_err_msg_r ATTR_UNUSED)
{
return ret;
}
};