Changeset 3713
- Timestamp:
- 07/01/08 17:42:42
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-mime-utils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3712 r3713 21 21 * libtinymail-camel/tny-camel-pop-store-account.c: 22 22 Manage properly the internal inbox reference to avoid leaking it. 23 24 * libtinymail-camel/camel-lite/camel/camel-mime-utils.c: 25 Parse properly broken rfc2047 recipient headers sent from gmail imap. 23 26 24 27 2008-06-26 Philip Van Hoof <pvanhoof@gnome.org> trunk/libtinymail-camel/camel-lite/camel/camel-mime-utils.c
r3538 r3713 2463 2463 */ 2464 2464 2465 static void 2466 fix_broken_rfc2047 (const char **in) 2467 { 2468 gchar *p, *broken_start, *r; 2469 gboolean encoded = FALSE; 2470 gboolean broken = TRUE; 2471 2472 p = *in; 2473 2474 while (*p != '\0') { 2475 if (!encoded) { 2476 if (*p == '=' && *(p+1) == '?') { 2477 p++; 2478 encoded = TRUE; 2479 broken = FALSE; 2480 } 2481 } else if (!broken) { 2482 if (*p == '<') { 2483 broken = TRUE; 2484 broken_start = p; 2485 } else if ((*p == '?') && (*(p+1) == '=')) { 2486 encoded = FALSE; 2487 p++; 2488 } 2489 } else { 2490 if ((*p == '?') && (*(p+1) == '=')) { 2491 memmove (broken_start + 2, broken_start, p - broken_start); 2492 broken_start[0] = '?'; 2493 broken_start[1] = '='; 2494 broken = FALSE; 2495 encoded = FALSE; 2496 } 2497 } 2498 p++; 2499 } 2500 2501 } 2502 2465 2503 static struct _camel_header_address * 2466 2504 header_decode_mailbox(const char **in, const char *charset) … … 2475 2513 2476 2514 addr = g_string_new(""); 2515 2516 if (strncmp (inptr, "=?", 2)==0) { 2517 /* check if we've got a wrong string as gmail sends and fix it.*/ 2518 fix_broken_rfc2047 (in); 2519 } 2477 2520 2478 2521 /* for each address */
