commands.c revision b73539ef2de3db3abc0ad5f729406e695e4cb76b
/* Copyright (c) 2009-2017 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "istream.h"
#include "istream-concat.h"
#include "ostream.h"
#include "safe-mkstemp.h"
#include "index/raw/raw-storage.h"
#include "master-service.h"
#include "settings-parser.h"
#include "lda-settings.h"
#include "lmtp-settings.h"
#include "smtp-address.h"
#include "smtp-server.h"
#include "lmtp-proxy.h"
#include "lmtp-local.h"
#include "mail-deliver.h"
#include "mail-error.h"
#include "main.h"
#include "client.h"
#include "commands.h"
/*
* EHLO command
*/
/*
* STARTTLS command
*/
/*
* MAIL command
*/
{
/* connect to anvil before dropping privileges */
}
return 1;
}
/*
* RCPT command
*/
struct smtp_server_cmd_rcpt *data)
{
char delim = '\0';
int ret;
/* proxied? */
return (ret < 0 ? -1 : 0);
/* no */
}
/* local delivery */
}
/*
* QUIT command
*/
/*
* VRFY command
*/
/*
* RSET command
*/
/*
* NOOP command
*/
/*
* DATA command
*/
{
} else {
}
return input;
}
static void
struct smtp_server_transaction *trans)
{
size_t proxy_offset = 0;
/* headers for local deliveries only */
/* headers for local and proxied messages */
}
static int
{
int fd;
/* continue writing to file */
return -1;
return 0;
}
/* move everything to a temporary file. */
if (fd == -1) {
return -1;
}
/* we just want the fd, unlink it */
/* shouldn't happen.. */
i_close_fd(&fd);
return -1;
}
return -1;
}
return 0;
}
static int
{
return 0;
} else {
}
}
static int
struct smtp_server_cmd_ctx *cmd,
struct smtp_server_transaction *trans)
{
/* finish the message */
/* formulate prepended headers for both local and proxy delivery */
/* construct message streams for local and proxy delivery */
i_stream_unref(&inputs[0]);
}
i_stream_unref(&inputs[0]);
}
/* local delivery */
}
/* proxy delivery */
}
return 0;
}
struct smtp_server_transaction *trans)
{
const unsigned char *data;
"Temporary internal failure");
return -1;
}
}
if (ret == 0)
return 0;
/* client probably disconnected */
return -1;
}
/* the ending "." line was seen. finish delivery. */
}
int cmd_data_begin(void *conn_ctx,
struct smtp_server_cmd_ctx *cmd,
struct smtp_server_transaction *trans,
struct istream *data_input)
{
return 0;
}
/*
* XCLIENT command
*/