/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "net.h"
#include "istream.h"
#include "message-parser.h"
#include "mail-storage.h"
#include "mail-namespace.h"
#include "imap-url.h"
#include "imap-msgpart.h"
#include "imap-msgpart-url.h"
struct imap_msgpart_url {
char *mailbox;
char *section;
};
struct imap_msgpart_url **mpurl_r,
const char **error_r)
{
*error_r = "Invalid messagepart IMAP URL";
return -1;
}
*error_r = "Invalid section";
return -1;
}
url->partial_size == 0 ?
return 0;
}
const char **error_r)
{
const char *error;
/* build base url */
if (selected_box != NULL) {
&box_status);
}
/* parse url */
return 0;
}
*error_r = "Mailbox-relative IMAP URL, but no mailbox selected";
return 0;
}
return -1;
return 1;
}
{
}
const char **error_r)
{
return 1;
}
/* find mailbox namespace */
/* open mailbox */
else {
}
if (mailbox_open(box) < 0) {
mailbox_free(&box);
}
/* verify UIDVALIDITY */
if (mpurl->uidvalidity > 0 &&
*error_r = "Invalid UIDVALIDITY";
mailbox_free(&box);
return 0;
}
return 1;
}
{
struct mailbox_transaction_context *t;
int ret;
return 1;
}
/* open mailbox if it is not yet open */
error_r)) <= 0)
return ret;
/* start transaction */
/* find the message */
*error_r = "Message not found";
return 0;
}
return 1;
}
struct imap_msgpart *
{
}
{
}
struct imap_msgpart_open_result *result_r,
const char **error_r)
{
int ret;
return 1;
}
/* open mail if it is not yet open */
if (ret <= 0)
return ret;
/* open the referenced part as a stream */
if (ret < 0) {
return ret;
}
return 1;
}
const char **error_r)
{
int ret;
return 1;
/* open mail if it is not yet open */
return ret;
}
const char **bpstruct_r,
const char **error_r)
{
int ret;
/* open mail if it is not yet open */
if (ret <= 0)
return ret;
if (ret < 0)
else if (ret == 0)
*error_r = "Message part not found";
return ret;
}
{
}