pop3-proxy.c revision d67848ba944a3172c4834c591ddc921fa4ff16b1
/* Copyright (c) 2004-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "base64.h"
#include "safe-memset.h"
#include "str.h"
#include "str-sanitize.h"
#include "client.h"
#include "pop3-proxy.h"
struct pop3_client *client)
{
const char *line;
/* remote authentication failed, we're just
freeing the proxy */
return;
}
/* we came here from client_destroy() */
return;
}
/* failed for some reason, probably server disconnected */
"-ERR [IN-USE] Temporary login failure.");
return;
}
switch (i_stream_read(input)) {
case -2:
/* buffer full */
"proxy: Remote input buffer full");
return;
case -1:
/* disconnected */
return;
}
return;
switch (client->proxy_state) {
case 0:
/* this is a banner */
"proxy: Remote returned invalid banner: %s",
return;
}
/* send USER command */
client->proxy_state++;
return;
case 1:
break;
/* USER successful, send PASS */
client->proxy_state++;
return;
case 2:
break;
/* Login successful. Send this line to client. */
client->proxy_user) != 0) {
/* remote username is different, log it */
}
return;
}
/* Login failed. Pass through the error message to client
(see imap-proxy code for potential problems with this) */
else
/* allow client input again */
}
}
{
return -1;
}
/* connection_queue_add() decided that we were the oldest
connection and killed us. */
return -1;
}
return -1;
client->proxy_state = 0;
/* disable input until authentication is finished */
return 0;
}