/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "submission-common.h"
#include "str.h"
#include "str-sanitize.h"
#include "istream.h"
#include "istream-concat.h"
#include "istream-seekable.h"
#include "mail-storage.h"
#include "imap-url.h"
#include "imap-msgpart.h"
#include "imap-msgpart-url.h"
#include "imap-urlauth.h"
#include "imap-urlauth-fetch.h"
#include "smtp-address.h"
#include "smtp-client.h"
#include "smtp-client-connection.h"
#include "submission-commands.h"
/*
*/
struct cmd_data_context {
};
struct cmd_data_context *data_ctx)
{
/* finished proxying message to relay server */
/* check for fatal problems */
return;
i_info("Successfully relayed message: "
"id=%s, nrcpt=%u, reply=`%s'",
} else {
i_info("Failed to relay message: "
}
}
struct smtp_server_transaction *trans)
{
const unsigned char *data;
int ret;
if (ret == 0)
return 0;
return -1;
/* Done reading DATA stream; remove it from state and continue with
local variable. */
/* prepend our own headers */
i_stream_seek(data_input, 0);
i_stream_unref(&inputs[0]);
/* start proxying to relay server */
return 0;
}
struct smtp_server_transaction *trans,
struct istream *data_input)
{
inputs[0] = data_input;
return 0;
}
/*
* BURL command
*/
/* FIXME: RFC 4468
If the URL argument to BURL refers to binary data, then the submit server
MAY refuse the command or down convert as described in Binary SMTP.
*/
struct cmd_burl_context {
};
static void
{
}
static int
{
int ret;
/* fatal failure */
// FIXME: make this an internal error
"IMAP URLAUTH resolution failed");
return -1;
}
/* URL fetch failed */
"IMAP URLAUTH resolution failed: %s",
} else {
"IMAP URLAUTH resolution failed");
}
return 1;
}
/* URL fetch succeeded */
if (ret < 0)
return -1;
/* Command is likely not yet complete at this point, so return 0 */
return 0;
}
static int
{
const char *error;
/* validate host */
"IMAP URL resolution failed: "
"Inappropriate or missing host name");
return -1;
}
/* validate port */
"IMAP URL resolution failed: "
"Inappropriate server port");
return -1;
}
/* retrieve URL */
"IMAP URL resolution failed: %s", error);
return -1;
}
"IMAP URL resolution failed: %s", error);
return -1;
}
}
static int
{
/* RFC5248, Section 2.4:
554 5.7.14 Trust relationship required
The submission server requires a configured trust
relationship with a third-party server in order to access
the message content. This value replaces the prior use of
X.7.8 for this error condition, thereby updating [RFC4468].
*/
"No IMAP URLAUTH access available");
return -1;
}
/* urlauth */
/* wait for URL fetch */
return 0;
}
return 1;
}
{
const char *const *argv;
/* burl-cmd = "BURL" SP absolute-URI [SP end-marker] CRLF
end-marker = "LAST"
*/
"Missing chunk URL parameter");
ret = -1;
"Invalid chunk URL: %s", error);
ret = -1;
"Invalid end marker parameter");
ret = -1;
"Invalid parameters");
ret = -1;
} else {
chunk_last = TRUE;
}
}
return;
/* direct local url */
} else {
}
if (ret == 0 && chunk_last)
}