Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 1355
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Martin Schlemmer (RETIRED) <azarah@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Preston A. Elder <prez@goth.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 1355 depends on: Show dependency tree
Bug 1355 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2002-03-26 18:19 0000
This patch should be applied, as it fixes a known bug (see URL), I have
verified
this patch works (I personally require it for correct operation of evolution):

------- Comment #1 From Preston A. Elder 2002-03-26 18:21:54 0000 -------
Since it wont let me attach a file, here is evolution-1.0.2-imapfix.patch:

diff -urN evolution-1.0.2/camel/providers/imap/camel-imap-command.c
evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-command.c
--- evolution-1.0.2/camel/providers/imap/camel-imap-command.c	Thu Jan 24 10:56:50 2002
+++ evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-command.c	Thu Feb 28 01:18:36 2002
@@ -687,10 +687,17 @@
 
				arglen += strlen (store->namespace) + 1;
 
		}
 
		g_ptr_array_add (args, string);
-
		if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS)
-
			len += arglen + 15;
+
		if (imap_needs_quoting(string))
+
		{
+
			if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS)
+
				len += arglen + 15;
+
			else
+
				len += arglen * 2;
+
		}
 
		else
-
			len += arglen * 2;
+
		{
+
			len += arglen;
+
		}
 
		start = p + 1;
 
		break;
 
		
@@ -736,14 +743,21 @@
 
		string = args->pdata[i++];
 
		if (*p == 'F')
 
			string = imap_namespace_concat (store, string);
-
		if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS) {
-
			op += sprintf (op, "{%d+}\r\n%s",
-
				       strlen (string), string);
-
		} else {
-
			char *quoted = imap_quote_string (string);
-
			
-
			op += sprintf (op, "%s", quoted);
-
			g_free (quoted);
+
		if (imap_needs_quoting(string))
+
		{
+
			if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS) {
+
				op += sprintf (op, "{%d+}\r\n%s",
+
					       strlen (string), string);
+
			} else {
+
				char *quoted = imap_quote_string (string);
+
+
				op += sprintf (op, "%s", quoted);
+
				g_free (quoted);
+
			}
+
		}
+
		else
+
		{
+
			op += sprintf(op, "%s", string);
 
		}
 
		if (*p == 'F')
 
			g_free (string);
diff -urN evolution-1.0.2/camel/providers/imap/camel-imap-utils.c
evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-utils.c
--- evolution-1.0.2/camel/providers/imap/camel-imap-utils.c	Tue Dec  4 14:20:09 2001
+++ evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-utils.c	Thu Feb 28 01:18:36 2002
@@ -270,6 +270,21 @@
 };
 #define imap_is_atom_char(ch) (isprint (ch) && !imap_atom_specials[ch])
 
+gboolean
+imap_needs_quoting(const char *in)
+{
+
size_t i, len=strlen(in);
+
if (len == 0)
+
    return TRUE;
+
for (i=0; i<len; i++)
+
{
+
	if (!imap_is_atom_char(in[i]))
+
		return TRUE;
+
}
+
return FALSE;
+}
+
+
 /**
  * imap_parse_string_generic:
  * @str_p: a pointer to a string
diff -urN evolution-1.0.2/camel/providers/imap/camel-imap-utils.h
evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-utils.h
--- evolution-1.0.2/camel/providers/imap/camel-imap-utils.h	Sat Oct 27 14:06:04 2001
+++ evolution-1.0.2+imapfix/camel/providers/imap/camel-imap-utils.h	Wed Feb 27 23:38:04 2002
@@ -49,6 +49,7 @@
 
 enum { IMAP_STRING, IMAP_NSTRING, IMAP_ASTRING };
 
+gboolean imap_needs_quoting (const char *in);
 char    *imap_parse_string_generic (char **str_p, int *len, int type);
 
 #define imap_parse_string(str_p, len_p) \

------- Comment #2 From Martin Schlemmer (RETIRED) 2002-03-28 02:46:54 0000 -------
OK, so what does it do ?  Mail me the patch to azarah@gentoo.org.

------- Comment #3 From Martin Schlemmer (RETIRED) 2002-04-01 17:14:14 0000 -------
Fixed in 1.0.3-r1.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug