imap-proxy.c revision 0745a5190c95a5ca80f7ff32e4db8e429dc2a03f
/* Copyright (C) 2004 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "str.h"
#include "safe-memset.h"
#include "client.h"
#include "imap-quote.h"
#include "imap-proxy.h"
{
/* this is a banner */
i_error("imap-proxy(%s): "
"Remote returned invalid banner: %s",
return -1;
}
/* send LOGIN command */
return 0;
/* Login successful. Send this line to client. */
return -1;
/* Login failed. Send our own failure reply so client can't
figure out if user exists or not just by looking at the
reply string. */
/* allow client input again */
return -1;
} else {
/* probably some untagged reply */
return 0;
}
}
void *context)
{
const char *line;
/* remote authentication failed, we're just
freeing the proxy */
return;
}
/* failed for some reason */
return;
}
switch (i_stream_read(input)) {
case -2:
/* buffer full */
i_error("imap-proxy(%s): Remote input buffer full",
return;
case -1:
/* disconnected */
return;
}
break;
}
}
{
i_error("proxy(%s): password not given",
return -1;
}
return -1;
/* disable input until authentication is finished */
}
return 0;
}