client.c revision 46ec792dd4ccf6c34706c4774228301fafde6aa9
/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "base64.h"
#include "buffer.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "randgen.h"
#include "safe-memset.h"
#include "str.h"
#include "strescape.h"
#include "client.h"
#include "client-authenticate.h"
#include "auth-client.h"
#include "ssl-proxy.h"
#include "pop3-proxy.h"
#include "hostpid.h"
/* Disconnect client when it sends too many bad commands */
#define CLIENT_MAX_BAD_COMMANDS 10
const char *login_protocol = "pop3";
const char *login_process_name = "pop3-login";
unsigned int login_default_port = 110;
{
return TRUE;
}
{
return TRUE;
}
const char *args)
{
"Unknown command.");
return FALSE;
}
{
if (!client_read(client))
return;
/* if a command starts an authentication, stop processing further
commands until the authentication is finished. */
*args++ = '\0';
client->bad_counter = 0;
"Too many invalid bad commands.");
"Disconnected: Too many bad commands");
}
}
if (client_unref(client))
}
{
struct pop3_client *pop3_client;
return &pop3_client->common;
}
{
}
{
}
{
unsigned char buffer[16];
return NULL;
return i_strdup_printf("<%x.%x.%lx.%s@%s>",
(unsigned long)ioloop_time,
}
{
} else {
}
}
{
}
static void
const char *text)
{
const char *prefix = "-ERR";
switch (reply) {
case CLIENT_CMD_REPLY_OK:
prefix = "+OK";
break;
prefix = "-ERR [IN-USE]";
break;
case CLIENT_CMD_REPLY_BAD:
case CLIENT_CMD_REPLY_BYE:
break;
case CLIENT_CMD_REPLY_STATUS:
/* can't send status notifications */
return;
}
T_BEGIN {
} T_END;
}
void clients_init(void)
{
/* Nothing to initialize for POP3 */
}
void clients_deinit(void)
{
}
struct client_vfuncs client_vfuncs = {
NULL,
NULL,
};