/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "pop3-common.h"
#include "ioloop.h"
#include "buffer.h"
#include "istream.h"
#include "ostream.h"
#include "path-util.h"
#include "base64.h"
#include "str.h"
#include "process-title.h"
#include "restrict-access.h"
#include "settings-parser.h"
#include "master-service.h"
#include "master-login.h"
#include "master-interface.h"
#include "var-expand.h"
#include "mail-error.h"
#include "mail-user.h"
#include "mail-namespace.h"
#include "mail-storage-service.h"
#include <stdio.h>
#include <unistd.h>
#define IS_STANDALONE() \
{
return old_hook;
}
void pop3_refresh_proctitle(void)
{
if (!verbose_proctitle)
return;
switch (pop3_client_count) {
case 0:
break;
case 1:
}
break;
default:
break;
}
}
static void pop3_die(void)
{
/* do nothing. pop3 connections typically die pretty quick anyway. */
}
{
i_panic("Couldn't add client input to stream");
}
(void)client_handle_input(client);
}
static int
const char **error_r)
{
const char *lookup_error_str =
const char *errstr;
/* ignored */
}
return -1;
}
if (set->verbose_proctitle)
&errstr) <= 0) {
return -1;
}
return 0;
}
{
int ret;
"-ERR [IN-USE] Mailbox is locked by another POP3 session.");
return -1;
}
return 0;
}
{
const char *error;
/* finish initializing the user (see comment in main()) */
if (!already_logged_in)
return -1;
}
return 0;
}
{
const char *error;
/*
* RFC 1939 requires that the session lock gets acquired before the
* positive response is sent to the client indicating a transition
* to the TRANSACTION state.
*
* Since the session lock is stored under the INBOX's storage
* directory, the locking code requires that the namespaces are
* initialized first.
*
* If the system administrator configured dovecot to not use session
* locks, we can send back the positive response before the
* potentially long-running namespace initialization occurs. This
* avoids the client possibly timing out during authentication due
* to storage initialization taking too long.
*/
return; /* no need to propagate an error */
if (lock_session(client) < 0)
return; /* no need to propagate an error */
if (!IS_STANDALONE())
} else {
if (!IS_STANDALONE())
return; /* no need to propagate an error */
}
return;
}
}
{
i_fatal("USER environment missing");
/* client may be destroyed now */
}
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);
return;
}
/* client may be destroyed now */
}
const char *errormsg)
{
const char *msg;
/* ignored */
}
}
{
/* when running standalone, we shouldn't even get here */
}
{
};
int c;
if (IS_STANDALONE() && getuid() == 0 &&
"inetd, use pop3-login instead.\n");
return 1;
}
if (IS_STANDALONE()) {
} else {
}
/*
* We include MAIL_STORAGE_SERVICE_FLAG_NO_NAMESPACES so that the
* mail_user initialization is fast and we can quickly send back the
* OK response to LOGIN/AUTHENTICATE. Otherwise we risk a very slow
* namespace initialization to cause client timeouts on login.
*/
while ((c = master_getopt(master_service)) > 0) {
switch (c) {
case 'a':
break;
case 't':
break;
case 'u':
break;
default:
return FATAL_DEFAULT;
}
}
const char *error;
}
}
}
if (!IS_STANDALONE())
/* NOTE: login_set.*_socket_path are now invalid due to data stack
having been freed */
/* 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;
}