changeset 7943:138a64b6dffe HEAD

Just send CAPABILITY response code for all LOGIN/AUTHENTICATE commands. Simplifies things and Lemonade spec specifies it as a "MUST be sent" anyway.
author Timo Sirainen <tss@iki.fi>
date Sat, 21 Jun 2008 18:19:41 +0300
parents 80b06754846b
children 6d1214687c89
files src/imap-login/client.c src/imap/main.c src/login-common/client-common.h src/login-common/master.c src/master/login-process.c src/master/mail-process.c src/master/mail-process.h src/master/master-login-interface.h
diffstat 8 files changed, 0 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap-login/client.c	Sat Jun 21 17:45:08 2008 +0300
+++ b/src/imap-login/client.c	Sat Jun 21 18:19:41 2008 +0300
@@ -108,8 +108,6 @@
 
 static int cmd_capability(struct imap_client *client)
 {
-	client->common.master_login_flags |=
-		LOGIN_IMAP_FLAG_FULL_CAPABILITY_SENT;
 	client_send_line(client, t_strconcat(
 		"* CAPABILITY ", get_capability(client, TRUE), NULL));
 	client_send_tagline(client, "OK Capability completed.");
@@ -138,10 +136,6 @@
 	client->common.secured = TRUE;
 	client_set_title(client);
 
-	/* CAPABILITY sent before STARTTLS can't be trusted */
-	client->common.master_login_flags &=
-		~LOGIN_IMAP_FLAG_FULL_CAPABILITY_SENT;
-
 	client->common.fd = fd_ssl;
 	i_stream_unref(&client->common.input);
 	o_stream_unref(&client->output);
--- a/src/imap/main.c	Sat Jun 21 17:45:08 2008 +0300
+++ b/src/imap/main.c	Sat Jun 21 18:19:41 2008 +0300
@@ -252,9 +252,6 @@
 			"* PREAUTH [CAPABILITY ",
 			str_c(capability_string), "] "
 			"Logged in as ", user, NULL));
-	} else if (getenv("CLIENT_SEND_CAPABILITY") == NULL) {
-		client_send_line(client,
-				 t_strconcat(tag, " OK Logged in.", NULL));
 	} else {
 		client_send_line(client, t_strconcat(
 			tag, " OK [CAPABILITY ",
--- a/src/login-common/client-common.h	Sat Jun 21 17:45:08 2008 +0300
+++ b/src/login-common/client-common.h	Sat Jun 21 18:19:41 2008 +0300
@@ -28,7 +28,6 @@
 	char *auth_mech_name;
 	struct auth_request *auth_request;
 
-	enum master_login_flags master_login_flags;
 	unsigned int master_tag;
 	master_callback_t *master_callback;
 	sasl_server_callback_t *sasl_callback;
--- a/src/login-common/master.c	Sat Jun 21 17:45:08 2008 +0300
+++ b/src/login-common/master.c	Sat Jun 21 18:19:41 2008 +0300
@@ -87,7 +87,6 @@
 	req->auth_id = auth_id;
 	req->local_ip = client->local_ip;
 	req->remote_ip = client->ip;
-	req->flags = client->master_login_flags;
 	req->cmd_tag_size =  cmd_tag_size;
 	req->data_size = req->cmd_tag_size + size;
 #if (LOGIN_MAX_INBUF_SIZE*2) != MASTER_LOGIN_MAX_DATA_SIZE
--- a/src/master/login-process.c	Sat Jun 21 17:45:08 2008 +0300
+++ b/src/master/login-process.c	Sat Jun 21 18:19:41 2008 +0300
@@ -438,7 +438,6 @@
 	authreq->mail_request.fd = client_fd;
 	authreq->mail_request.local_ip = req.local_ip;
 	authreq->mail_request.remote_ip = req.remote_ip;
-	authreq->mail_request.flags = req.flags;
 	authreq->mail_request.cmd_tag_size = req.cmd_tag_size;
 	authreq->mail_request.data_size = req.data_size;
 	memcpy(authreq->data, data, req.data_size);
--- a/src/master/mail-process.c	Sat Jun 21 17:45:08 2008 +0300
+++ b/src/master/mail-process.c	Sat Jun 21 18:19:41 2008 +0300
@@ -14,7 +14,6 @@
 #include "home-expand.h"
 #include "var-expand.h"
 #include "mail-process.h"
-#include "master-login-interface.h"
 #include "login-process.h"
 #include "log.h"
 
@@ -837,9 +836,6 @@
 		env_put(t_strconcat("IMAPLOGINTAG=",
 			t_strndup(data, request->cmd_tag_size), NULL));
 	}
-	if ((request->flags & LOGIN_IMAP_FLAG_FULL_CAPABILITY_SENT) == 0 &&
-	    process_type == PROCESS_TYPE_IMAP)
-		env_put("CLIENT_SEND_CAPABILITY=1");
 
 	if (request->data_size > request->cmd_tag_size) {
 		str_truncate(str, 0);
--- a/src/master/mail-process.h	Sat Jun 21 17:45:08 2008 +0300
+++ b/src/master/mail-process.h	Sat Jun 21 18:19:41 2008 +0300
@@ -6,7 +6,6 @@
 
 struct mail_login_request {
 	int fd;
-	enum master_login_flags flags;
 	unsigned int cmd_tag_size;
 	unsigned int data_size;
 	struct ip_addr local_ip, remote_ip;
--- a/src/master/master-login-interface.h	Sat Jun 21 17:45:08 2008 +0300
+++ b/src/master/master-login-interface.h	Sat Jun 21 18:19:41 2008 +0300
@@ -25,10 +25,6 @@
 	LOGIN_STATE_COUNT
 };
 
-enum master_login_flags {
-	LOGIN_IMAP_FLAG_FULL_CAPABILITY_SENT	= 0x01
-};
-
 struct master_login_request {
 	uint32_t version;
 	/* if fd == -1, tag is used as master_login_state */
@@ -39,7 +35,6 @@
 	/* request follows this many bytes of client input */
 	uint16_t data_size;
 	uint16_t cmd_tag_size;
-	uint32_t flags;
 
 	ino_t ino;