Tommi Komulainen's keepalive patch for edit sessions may work for you,
though. Committed to CVS late November 1999, I think.
-* Sometimes hdr->env seems to be NULL, according to other users' core
- files. I haven't been able to reproduce this, and am not sure how
- to track it down. But it's very naughty indeed. It appears to be the
- result of spurious mx_close_mailbox calls handling the untagged
- BYE response.
-
* Mutt is uninterruptible during socket calls. We should handle SIGINT.
* Server copy currently doesn't take into account uncommitted changes in
* The mutt_pretty routines don't work well when the delimiter isn't '/'.
Brendan Cully <brendan@kublai.com>
-Updated 20000719
+Updated 20000731
rc = sasl_client_start (saslconn, idata->capstr, NULL, NULL, &pc, &olen,
&mech);
- client_start = (pc != NULL);
+ client_start = (olen > 0);
if (rc != SASL_OK && rc != SASL_CONTINUE)
{
goto bail;
if (!mutt_strncmp (buf, "+ ", 2))
+ {
if (sasl_decode64 (buf+2, strlen (buf+2), buf, &len) != SASL_OK)
{
dprint (1, (debugfile, "imap_auth_sasl: error base64-decoding server response.\n"));
goto bail;
}
+ }
+ else if ((buf[0] == '*'))
+ {
+ if (imap_handle_untagged (idata, buf))
+ goto bail;
+ else continue;
+ }
if (!client_start)
rc = sasl_client_step (saslconn, buf, len, NULL, &pc, &olen);
- client_start = 0;
+ else
+ client_start = 0;
- if (olen)
+ /* send out response, or line break if none needed */
+ if (olen && sasl_encode64 (pc, olen, buf, sizeof (buf), &olen) != SASL_OK)
+ {
+ dprint (1, (debugfile, "imap_auth_sasl: error base64-encoding client response.\n"));
+ goto bail;
+ }
+
+ if (olen || rc == SASL_CONTINUE)
{
- /* send out response, or line break if none needed */
- if (sasl_encode64 (pc, olen, buf, sizeof (buf), &olen) != SASL_OK)
- {
- dprint (1, (debugfile, "imap_auth_sasl: error base64-encoding client response.\n"));
- goto bail;
- }
-
strfcpy (buf + olen, "\r\n", sizeof (buf) - olen);
mutt_socket_write (idata->conn, buf);
}
}
+ while (mutt_strncmp (buf, idata->seq, SEQLEN))
+ if (mutt_socket_readln (buf, sizeof (buf), idata->conn) < 0)
+ goto bail;
+
if (rc != SASL_OK)
goto bail;
return -1;
}
+#if 1
if (r == 1 && c != '\n')
fputc ('\r', fp);
}
else
r = 0;
-
+#endif
fputc (c, fp);
#ifdef DEBUG
if (debuglevel >= IMAP_LOG_LTRL)
int ssl_socket_write (CONNECTION * conn, const char *buf)
{
sslsockdata *data = conn->sockdata;
- dprint (1, (debugfile, "ssl_socket_write():%s", buf));
return SSL_write (data->ssl, buf, mutt_strlen (buf));
}
#include <sasl.h>
-static sasl_callback_t mutt_sasl_callbacks[3];
+static sasl_callback_t mutt_sasl_callbacks[4];
/* callbacks */
static int mutt_sasl_cb_log (void* context, int priority, const char* message);
callback->context = account;
callback++;
+ callback->id = SASL_CB_USER;
+ callback->proc = mutt_sasl_cb_authname;
+ callback->context = account;
+ callback++;
+
callback->id = SASL_CB_PASS;
callback->proc = mutt_sasl_cb_pass;
callback->context = account;
return SASL_OK;
}
-/* mutt_sasl_cb_authname: callback to retrieve authname from ACCOUNT */
+/* mutt_sasl_cb_authname: callback to retrieve authname or user (mutt
+ * doesn't distinguish, even if some SASL plugins do) from ACCOUNT */
static int mutt_sasl_cb_authname (void* context, int id, const char** result,
unsigned* len)
{
if (!account)
return SASL_BADPARAM;
- dprint (2, (debugfile, "mutt_sasl_cb_authname: getting user for %s:%u\n",
+ dprint (2, (debugfile, "mutt_sasl_cb_authname: getting %s for %s:%u\n",
+ id == SASL_CB_AUTHNAME ? "authname" : "user",
account->host, account->port));
if (mutt_account_getuser (account))