/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "array.h"
#include "istream.h"
#include "ostream.h"
#include "smtp-reply.h"
#include "smtp-server-private.h"
/*
* Logging
*/
const char *format, ...)
{
i_debug("%s-server: conn %s: "
"command %s; %u reply [%u/%u]: %s",
} else {
i_debug("%s-server: conn %s: "
"command %s; %u reply: %s",
}
}
}
/*
* Reply
*/
{
return;
return;
}
{
}
}
static struct smtp_server_reply *
{
/* get rid of any existing reply */
} else {
}
return reply;
}
struct smtp_server_reply *
const char *enh_code)
{
/* RFC 5321, Section 4.2:
In the absence of extensions negotiated with the client, SMTP servers
MUST NOT send reply codes whose first digits are other than 2, 3, 4,
or 5. Clients that receive such out-of-range codes SHOULD normally
treat them as fatal errors and terminate the mail transaction.
*/
/* RFC 2034, Section 4:
All status codes returned by the server must agree with the primary
response code, that is, a 2xx response must incorporate a 2.X.X code,
a 4xx response must incorporate a 4.X.X code, and a 5xx response must
incorporate a 5.X.X code.
*/
} else {
}
return reply;
}
struct smtp_server_reply *
{
}
struct smtp_server_reply *
{
return reply;
}
{
unsigned int i;
return;
for (i = 0; i < cmd->replies_expected; i++) {
}
}
const char *text)
{
if (*text == '\0')
return;
do {
const char *p;
if (p == NULL) {
} else {
else
text = p + 1;
}
}
{
}
unsigned int index,
unsigned int from_index)
{
}
{
}
{
}
const char *fmt, ...)
{
}
{
}
const struct smtp_reply *from)
{
}
static void ATTR_FORMAT(4, 0)
{
const char *text;
unsigned int first, i = 0;
/* find the first unsent reply */
for (; i < cmd->replies_expected; i++) {
break;
}
}
first = i++;
/* compose the reply text */
/* submit the first remaining reply */
/* duplicate the rest from it */
for (; i < cmd->replies_expected; i++)
}
const char *fmt, ...)
{
}
const char *fmt, ...)
{
}
{
}
{
const char *text, *p;
for (;;) {
text = p + 1;
if (text_len <= prefix_len)
break;
text_len -= prefix_len;
text += prefix_len;
}
}
{
char *text;
int ret = 0;
/* substitute '-' with ' ' in last line */
if (text[0] != ' ') {
text[0] = ' ';
}
return -1;
}
}
return ret;
}
{
int ret;
return 0;
T_BEGIN {
} T_END;
return ret;
}
/*
* EHLO reply
*/
struct smtp_server_reply *
{
return reply;
}
const char *keyword)
{
}
{
if (*param_fmt != '\0') {
}
}
{
static const char *base_fields =
"ADDR PORT PROTO HELO LOGIN TTL TIMEOUT";
return;
return;
}
NULL));
}