[PATCH] assorted fixes
The attached patches are all various things we've been carrying
here @ Red Hat.
- mutt-default.patch
Support for the 'default' color in Slang. Of course, we're using
ncursesw these days with mutt.
- mutt-1.2.5-muttbug-tmp.patch
Uses the mktemp command with -d to make a temporary directory/file.
Probably not portable enough for general use.
- mutt-1.4.1-muttrc.patch
Changes the sample.muttrc highlight to catch https URLs as well.
- mutt-1.4.1-rfc1734.patch
When using SASL for POP, use 'pop' as the service name, per RFC 1734.
- mutt-1.4.1-plain.patch
With SASL, expect the server to prompt for additional auth data if we
have some to send (#129961, upstream #1845)
All are against 1.4.1, but apply to 1.5.6.
(There's also a couple of random customization patches, not posting
here.)
Bill
diff -ru cow/mutt-0.95.6-us/color.c mutt-0.95.6-us/color.c
--- cow/mutt-0.95.6-us/color.c Thu Jun 3 16:43:01 1999
+++ mutt-0.95.6-us/color.c Tue Jun 22 16:28:24 1999
@@ -155,7 +155,7 @@
#ifdef USE_SLANG_CURSES
static char * get_color_name (int val)
{
- static char * missing[3] = {"brown", "lightgray", ""};
+ static char * missing[3] = {"brown", "lightgray", "default"};
int i;
switch (val)
diff -ru cow/mutt-0.95.6-us/main.c mutt-0.95.6-us/main.c
--- cow/mutt-0.95.6-us/main.c Thu Jun 3 16:43:19 1999
+++ mutt-0.95.6-us/main.c Tue Jun 22 16:29:29 1999
@@ -256,6 +256,7 @@
#ifdef USE_SLANG_CURSES
SLtt_Ignore_Beep = 1; /* don't do that #*$@^! annoying visual beep! */
SLsmg_Display_Eight_Bit = 128; /* characters above this are printable */
+ SLtt_set_color(0, NULL, "default", "default");
#else
/* should come before initscr() so that ncurses 4.2 doesn't try to install
its own SIGWINCH handler */
--- mutt-1.2.5/muttbug.sh.in.foo Mon May 14 10:09:57 2001
+++ mutt-1.2.5/muttbug.sh.in Mon May 14 10:12:41 2001
@@ -85,13 +85,8 @@
exec > /dev/tty
exec < /dev/tty
-SCRATCH=${TMPDIR-/tmp}/`basename $0`.`hostname`.$$
-
-mkdir ${SCRATCH} || \
-{
- echo "`basename $0`: Can't create temporary directory." >& 2 ;
- exit 1 ;
-}
+TMP=${TMPDIR-/tmp}/`basename $0`.`hostname`
+SCRATCH=`mktemp -d $TMP.XXXXXX || exit 1`
trap "rm -r -f ${SCRATCH} ; trap '' 0 ; exit" 0 1 2
--- mutt-1.4.1/contrib/sample.muttrc.foo 2003-03-19 21:09:41.000000000
-0500
+++ mutt-1.4.1/contrib/sample.muttrc 2003-03-19 21:10:00.000000000 -0500
@@ -142,7 +142,7 @@
color search default green # how to hilite search patterns in the pager
color header brightred default ^(From|Subject):
-color body magenta default "(ftp|http)://[^ ]+" # point out URLs
+color body magenta default "(ftp|http|https)://[^ ]+" # point out URLs
color body magenta default [-a-z_0-9.]+@[-a-z_0-9.]+ # e-mail addresses
color underline brightgreen default
RFC 1734 suggests that when using SASL to authenticate a POP connection, the
service name should be "pop".
--- mutt-1.4.1/mutt_sasl.c 2004-09-15 14:40:03.000000000 -0400
+++ mutt-1.4.1/mutt_sasl.c 2004-09-15 14:39:53.000000000 -0400
@@ -109,7 +109,7 @@
service = "imap";
break;
case M_ACCT_TYPE_POP:
- service = "pop-3";
+ service = "pop";
break;
default:
dprint (1, (debugfile, "mutt_sasl_client_new: account type unset\n"));
If we have data which needs to be sent, expect the server to ask for it.
--- mutt-1.4.1/imap/auth_sasl.c 2004-09-15 16:15:12.000000000 -0400
+++ mutt-1.4.1/imap/auth_sasl.c 2004-09-15 16:15:26.000000000 -0400
@@ -95,7 +95,7 @@
irc = IMAP_CMD_CONTINUE;
/* looping protocol */
- while (rc == SASL_CONTINUE)
+ while ((rc == SASL_CONTINUE) || (olen > 0))
{
do
irc = imap_cmd_step (idata);
@@ -149,6 +149,8 @@
mutt_socket_write (idata->conn, "*\r\n");
dprint (1, (debugfile, "imap_auth_sasl: sasl_client_step error
%d\n",rc));
}
+
+ olen = 0;
}
while (irc != IMAP_CMD_OK)
--- mutt-1.4.1/pop_auth.c 2004-09-15 19:26:45.000000000 -0400
+++ mutt-1.4.1/pop_auth.c 2004-09-15 19:26:47.000000000 -0400
@@ -75,12 +75,11 @@
mutt_message _("Authenticating (SASL)...");
snprintf (buf, sizeof (buf), "AUTH %s", mech);
- olen = strlen (buf);
/* looping protocol */
FOREVER
{
- strfcpy (buf + olen, "\r\n", sizeof (buf) - olen);
+ strfcpy (buf + strlen (buf), "\r\n", sizeof (buf) - strlen (buf));
mutt_socket_write (pop_data->conn, buf);
if (mutt_socket_readln (inbuf, sizeof (inbuf), pop_data->conn) < 0)
{
@@ -89,7 +88,7 @@
return POP_A_SOCKET;
}
- if (rc != SASL_CONTINUE)
+ if ((rc != SASL_CONTINUE) && (client_start == 0))
break;
if (mutt_strncmp (inbuf, "+ ", 2))
@@ -124,6 +123,9 @@
goto bail;
}
}
+ else
+ olen = 0;
+ buf[olen] = '\0';
}
if (rc != SASL_OK)