/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "submission-common.h"
#include "buffer.h"
#include "str.h"
#include "istream.h"
#include "ostream.h"
#include "array.h"
#include "base64.h"
#include "hostpid.h"
#include "path-util.h"
#include "process-title.h"
#include "restrict-access.h"
#include "fd-util.h"
#include "master-service.h"
#include "master-login.h"
#include "master-service-settings.h"
#include "master-interface.h"
#include "var-expand.h"
#include "mail-error.h"
#include "mail-user.h"
#include "mail-storage-service.h"
#include "smtp-server.h"
#include "smtp-client.h"
#include "submission-commands.h"
#include <stdio.h>
#include <unistd.h>
#define IS_STANDALONE() \
{
return old_hook;
}
void submission_refresh_proctitle(void)
{
if (!verbose_proctitle)
return;
switch (submission_client_count) {
case 0:
break;
case 1:
}
break;
default:
break;
}
}
static void submission_die(void)
{
/* do nothing. submission connections typically die pretty quick anyway.
*/
}
static void
const char *error_msg)
{
const char *msg;
"421 4.3.2 %s Shutting down due to fatal error\r\n",
i_error("write(client) failed: %m");
}
}
static int
const char **error_r)
{
const unsigned char *data;
"4.7.0", MAIL_ERRSTR_CRITICAL_MSG);
return -1;
}
*error_r = "No relay host configured for submission proxy "
"(submission_relay_host is unset)";
"4.3.5", MAIL_ERRSTR_CRITICAL_MSG);
return -1;
}
if (set->verbose_proctitle)
/* parse input data */
data_len = 0;
if (len > 0) {
if (*data == '\0') {
helo_len = 1;
} else {
}
}
/* NOTE: actually, pipelining the AUTH command is stricly
speaking not allowed, but we support it anyway.
*/
}
}
return 0;
}
{
i_fatal("USER environment missing");
}
static void
const char *username, const char *const *extra_fields)
{
const char *error;
if ((flags & MAIL_AUTH_REQUEST_FLAG_CONN_SECURED) != 0)
if ((flags & MAIL_AUTH_REQUEST_FLAG_CONN_SSL_SECURED) != 0)
i_close_fd(&fd);
}
}
const char *errormsg)
{
const char *msg;
"421 4.3.2 %s Shutting down due to fatal error\r\n",
/* ignored */
}
}
{
/* when running standalone, we shouldn't even get here */
}
{
};
const char *error;
int c;
if (IS_STANDALONE() && getuid() == 0 &&
printf("421 5.3.5 The submission binary must not be started "
"from inetd, use submission-login instead.\r\n");
return 1;
}
if (IS_STANDALONE()) {
} else {
}
while ((c = master_getopt(master_service)) > 0) {
switch (c) {
case 'a':
break;
case 't':
if (str_to_uint(optarg,
&login_set.postlogin_timeout_secs) < 0 ||
break;
case 'u':
break;
case 'D':
break;
default:
return FATAL_DEFAULT;
}
}
&error) < 0) {
error);
}
i_fatal("t_abspath(%s) failed: %s",
}
}
/* initialize SMTP server */
/* initialize SMTP client */
/* fake that we're running, so we know if client was destroyed
while handling its initial input */
if (IS_STANDALONE()) {
T_BEGIN {
} T_END;
} else {
}
if (master_login != NULL)
return 0;
}