dbox-attachment.c revision 7d73c8f29360df6f1705c0f6670b9030632772f6
/* Copyright (c) 2010-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "istream-concat.h"
#include "str.h"
#include "istream-attachment.h"
#include "istream-base64-encoder.h"
#include "dbox-file.h"
#include "dbox-save.h"
#include "dbox-attachment.h"
};
{
const struct mail_attachment_extref *extref;
unsigned int startpos;
return;
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
parse_extref_decode_options(const char *str,
struct mail_attachment_extref *extref)
{
unsigned int num;
if (*str == DBOX_ATTACHMENT_DECODE_OPTION_NONE)
while (*str != '\0') {
switch (*str) {
str++;
}
return FALSE;
break;
str++;
break;
default:
return FALSE;
}
}
return TRUE;
}
static bool
{
struct mail_attachment_extref extref;
const char *const *args;
unsigned int i, len;
if ((len % 4) != 0)
return FALSE;
last_voffset = 0;
const char *start_offset_str = args[i+0];
return FALSE;
}
return TRUE;
}
{
bool ret;
T_BEGIN {
} T_END;
return ret;
}
static int
const char *ext_refs,
const char **error_r)
{
const struct mail_attachment_extref *extref;
const char *path, *path_suffix;
unsigned int i;
int ret = 1;
&extrefs_arr)) {
*error_r = "Broken ext-refs string";
return 0;
}
"ext-refs point outside message "
ret = 0;
}
}
if (extref->base64_blocks_per_line > 0) {
}
}
"ext-refs point outside message "
ret = 0;
} else {
(void)array_append_space(&streams);
}
}
i_stream_unref(&inputs[i]);
return ret;
}
{
int ret;
/* need to read metadata in case there are external references */
return ret;
return 1;
/* we have external references. */
T_BEGIN {
if (ret == 0) {
"Corrupted ext-refs metadata %s: %s",
}
} T_END;
return ret;
}