/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "safe-mkstemp.h"
#include "fs-api.h"
#include "istream.h"
#include "ostream.h"
#include "base64.h"
#include "hash-format.h"
#include "str.h"
#include "message-parser.h"
#include "rfc822-parser.h"
#include "fs-api.h"
#include "istream-fs-file.h"
#include "istream-attachment-connector.h"
#include "istream-attachment-extractor.h"
#include "mail-user.h"
#include "index-mail.h"
#include "index-attachment.h"
};
struct mail_save_attachment {
};
{
}
void *context)
{
/* don't treat text/ parts as attachments */
}
{
int fd;
if (fd == -1) {
return -1;
}
i_close_fd(&fd);
return -1;
}
return fd;
}
static int
{
/* make sure we can access first 4 bytes without accessing
out of bounds memory */
}
return 0;
}
static int
{
if (ret < 0)
ret = -1;
}
if (ret < 0) {
}
return ret;
}
{
const char *error;
return;
/* we already checked this when verifying settings */
i_panic("mail_attachment_hash=%s unexpectedly failed: %s",
}
}
{
if (output->stream_errno == 0)
return 0;
if (!mail_storage_set_error_from_errno(storage)) {
}
return -1;
}
{
const unsigned char *data;
return -1;
do {
}
/* need more input */
return 0;
}
} while (ret != -1);
return -1;
}
return -1;
}
return 0;
}
{
}
{
}
}
{
}
static int
{
const char *path;
int ret;
return ret;
}
{
int ret;
T_BEGIN {
} T_END;
return ret;
}
{
unsigned int startpos;
if (!add_space)
else
if (extref->base64_have_crlf)
if (extref->base64_blocks_per_line > 0) {
}
/* make it clear there are no options */
}
}
}
static bool
struct mail_attachment_extref *extref)
{
unsigned int num;
if (*str == MAIL_ATTACHMENT_DECODE_OPTION_NONE)
while (*str != '\0') {
switch (*str) {
str++;
}
return FALSE;
break;
str++;
break;
default:
return FALSE;
}
}
return TRUE;
}
{
const char *const *args;
unsigned int i, len;
if ((len % 4) != 0)
return FALSE;
last_voffset = 0;
return FALSE;
}
return TRUE;
}
const char *path_suffix,
{
const char *path;
int ret;
&extrefs_arr)) {
*error_r = "Broken ext-refs string";
return -1;
}
if (ret < 0) {
return -1;
}
}
return 0;
}