Commit 988d0462 988d04621acd47fbf7fb48134a827f72dff3260e by Wojciech Polak

Added support for ERR_TLS_ACTIVE.

1 parent 2364f404
......@@ -377,6 +377,10 @@ pop3d_mainloop (int fd, FILE *infile, FILE *outfile)
pop3d_outf ("-ERR " TOO_LONG "\r\n");
else if (status == ERR_FILE)
pop3d_outf ("-ERR " FILE_EXP "\r\n");
#ifdef WITH_TLS
else if (status == ERR_TLS_ACTIVE)
pop3d_outf ("-ERR " TLS_ACTIVE "\r\n");
#endif /* WITH_TLS */
else
pop3d_outf ("-ERR unknown error\r\n");
......
......@@ -59,6 +59,9 @@
/* An error occured when expunging. */
#define FILE_EXP "Some deleted messages not removed"
/* Command not permitted when TLS active. */
#define TLS_ACTIVE "Command not permitted when TLS active"
/* APOP password file, without .db or .passwd, which are added based on file
type automatically */
#define APOP_PASSFILE_NAME "apop"
......@@ -167,6 +170,7 @@
#define ERR_TIMEOUT 14
#define ERR_UNKNOWN 15
#define ERR_MBOX_SYNC 16
#define ERR_TLS_ACTIVE 17
extern mailbox_t mbox;
extern int state;
......
......@@ -30,6 +30,9 @@ pop3d_stls (const char *arg)
if (state != AUTHORIZATION)
return ERR_WRONG_STATE;
if (tls_done)
return ERR_TLS_ACTIVE;
pop3d_outf ("+OK Begin TLS negotiation\r\n");
pop3d_flush_output ();
......