[SVN] r591 - in /trunk/cyrus-imapd-2.2.13: doc/changes.html
imap/backend.c
imap/protocol.c imap/protocol.h imap/saslclient.c lib/imapoptions
timsieved/Makefile.in timsieved/actions.c timsieved/parser.c
timsieved/timsieved.c
debian at incase.de
debian at incase.de
Thu Aug 31 15:03:05 UTC 2006
Author: sven
Date: Thu Aug 31 17:02:55 2006
New Revision: 591
URL: https://mail.incase.de/viewcvs?rev=591&root=cyrus22&view=rev
Log:
Revert previous non-dpatch commit
Modified:
trunk/cyrus-imapd-2.2.13/doc/changes.html
trunk/cyrus-imapd-2.2.13/imap/backend.c
trunk/cyrus-imapd-2.2.13/imap/protocol.c
trunk/cyrus-imapd-2.2.13/imap/protocol.h
trunk/cyrus-imapd-2.2.13/imap/saslclient.c
trunk/cyrus-imapd-2.2.13/lib/imapoptions
trunk/cyrus-imapd-2.2.13/timsieved/Makefile.in
trunk/cyrus-imapd-2.2.13/timsieved/actions.c
trunk/cyrus-imapd-2.2.13/timsieved/parser.c
trunk/cyrus-imapd-2.2.13/timsieved/timsieved.c
Modified: trunk/cyrus-imapd-2.2.13/doc/changes.html
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/doc/changes.html?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/doc/changes.html (original)
+++ trunk/cyrus-imapd-2.2.13/doc/changes.html Thu Aug 31 17:02:55 2006
@@ -1,20 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- $Id: changes.html,v 1.104 2006/08/30 16:29:10 murch Exp $ -->
+<!-- $Id: changes.html,v 1.102 2006/03/31 15:24:29 murch Exp $ -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>Changes to the Cyrus IMAP Server</title>
</head>
<body>
-
-<h1>Changes to the Cyrus IMAP Server since 2.2.13</h1>
-<ul>
-<li><tt>ctl_mboxlist</tt> now dumps/undumps the mailbox type flags,
-making it useful for remote mailboxes.</li>
-<li>Added <tt>sieve_allowreferrals</tt> option to control whether
-<tt>timsieved</tt> issues referrals or proxys traffic to backends.</li>
-</ul>
<h1>Changes to the Cyrus IMAP Server since 2.2.12</h1>
<ul>
@@ -2036,7 +2028,7 @@
</ul>
<hr />
-last modified: $Date: 2006/08/30 16:29:10 $ <br />
+last modified: $Date: 2006/03/31 15:24:29 $ <br />
<a href="index.html">Return</a> to the Cyrus IMAP Server Home Page
</body>
</html>
Modified: trunk/cyrus-imapd-2.2.13/imap/backend.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/imap/backend.c?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/imap/backend.c (original)
+++ trunk/cyrus-imapd-2.2.13/imap/backend.c Thu Aug 31 17:02:55 2006
@@ -39,7 +39,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: backend.c,v 1.42 2006/08/30 16:29:11 murch Exp $ */
+/* $Id: backend.c,v 1.39 2006/02/07 20:57:27 murch Exp $ */
#include <config.h>
@@ -74,8 +74,7 @@
#include "util.h"
static char *ask_capability(struct protstream *pout, struct protstream *pin,
- struct protocol_t *prot, unsigned long *capa,
- int banner)
+ struct protocol_t *prot, unsigned long *capa)
{
char str[4096];
char *ret = NULL, *tmp;
@@ -83,7 +82,7 @@
*capa = 0;
- if (!banner && prot->capa_cmd.cmd) {
+ if (prot->capa_cmd.cmd) {
/* request capabilities of server */
prot_printf(pout, "%s\r\n", prot->capa_cmd.cmd);
prot_flush(pout);
@@ -240,7 +239,7 @@
/* If we don't have a usable mech, do TLS and try again */
} while (r == SASL_NOMECH && CAPA(s, CAPA_STARTTLS) &&
do_starttls(s, &prot->tls_cmd) != -1 &&
- (*mechlist = ask_capability(s->out, s->in, prot, &s->capability, 0)));
+ (*mechlist = ask_capability(s->out, s->in, prot, &s->capability)));
/* xxx unclear that this is correct */
free_callbacks(cb);
@@ -376,23 +375,20 @@
ret->sock = sock;
prot_setflushonread(ret->in, ret->out);
- if (!prot->banner.is_capa) {
- do { /* read the initial greeting */
- if (!prot_fgets(buf, sizeof(buf), ret->in)) {
- syslog(LOG_ERR,
- "backend_connect(): couldn't read initial greeting: %s",
- ret->in->error ? ret->in->error : "(null)");
- if (!ret_backend) free(ret);
- close(sock);
- return NULL;
- }
- } while (strncasecmp(buf, prot->banner.resp,
- strlen(prot->banner.resp)));
+ if (prot->capa_cmd.cmd) {
+ /* read the initial greeting */
+ if (!prot_fgets(buf, sizeof(buf), ret->in)) {
+ syslog(LOG_ERR,
+ "backend_connect(): couldn't read initial greeting: %s",
+ ret->in->error ? ret->in->error : "(null)");
+ free(ret);
+ close(sock);
+ return NULL;
+ }
}
/* get the capabilities */
- mechlist = ask_capability(ret->out, ret->in, prot, &ret->capability,
- prot->banner.is_capa);
+ mechlist = ask_capability(ret->out, ret->in, prot, &ret->capability);
/* now need to authenticate to backend server,
unless we're doing LMTP on a UNIX socket (deliver) */
Modified: trunk/cyrus-imapd-2.2.13/imap/protocol.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/imap/protocol.c?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/imap/protocol.c (original)
+++ trunk/cyrus-imapd-2.2.13/imap/protocol.c Thu Aug 31 17:02:55 2006
@@ -39,7 +39,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: protocol.c,v 1.14 2006/08/30 16:29:11 murch Exp $ */
+/* $Id: protocol.c,v 1.13 2004/12/07 19:26:24 ken3 Exp $ */
#include <config.h>
@@ -89,24 +89,8 @@
return success;
}
-static char *sieve_parsesuccess(char *str, const char **status)
-{
- char *success = NULL, *tmp;
-
- if (!strncmp(str, "OK (", 4) &&
- (tmp = strstr(str+4, "SASL \"")) != NULL) {
- success = tmp+6; /* skip SASL " */
- tmp = strstr(success, "\"");
- *tmp = '\0'; /* clip " */
- }
-
- if (status) *status = NULL;
- return success;
-}
-
struct protocol_t protocol[] = {
{ "imap", "imap",
- { 0, "* OK" },
{ "C01 CAPABILITY", "C01 ", &imap_parsemechlist,
{ { " AUTH=", CAPA_AUTH },
{ " STARTTLS", CAPA_STARTTLS },
@@ -119,7 +103,6 @@
{ "N01 NOOP", "N01 OK" },
{ "Q01 LOGOUT", "Q01 " } },
{ "pop3", "pop",
- { 0, "+OK " },
{ "CAPA", ".", NULL,
{ { "SASL ", CAPA_AUTH },
{ "STLS", CAPA_STARTTLS },
@@ -129,7 +112,6 @@
{ "NOOP", "+OK" },
{ "QUIT", "+OK" } },
{ "nntp", "nntp",
- { 0, "20" },
{ "CAPABILITIES", ".", NULL,
{ { "SASL ", CAPA_AUTH },
{ "STARTTLS", CAPA_STARTTLS },
@@ -139,7 +121,6 @@
{ "DATE", "111" },
{ "QUIT", "205" } },
{ "lmtp", "lmtp",
- { 0, "220 " },
{ "LHLO murder", "250 ", NULL,
{ { "AUTH ", CAPA_AUTH },
{ "STARTTLS", CAPA_STARTTLS },
@@ -151,22 +132,11 @@
{ "NOOP", "250" },
{ "QUIT", "221" } },
{ "mupdate", "mupdate",
- { 1, "* OK" },
{ NULL, "* OK", NULL,
{ { "* AUTH ", CAPA_AUTH },
{ NULL, 0 } } },
{ "S01 STARTTLS", "S01 OK", "S01 NO" },
{ "A01 AUTHENTICATE", INT_MAX, 1, "A01 OK", "A01 NO", "", "*", NULL },
{ "N01 NOOP", "N01 OK" },
- { "Q01 LOGOUT", "Q01 " } },
- { "sieve", SIEVE_SERVICE_NAME,
- { 1, "OK" },
- { "CAPABILITY", "OK", NULL,
- { { "\"SASL\" ", CAPA_AUTH },
- { "\"STARTTLS\"", CAPA_STARTTLS },
- { NULL, 0 } } },
- { "STARTTLS", "OK", "NO" },
- { "AUTHENTICATE", INT_MAX, 1, "OK", "NO", NULL, "*", &sieve_parsesuccess },
- { NULL, NULL, NULL },
- { "LOGOUT", NULL, "OK" } }
+ { "Q01 LOGOUT", "Q01 " } }
};
Modified: trunk/cyrus-imapd-2.2.13/imap/protocol.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/imap/protocol.h?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/imap/protocol.h (original)
+++ trunk/cyrus-imapd-2.2.13/imap/protocol.h Thu Aug 31 17:02:55 2006
@@ -39,7 +39,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: protocol.h,v 1.6 2006/08/30 16:29:11 murch Exp $ */
+/* $Id: protocol.h,v 1.5 2004/05/06 18:52:07 ken3 Exp $ */
#ifndef _INCLUDED_PROTOCOL_H
#define _INCLUDED_PROTOCOL_H
@@ -70,13 +70,9 @@
struct protocol_t;
-struct banner_t {
- int is_capa; /* banner is capability response */
- char *resp; /* end of banner response */
-};
-
struct capa_cmd_t {
- const char *cmd; /* [OPTIONAL] capability command string */
+ const char *cmd; /* [OPTIONAL] capability command string
+ (NULL = capabilities in banner) */
const char *resp; /* end of capability response */
char *(*parse_mechlist)(const char *str, struct protocol_t *prot);
/* [OPTIONAL] parse capability string,
@@ -99,7 +95,6 @@
struct protocol_t {
const char *service; /* INET service name */
const char *sasl_service; /* SASL service name */
- struct banner_t banner;
struct capa_cmd_t capa_cmd;
struct tls_cmd_t tls_cmd;
struct sasl_cmd_t sasl_cmd;
@@ -114,8 +109,7 @@
PROTOCOL_POP3,
PROTOCOL_NNTP,
PROTOCOL_LMTP,
- PROTOCOL_MUPDATE,
- PROTOCOL_SIEVE
+ PROTOCOL_MUPDATE
};
#endif /* _INCLUDED_PROTOCOL_H */
Modified: trunk/cyrus-imapd-2.2.13/imap/saslclient.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/imap/saslclient.c?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/imap/saslclient.c (original)
+++ trunk/cyrus-imapd-2.2.13/imap/saslclient.c Thu Aug 31 17:02:55 2006
@@ -39,7 +39,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: saslclient.c,v 1.14 2006/08/30 16:29:11 murch Exp $ */
+/* $Id: saslclient.c,v 1.13 2004/07/07 19:49:05 rjs3 Exp $ */
#include <config.h>
@@ -237,24 +237,21 @@
do {
char *p;
- base64 = buf;
- *base64 = '\0';
-
if (clientout) { /* response */
/* convert to base64 */
+ base64 = buf;
r = sasl_encode64(clientout, clientoutlen,
base64, BASE64_BUF_SIZE, NULL);
clientout = NULL;
- }
-
- /* send to server */
- if (sendliteral) {
- prot_printf(pout, "{%d+}\r\n", strlen(base64));
- prot_flush(pout);
- }
- prot_printf(pout, "%s", base64);
-
+
+ /* send to server */
+ if (sendliteral) {
+ prot_printf(pout, "{%d+}\r\n", strlen(base64));
+ prot_flush(pout);
+ }
+ prot_printf(pout, "%s", base64);
+ }
noinitresp:
prot_printf(pout, "\r\n");
prot_flush(pout);
@@ -284,22 +281,9 @@
r = SASL_BADAUTH;
break;
}
- else if (sasl_cmd->cont &&
- !strncasecmp(buf, sasl_cmd->cont, strlen(sasl_cmd->cont))) {
+ else if (!strncasecmp(buf, sasl_cmd->cont, strlen(sasl_cmd->cont))) {
/* continue */
base64 = buf + strlen(sasl_cmd->cont);
- }
- else if (!sasl_cmd->cont && buf[0] == '{') {
- unsigned int litsize = atoi(buf+1);
-
- /* get actual literal data */
- if (!prot_fgets(buf, AUTH_BUF_SIZE, pin)) {
- if (sasl_result) *sasl_result = SASL_FAIL;
- if (status) *status = "EOF from server";
- return IMAP_SASL_PROTERR;
- }
-
- base64 = buf;
}
else {
/* unknown response */
Modified: trunk/cyrus-imapd-2.2.13/lib/imapoptions
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/lib/imapoptions?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/lib/imapoptions (original)
+++ trunk/cyrus-imapd-2.2.13/lib/imapoptions Thu Aug 31 17:02:55 2006
@@ -42,7 +42,7 @@
.\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: imapoptions,v 1.38 2006/08/30 16:29:11 murch Exp $
+.\" $Id: imapoptions,v 1.36 2006/03/30 15:49:58 murch Exp $
.SH NAME
imapd.conf \- IMAP configuration file
.SH DESCRIPTION
@@ -853,11 +853,6 @@
/* If using the alternate IMAP namespace, the prefix for the other users
namespace. The hierarchy delimiter will be automatically appended. */
-{ "sieve_allowreferrals", 1, SWITCH }
-/* If enabled, timsieved will issue referrals to clients when the
- user's scripts reside on a remote server (in a Murder).
- Otherwise, timsieved will proxy traffic to the remote server. */
-
# xxx badly worded
{ "unix_group_enable", 1, SWITCH }
/* Should we look up groups when using auth_unix (disable this if you are
Modified: trunk/cyrus-imapd-2.2.13/timsieved/Makefile.in
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/timsieved/Makefile.in?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/timsieved/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2.13/timsieved/Makefile.in Thu Aug 31 17:02:55 2006
@@ -1,5 +1,5 @@
# Makefile.in - timsieved makefile
-# $Id: Makefile.in,v 1.25 2006/08/30 16:29:11 murch Exp $
+# $Id: Makefile.in,v 1.24 2004/05/28 18:03:10 rjs3 Exp $
# @configure_input@
#
# Copyright (c) 1998-2000 Carnegie Mellon University. All rights reserved.
@@ -83,7 +83,7 @@
$(INSTALL) -m 755 timsieved $(DESTDIR)$(service_path)
OBJS= actions.o lex.o mystring.o scripttest.o timsieved.o parser.o \
- ../imap/tls.o ../imap/backend.o
+ ../imap/tls.o
timsieved: $(OBJS) $(SERVICE)
$(CC) $(LDFLAGS) -o timsieved \
Modified: trunk/cyrus-imapd-2.2.13/timsieved/actions.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/timsieved/actions.c?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/timsieved/actions.c (original)
+++ trunk/cyrus-imapd-2.2.13/timsieved/actions.c Thu Aug 31 17:02:55 2006
@@ -1,6 +1,6 @@
/* actions.c -- executes the commands for timsieved
* Tim Martin
- * $Id: actions.c,v 1.39 2006/08/30 16:29:11 murch Exp $
+ * $Id: actions.c,v 1.38 2005/11/18 14:18:18 murch Exp $
*/
/*
* Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
@@ -177,9 +177,8 @@
int mechcount;
/* implementation */
- prot_printf(conn,
- "\"IMPLEMENTATION\" \"Cyrus timsieved%s %s\"\r\n",
- config_mupdate_server ? " (Murder)" : "", CYRUS_VERSION);
+ prot_printf(conn, "\"IMPLEMENTATION\" \"Cyrus timsieved %s\"\r\n",
+ CYRUS_VERSION);
/* SASL */
if (!authenticated &&
Modified: trunk/cyrus-imapd-2.2.13/timsieved/parser.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/timsieved/parser.c?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/timsieved/parser.c (original)
+++ trunk/cyrus-imapd-2.2.13/timsieved/parser.c Thu Aug 31 17:02:55 2006
@@ -1,7 +1,7 @@
/* parser.c -- parser used by timsieved
* Tim Martin
* 9/21/99
- * $Id: parser.c,v 1.40 2006/08/30 16:29:11 murch Exp $
+ * $Id: parser.c,v 1.39 2005/11/03 13:41:54 murch Exp $
*/
/*
* Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
@@ -60,7 +60,6 @@
#include "libconfig.h"
#include "global.h"
#include "auth.h"
-#include "backend.h"
#include "mboxname.h"
#include "mboxlist.h"
#include "xmalloc.h"
@@ -91,7 +90,6 @@
/* from elsewhere */
void fatal(const char *s, int code);
extern int sieved_logfd;
-extern struct backend *backend;
/* forward declarations */
static void cmd_logout(struct protstream *sieved_out,
@@ -682,20 +680,19 @@
}
if(type & MBTYPE_REMOTE) {
- /* It's a remote mailbox */
- if (config_getswitch(IMAPOPT_SIEVE_ALLOWREFERRALS)) {
- /* We want to set up a referral */
- if (sieved_domainfromip) {
- char *authname, *p;
-
- /* get a new copy of the userid */
- free(username);
- username = xstrdup(canon_user);
-
- /* get the authid from SASL */
- sasl_result=sasl_getprop(sieved_saslconn, SASL_AUTHUSER,
- (const void **) &canon_user);
- if (sasl_result!=SASL_OK) {
+ /* It's a remote mailbox, we want to set up a referral */
+ if (sieved_domainfromip) {
+ char *authname, *p;
+
+ /* get a new copy of the userid */
+ free(username);
+ username = xstrdup(canon_user);
+
+ /* get the authid from SASL */
+ sasl_result=sasl_getprop(sieved_saslconn, SASL_AUTHUSER,
+ (const void **) &canon_user);
+ if (sasl_result!=SASL_OK)
+ {
*errmsg = "Internal SASL error";
syslog(LOG_ERR, "SASL: sasl_getprop SASL_AUTHUSER: %s",
sasl_errstring(sasl_result, NULL, NULL));
@@ -707,46 +704,21 @@
ret = FALSE;
goto cleanup;
}
- authname = xstrdup(canon_user);
-
- if ((p = strchr(authname, '@'))) *p = '%';
- if ((p = strchr(username, '@'))) *p = '%';
-
- referral_host =
- (char*) xmalloc(strlen(authname)+1+strlen(username)+1+
- strlen(server)+1);
- sprintf((char*) referral_host, "%s;%s@%s",
- authname, username, server);
-
- free(authname);
- }
- else
- referral_host = xstrdup(server);
+ authname = xstrdup(canon_user);
+
+ if ((p = strchr(authname, '@'))) *p = '%';
+ if ((p = strchr(username, '@'))) *p = '%';
+
+ referral_host =
+ (char*) xmalloc(strlen(authname)+1+strlen(username)+1+
+ strlen(server)+1);
+ sprintf((char*) referral_host, "%s;%s@%s",
+ authname, username, server);
+
+ free(authname);
}
- else {
- /* We want to set up a connection to the backend for proxying */
- const char *statusline = NULL;
-
- /* xxx hide the fact that we are storing partitions */
- if (server) {
- char *c;
- c = strchr(server, '!');
- if(c) *c = '\0';
- }
-
- backend = backend_connect(NULL, server, &protocol[PROTOCOL_SIEVE],
- username, &statusline);
-
- if (!backend) {
- syslog(LOG_ERR, "couldn't authenticate to backend server");
- prot_printf(sieved_out, "NO \"%s\"\r\n",
- statusline ? statusline :
- "Authentication to backend server failed");
- prot_flush(sieved_out);
-
- goto cleanup;
- }
- }
+ else
+ referral_host = xstrdup(server);
} else if (actions_setuser(username) != TIMSIEVE_OK) {
*errmsg = "internal error";
syslog(LOG_ERR, "error in actions_setuser()");
Modified: trunk/cyrus-imapd-2.2.13/timsieved/timsieved.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/timsieved/timsieved.c?rev=591&root=cyrus22&r1=590&r2=591&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2.13/timsieved/timsieved.c (original)
+++ trunk/cyrus-imapd-2.2.13/timsieved/timsieved.c Thu Aug 31 17:02:55 2006
@@ -1,7 +1,7 @@
/* timsieved.c -- main file for timsieved (sieve script accepting program)
* Tim Martin
* 9/21/99
- * $Id: timsieved.c,v 1.57 2006/08/30 16:29:11 murch Exp $
+ * $Id: timsieved.c,v 1.56 2005/11/18 14:18:35 murch Exp $
*/
/*
* Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
@@ -82,7 +82,6 @@
#include "auth.h"
#include "acl.h"
-#include "backend.h"
#include "mboxlist.h"
#include "util.h"
@@ -117,12 +116,6 @@
static struct proxy_context sieved_proxyctx = {
1, 1, &sieved_authstate, &sieved_userisadmin, NULL
};
-
-/* PROXY stuff */
-struct backend *backend = NULL;
-
-static void bitpipe(void);
-/* end PROXY stuff */
/*
* Cleanly shut down and exit
@@ -130,12 +123,6 @@
void shut_down(int code) __attribute__ ((noreturn));
void shut_down(int code)
{
- /* close backend connection */
- if (backend) {
- backend_disconnect(backend, &protocol[PROTOCOL_SIEVE]);
- free(backend);
- }
-
/* close mailboxes */
mboxlist_close();
mboxlist_done();
@@ -174,14 +161,6 @@
while (ret != TRUE)
{
- if (backend) {
- /* create a pipe from client to backend */
- bitpipe();
-
- /* pipe has been closed */
- return;
- }
-
ret = parser(sieved_out, sieved_in);
}
@@ -223,7 +202,7 @@
char **argv __attribute__((unused)),
char **envp __attribute__((unused)))
{
- global_sasl_init(1, 1, mysasl_cb);
+ global_sasl_init(0, 1, mysasl_cb);
/* open mailboxes */
mboxlist_init(0);
@@ -372,79 +351,3 @@
return SASL_OK;
}
-
-/* we've authenticated the client, we've connected to the backend.
- now it's all up to them */
-static void bitpipe(void)
-{
- struct protgroup *protin = protgroup_new(2);
- struct protgroup *protout = NULL;
- struct timeval timeout;
- int n, shutdown = 0;
- char buf[4096];
-
- /* Reset protin to all zeros (to preserve memory allocation) */
- protgroup_reset(protin);
- protgroup_insert(protin, sieved_in);
- protgroup_insert(protin, backend->in);
-
- for (;;) {
- /* check for shutdown file */
- if (shutdown_file(buf, sizeof(buf))) {
- shutdown = 1;
- goto done;
- }
-
- /* Clear protout if needed */
- protgroup_free(protout);
- protout = NULL;
-
- timeout.tv_sec = 60;
- timeout.tv_usec = 0;
-
- n = prot_select(protin, PROT_NO_FD, &protout, NULL, &timeout);
- if (n == -1) {
- syslog(LOG_ERR, "prot_select() failed in bitpipe(): %m");
- fatal("prot_select() failed in bitpipe()", EC_TEMPFAIL);
- }
- if (n && protout) {
- struct protstream *ptmp;
-
- for (; n; n--) {
- ptmp = protgroup_getelement(protout, n-1);
-
- if (ptmp == sieved_in) {
- do {
- int c = prot_read(sieved_in, buf, sizeof(buf));
- if (c == 0 || c < 0) goto done;
- prot_write(backend->out, buf, c);
- } while (sieved_in->cnt > 0);
- prot_flush(backend->out);
- }
- else if (ptmp == backend->in) {
- do {
- int c = prot_read(backend->in, buf, sizeof(buf));
- if (c == 0 || c < 0) goto done;
- prot_write(sieved_out, buf, c);
- } while (backend->in->cnt > 0);
- prot_flush(sieved_out);
- }
- else {
- /* XXX shouldn't get here !!! */
- fatal("unknown protstream returned by prot_select in bitpipe()",
- EC_SOFTWARE);
- }
- }
- }
- }
-
-
- done:
- /* ok, we're done. */
- protgroup_free(protin);
- protgroup_free(protout);
-
- if (shutdown) prot_printf(sieved_out, "NO \"%s\"\r\n", buf);
-
- return;
-}
More information about the Pkg-Cyrus-imapd-Debian-devel
mailing list