Changeset 3301
- Timestamp:
- 01/27/08 18:09:53
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-filter-driver.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-filter-search.c (modified) (7 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-folder-summary.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-folder-summary.h (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-gpg-context.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-mime-utils.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-net-utils.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-private.h (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-session.c (modified) (5 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-session.h (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap4/camel-imap4-store.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imapp/camel-imapp-store.c (modified) (2 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/nntp/camel-nntp-auth.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/nntp/camel-nntp-store.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/smtp/camel-smtp-transport.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3300 r3301 2 2 3 3 * Various code improvements 4 * Merged camel-lite with upstream camel revision 8428 4 5 5 6 2008-01-26 Philip Van Hoof <pvanhoof@gnome.org> trunk/libtinymail-camel/camel-lite/ChangeLog
r3246 r3301 2 2 this version, and the other way around). Changes to camel-lite that are 3 3 related to Tinymail go into ../../ChangeLog 4 5 2008-01-27 Philip Van Hoof <pvanhoof@gnome.org> 6 7 * Merged with Camel upstream rev. 8428 4 8 5 9 2008-01-12 Philip Van Hoof <pvanhoof@gnome.org> trunk/libtinymail-camel/camel-lite/camel/camel-filter-driver.c
r3200 r3301 32 32 #include <time.h> 33 33 34 #include <glib.h> 35 #include <glib/gstdio.h> 36 #include <glib/gi18n-lib.h> 37 34 38 #ifndef G_OS_WIN32 35 39 #include <sys/wait.h> 36 40 #endif 37 38 #include <glib.h>39 #include <glib/gstdio.h>40 #include <glib/gi18n-lib.h>41 41 42 42 #include <libedataserver/e-sexp.h> trunk/libtinymail-camel/camel-lite/camel/camel-filter-search.c
r2950 r3301 39 39 #include <unistd.h> 40 40 41 #include <glib.h> 42 #include <glib/gi18n-lib.h> 43 41 44 #ifndef G_OS_WIN32 42 45 #include <sys/wait.h> 43 46 #endif 44 45 #include <glib.h>46 #include <glib/gi18n-lib.h>47 47 48 48 #include <libedataserver/e-iconv.h> … … 59 59 #include "camel-stream-fs.h" 60 60 #include "camel-stream-mem.h" 61 #include "camel-string-utils.h" 61 62 #include "camel-url.h" 62 63 … … 94 95 static ESExpResult *get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); 95 96 static ESExpResult *pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); 97 98 #ifdef NON_TINYMAIL_FEATURES 96 99 static ESExpResult *junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); 100 #endif 97 101 98 102 /* builtin functions */ … … 123 127 { "get-size", (ESExpFunc *) get_size, 0 }, 124 128 { "pipe-message", (ESExpFunc *) pipe_message, 0 }, 129 #ifdef NON_TINYMAIL_FEATURES 125 130 { "junk-test", (ESExpFunc *) junk_test, 0 }, 131 #endif 126 132 }; 127 133 … … 645 651 } 646 652 653 #ifdef NON_TINYMAIL_FEATURES 647 654 static ESExpResult * 648 655 junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) … … 650 657 ESExpResult *r; 651 658 gboolean retval = FALSE; 652 659 660 d(printf("doing junk test for message from '%s'\n", camel_message_info_from (fms->info))); 653 661 if (fms->session->junk_plugin != NULL) { 654 retval = camel_junk_plugin_check_junk (fms->session->junk_plugin, camel_filter_search_get_message (fms, f)); 662 CamelMessageInfo *info = fms->info; 663 const GHashTable *ht = camel_session_get_junk_headers (fms->session); 664 struct _camel_header_param *node = ((CamelMessageInfoBase *)info)->headers; 665 666 while (node && !retval) { 667 if (node->name) { 668 char *value = (char *) g_hash_table_lookup ((GHashTable *) ht, node->name); 669 d(printf("JunkCheckMatch: %s %s %s\n", node->name, node->value, value)); 670 if (value) 671 retval = camel_strstrcase(node->value, value) != NULL; 672 673 } 674 node = node->next; 675 } 676 if (camel_debug ("junk")) 677 printf("filtered based on junk header ? %d\n", retval); 678 if (!retval) { 679 retval = camel_session_lookup_addressbook (fms->session, camel_message_info_from (info)) != TRUE; 680 if (camel_debug ("junk")) 681 printf("Sender '%s' in book? %d\n", camel_message_info_from (info), !retval); 682 683 if (retval) /* Not in book. Could be spam. So check for it*/ { 684 d(printf("filtering message\n")); 685 retval = camel_junk_plugin_check_junk (fms->session->junk_plugin, camel_filter_search_get_message (fms, f)); 686 } 687 } 655 688 656 689 if (camel_debug ("junk")) … … 663 696 return r; 664 697 } 698 #endif 665 699 666 700 /** trunk/libtinymail-camel/camel-lite/camel/camel-folder-summary.c
r3287 r3301 2572 2572 camel_flag_list_free(&mi->user_flags); 2573 2573 camel_tag_list_free(&mi->user_tags); 2574 if (mi->headers) 2575 camel_header_param_list_free (mi->headers); 2574 2576 #endif 2575 2577 trunk/libtinymail-camel/camel-lite/camel/camel-folder-summary.h
r3287 r3301 161 161 /* tree of content description - NULL if it is not available */ 162 162 CamelMessageContentInfo *content; /* 4 bytes */ 163 #ifdef NON_TINYMAIL_FEATURES 164 struct _camel_header_param *headers; 165 #endif 163 166 CamelSummaryMessageID message_id; /* 8 bytes */ 164 167 trunk/libtinymail-camel/camel-lite/camel/camel-gpg-context.c
r2950 r3301 43 43 #include <sys/types.h> 44 44 45 #include <glib.h> 46 #include <glib/gi18n-lib.h> 47 #include <glib/gstdio.h> 48 45 49 #ifndef G_OS_WIN32 46 50 #include <sys/ioctl.h> … … 49 53 #include <termios.h> 50 54 #endif 51 52 #include <glib.h>53 #include <glib/gi18n-lib.h>54 #include <glib/gstdio.h>55 55 56 56 #include <libedataserver/e-iconv.h> … … 824 824 825 825 if (!strncmp ((char *) status, "passphrase.pin.ask", 18)) { 826 prompt = g_strdup_printf (_("You need a PIN to unlock the key for your\n" 827 "SmartCard: \"%s\""), name); 826 prompt = g_markup_printf_escaped ( 827 _("You need a PIN to unlock the key for your\n" 828 "SmartCard: \"%s\""), name); 828 829 } else if (!strncmp ((char *) status, "passphrase.enter", 16)) { 829 prompt = g_strdup_printf (_("You need a passphrase to unlock the key for\n" 830 "user: \"%s\""), name); 830 prompt = g_markup_printf_escaped ( 831 _("You need a passphrase to unlock the key for\n" 832 "user: \"%s\""), name); 831 833 } else { 832 834 next_token ((char *) status, &prompt); trunk/libtinymail-camel/camel-lite/camel/camel-mime-utils.c
r3274 r3301 1395 1395 1396 1396 while (inlen) { 1397 s ize_t convlen, proclen;1397 ssize_t convlen, proclen; 1398 1398 int i; 1399 1399 … … 1426 1426 convlen += 3; 1427 1427 } 1428 1428 1429 if (proclen >= 0 && proclen < i && convlen < (75 - strlen("=?utf-8?q?\?="))) 1429 1430 proclen = i; 1431 1430 1432 /* well, we probably have broken utf8, just copy it anyway what the heck */ 1431 1433 if (proclen == -1) { … … 1433 1435 proclen = inlen; 1434 1436 } 1437 1435 1438 memcpy(out, inptr, proclen); 1436 1439 inptr += proclen; trunk/libtinymail-camel/camel-lite/camel/camel-net-utils.c
r3119 r3301 30 30 #include <stdio.h> 31 31 32 #include <glib.h> 33 #include <glib/gi18n-lib.h> 34 32 35 #ifndef G_OS_WIN32 33 36 #include <sys/poll.h> … … 35 38 36 39 #include <string.h> 37 38 #include <glib.h>39 #include <glib/gi18n-lib.h>40 40 41 41 #include <libedataserver/e-msgport.h> trunk/libtinymail-camel/camel-lite/camel/camel-private.h
r3239 r3301 100 100 101 101 GHashTable *thread_msg_op; 102 GHashTable *junk_headers; 103 102 104 }; 103 105 trunk/libtinymail-camel/camel-lite/camel/camel-session.c
r2950 r3301 80 80 session->priv->thread_active = g_hash_table_new(NULL, NULL); 81 81 session->priv->thread_pool = NULL; 82 session->priv->junk_headers = NULL; 82 83 } 83 84 … … 100 101 g_mutex_free(session->priv->lock); 101 102 g_mutex_free(session->priv->thread_lock); 102 103 if (session->priv->junk_headers) { 104 g_hash_table_remove_all (session->priv->junk_headers); 105 g_hash_table_destroy (session->priv->junk_headers); 106 } 103 107 g_free(session->priv); 104 108 } … … 433 437 } 434 438 439 gboolean 440 camel_session_lookup_addressbook (CamelSession *session, const char *name) 441 { 442 g_return_val_if_fail (CAMEL_IS_SESSION (session), FALSE); 443 g_return_val_if_fail (name != NULL, FALSE); 444 return CS_CLASS (session)->lookup_addressbook (session, name); 445 } 446 435 447 /** 436 448 * camel_session_alert_user_with_id: … … 472 484 } 473 485 486 /** 487 * camel_session_build_password_prompt: 488 * @type: account type (e.g. "IMAP") 489 * @user: user name for the account 490 * @host: host name for the account 491 * 492 * Constructs a localized password prompt from @type, @user and @host, 493 * suitable for passing to camel_session_get_password(). The resulting 494 * string contains markup tags. Use g_free() to free it. 495 * 496 * Returns: a newly-allocated password prompt string 497 **/ 498 char * 499 camel_session_build_password_prompt (const char *type, 500 const char *user, 501 const char *host) 502 { 503 char *user_markup; 504 char *host_markup; 505 char *prompt; 506 507 g_return_val_if_fail (type != NULL, NULL); 508 g_return_val_if_fail (user != NULL, NULL); 509 g_return_val_if_fail (host != NULL, NULL); 510 511 /* Add bold tags to the "user" and "host" strings. We use 512 * separate strings here to avoid putting markup tags in the 513 * translatable string below. */ 514 user_markup = g_markup_printf_escaped ("<b>%s</b>", user); 515 host_markup = g_markup_printf_escaped ("<b>%s</b>", host); 516 517 /* Translators: The first argument is the account type 518 * (e.g. "IMAP"), the second is the user name, and the 519 * third is the host name. */ 520 prompt = g_strdup_printf ( 521 _("Please enter the %s password for %s on host %s."), 522 type, user_markup, host_markup); 523 524 g_free (user_markup); 525 g_free (host_markup); 526 527 return prompt; 528 } 474 529 475 530 /** … … 747 802 session->network_state = network_state; 748 803 } 804 805 void 806 camel_session_set_junk_headers (CamelSession *session, const char **headers, const char **values, int len) 807 { 808 int i; 809 810 if (session->priv->junk_headers) { 811 g_hash_table_remove_all (session->priv->junk_headers); 812 g_hash_table_destroy (session->priv->junk_headers); 813 } 814 815 session->priv->junk_headers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); 816 817 for (i=0; i<len; i++) { 818 g_hash_table_insert (session->priv->junk_headers, g_strdup (headers[i]), g_strdup(values[i])); 819 } 820 } 821 822 const GHashTable * 823 camel_session_get_junk_headers (CamelSession *session) 824 { 825 return session->priv->junk_headers; 826 } trunk/libtinymail-camel/camel-lite/camel/camel-session.h
r2950 r3301 110 110 void (*thread_wait)(CamelSession *session, int id); 111 111 void (*thread_status)(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc); 112 gboolean (*lookup_addressbook) (CamelSession *session, const char *name); 112 113 } CamelSessionClass; 113 114 … … 169 170 CamelService *service); 170 171 172 char * camel_session_build_password_prompt 173 (const char *type, 174 const char *user, 175 const char *host); 176 171 177 gboolean camel_session_is_online (CamelSession *session); 172 178 void camel_session_set_online (CamelSession *session, … … 206 212 gboolean camel_session_get_network_state (CamelSession *session); 207 213 void camel_session_set_network_state (CamelSession *session, gboolean network_state); 214 const GHashTable * camel_session_get_junk_headers (CamelSession *session); 215 void camel_session_set_junk_headers (CamelSession *session, const char **headers, const char **values, int len); 216 gboolean camel_session_lookup_addressbook (CamelSession *session, const char *name); 208 217 209 218 G_END_DECLS trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r3299 r3301 2166 2166 } 2167 2167 2168 imap_uid_array_free (src); 2169 imap_uid_array_free (dest); 2168 if (src) 2169 imap_uid_array_free (src); 2170 if (dest) 2171 imap_uid_array_free (dest); 2170 2172 lose: 2171 2173 g_warning ("Bad COPYUID response from server"); … … 3046 3048 3047 3049 return; 3050 } 3051 3052 #endif 3053 3054 3055 #ifdef NON_TINYMAIL_FEATURES 3056 3057 struct _junk_data { 3058 GData *data; 3059 CamelMessageInfoBase *mi; 3060 }; 3061 3062 static void 3063 construct_junk_headers (char *header, char *value, struct _junk_data *jdata) 3064 { 3065 char *bs, *es, *flag=NULL; 3066 char *bdata = g_datalist_get_data (&(jdata->data), "BODY_PART_DATA"); 3067 struct _camel_header_param *node; 3068 3069 /* FIXME: This can be written in a much clever way. 3070 * We can create HEADERS file or carry all headers till filtering so 3071 * that header based filtering can be much faster. But all that later. */ 3072 bs = camel_strstrcase (bdata ? bdata:"", header); 3073 if (bs) { 3074 bs += strlen(header); 3075 bs = strchr (bs, ':'); 3076 if (bs) { 3077 bs++; 3078 while (*bs == ' ') 3079 bs++; 3080 es = strchr (bs, '\n'); 3081 if (es) 3082 flag = g_strndup (bs, es-bs); 3083 else 3084 bs = NULL; 3085 } 3086 3087 } 3088 3089 3090 if (bs) { 3091 node = g_new (struct _camel_header_param, 1); 3092 node->name = g_strdup (header); 3093 node->value = flag; 3094 node->next = jdata->mi->headers; 3095 jdata->mi->headers = node; 3096 } 3048 3097 } 3049 3098 trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r3280 r3301 1717 1717 1718 1718 if (!service->url->passwd) { 1719 char *prompt; 1720 1721 prompt = g_strdup_printf (_("%sPlease enter the IMAP " 1722 "password for %s@%s"), 1723 errbuf ? errbuf : "", 1724 service->url->user, 1725 service->url->host); 1726 1727 service->url->passwd = 1728 camel_session_get_password (session, service, auth_domain, 1729 prompt, "password", CAMEL_SESSION_PASSWORD_SECRET, ex); 1730 g_free (prompt); 1719 char *base_prompt; 1720 char *full_prompt; 1721 1722 base_prompt = camel_session_build_password_prompt ( 1723 "IMAP", service->url->user, service->url->host); 1724 1725 if (errbuf != NULL) 1726 full_prompt = g_strconcat (errbuf, base_prompt, NULL); 1727 else 1728 full_prompt = g_strdup (base_prompt); 1729 1730 service->url->passwd = camel_session_get_password ( 1731 session, service, auth_domain, full_prompt, 1732 "password", CAMEL_SESSION_PASSWORD_SECRET, ex); 1733 1734 g_free (base_prompt); 1735 g_free (full_prompt); 1731 1736 g_free (errbuf); 1732 1737 errbuf = NULL; … … 1784 1789 return FALSE; 1785 1790 1786 errbuf = g_strdup_printf (_("Unable to authenticate " 1791 errbuf = g_markup_escaped_text ( 1792 _("Unable to authenticate " 1787 1793 "to IMAP server.\n%s\n\n"), 1788 1794 camel_exception_get_description (ex)); trunk/libtinymail-camel/camel-lite/camel/providers/imap4/camel-imap4-store.c
r2950 r3301 453 453 if ((!mech || (mech && mech->need_password)) && !service->url->passwd) { 454 454 guint32 flags = CAMEL_SESSION_PASSWORD_SECRET; 455 char *prompt; 455 char *base_prompt; 456 char *full_prompt; 456 457 457 458 if (reprompt) 458 459 flags |= CAMEL_SESSION_PASSWORD_REPROMPT; 459 460 460 prompt = g_strdup_printf (_("%sPlease enter the IMAP password for %s on host %s"), 461 errmsg ? errmsg : "", 462 service->url->user, 463 service->url->host); 464 465 service->url->passwd = camel_session_get_password (session, service, NULL, prompt, "password", flags, ex); 466 467 g_free (prompt); 461 base_prompt = camel_session_build_password_prompt ( 462 "IMAP", service->url->user, service->url->host); 463 464 if (errmsg != NULL) 465 full_prompt = g_strconcat (errmsg, base_prompt, NULL); 466 else 467 full_prompt = g_strdup (full_prompt); 468 469 service->url->passwd = camel_session_get_password ( 470 session, service, NULL, full_prompt, 471 "password", flags, ex); 472 473 g_free (base_prompt); 474 g_free (full_prompt); 468 475 469 476 if (!service->url->passwd) … … 534 541 while (imap4_try_authenticate (engine, reprompt, errmsg, &lex)) { 535 542 g_free (errmsg); 536 errmsg = g_ strdup (lex.desc);543 errmsg = g_markup_escape_text (lex.desc, -1); 537 544 camel_exception_clear (&lex); 538 545 g_free (service->url->passwd); trunk/libtinymail-camel/camel-lite/camel/providers/imapp/camel-imapp-store.c
r2950 r3301 358 358 { 359 359 if (((CamelService *)store)->url->passwd == NULL) { 360 char *prompt; 360 char *base_prompt; 361 char *full_prompt; 361 362 CamelException ex; 362 363 363 364 camel_exception_init(&ex); 364 365 365 prompt = g_strdup_printf (_("%sPlease enter the IMAP password for %s@%s"), 366 store->login_error?store->login_error:"", 367 ((CamelService *)store)->url->user, 368 ((CamelService *)store)->url->host); 369 ((CamelService *)store)->url->passwd = camel_session_get_password(camel_service_get_session((CamelService *)store), 370 (CamelService *)store, NULL, 371 prompt, "password", CAMEL_SESSION_PASSWORD_SECRET, &ex); 372 g_free (prompt); 366 base_prompt = camel_session_build_password_prompt ( 367 "IMAP", ((CamelService *) store)->url->user, 368 ((CamelService *) store)->url->host); 369 370 if (store->login_error != NULL) 371 full_prompt = g_strconcat (store->login_error, base_prompt, NULL); 372 else 373 full_prompt = g_strdup (base_prompt); 374 375 ((CamelService *)store)->url->passwd = camel_session_get_password ( 376 camel_service_get_session ((CamelService *) store), 377 (CamelService *) store, NULL, full_prompt, "password", 378 CAMEL_SESSION_PASSWORD_SECRET, &ex); 379 380 g_free (base_prompt); 381 g_free (full_prompt); 373 382 if (camel_exception_is_set(&ex)) 374 383 camel_exception_throw_ex(&ex); … … 439 448 switch (e->id) { 440 449 case CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE: 441 store->login_error = g_ strdup_printf("%s\n\n", e->desc);450 store->login_error = g_markup_printf_escaped("%s\n\n", e->desc); 442 451 camel_session_forget_password(service->session, service, NULL, "password", ex); 443 452 camel_url_set_passwd(service->url, NULL); trunk/libtinymail-camel/camel-lite/camel/providers/nntp/camel-nntp-auth.c
r2950 r3301 44 44 gchar *prompt; 45 45 46 prompt = g_strdup_printf (_("Please enter the NNTP password for %s@%s"), 47 service->url->user, service->url->host); 48 service->url->passwd = 49 camel_session_get_password (session, prompt, 50 TRUE, service, "password", ex); 46 prompt = camel_session_build_password_prompt ( 47 "NNTP", service->url->user, service->url->host); 48 49 service->url->passwd = camel_session_get_password ( 50 session, prompt, TRUE, service, "password", ex); 51 51 52 g_free (prompt); 52 53 trunk/libtinymail-camel/camel-lite/camel/providers/nntp/camel-nntp-store.c
r2967 r3301 1160 1160 char *prompt, *base; 1161 1161 retry: 1162 base = g_strdup_printf (_("Please enter the NNTP password for %s@%s"), 1163 service->url->user, 1164 service->url->host); 1162 base = camel_session_build_password_prompt ( 1163 "NNTP", service->url->user, service->url->host); 1165 1164 if (line) { 1166 char *top = g_strdup_printf(_("Cannot authenticate to server: %s"), line); 1165 char *top = g_markup_printf_escaped ( 1166 _("Cannot authenticate to server: %s"), line); 1167 1167 1168 1168 prompt = g_strdup_printf("%s\n\n%s", top, base); trunk/libtinymail-camel/camel-lite/camel/providers/pop3/camel-pop3-store.c
r3280 r3301 729 729 730 730 if (!service->url->passwd) { 731 char *prompt; 731 char *base_prompt; 732 char *full_prompt; 732 733 guint32 flags = CAMEL_SESSION_PASSWORD_SECRET; 733 734 … … 735 736 flags |= CAMEL_SESSION_PASSWORD_REPROMPT; 736 737 737 prompt = g_strdup_printf (_("%sPlease enter the POP password for %s on host %s"), 738 errmsg ? errmsg : "", 739 service->url->user, 740 service->url->host); 741 service->url->passwd = camel_session_get_password (camel_service_get_session (service), service, NULL, 742 prompt, "password", flags, ex); 743 g_free (prompt); 738 base_prompt = camel_session_build_password_prompt ( 739 "POP", service->url->user, service->url->host); 740 741 if (errmsg != NULL) 742 full_prompt = g_strconcat (errmsg, base_prompt, NULL); 743 else 744 full_prompt = g_strdup (base_prompt); 745 746 service->url->passwd = camel_session_get_password ( 747 camel_service_get_session (service), service, 748 NULL, full_prompt, "password", flags, ex); 749 750 g_free (base_prompt); 751 g_free (full_prompt); 744 752 if (!service->url->passwd) 745 753 return FALSE; … … 890 898 /* we only re-prompt if we failed to authenticate, any other error and we just abort */ 891 899 if (status == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE) { 892 errbuf = g_ strdup_printf("%s\n\n", camel_exception_get_description (ex));900 errbuf = g_markup_printf_escaped ("%s\n\n", camel_exception_get_description (ex)); 893 901 g_free (service->url->passwd); 894 902 service->url->passwd = NULL; trunk/libtinymail-camel/camel-lite/camel/providers/smtp/camel-smtp-transport.c
r3239 r3301 549 549 550 550 if (!service->url->passwd) { 551 char *prompt; 552 553 prompt = g_strdup_printf (_("%sPlease enter the SMTP password for %s on host %s"), 554 errbuf ? errbuf : "", service->url->user, 555 service->url->host); 556 557 service->url->passwd = camel_session_get_password (session, service, NULL, 558 prompt, "password", CAMEL_SESSION_PASSWORD_SECRET, ex); 559 560 g_free (prompt); 551 char *base_prompt; 552 char *full_prompt; 553 554 base_prompt = camel_session_build_password_prompt ( 555 "SMTP", service->url->user, service->url->host); 556 557 if (errbuf != NULL) 558 full_prompt = g_strconcat (errbuf, base_prompt, NULL); 559 else 560 full_prompt = g_strdup (base_prompt); 561 562 service->url->passwd = camel_session_get_password ( 563 session, service, NULL, full_prompt, 564 "password", CAMEL_SESSION_PASSWORD_SECRET, ex); 565 566 g_free (base_prompt); 567 g_free (full_prompt); 561 568 g_free (errbuf); 562 569 errbuf = NULL; … … 570 577 authenticated = smtp_auth (transport, authtype->authproto, ex); 571 578 if (!authenticated) { 572 errbuf = g_strdup_printf (_("Unable to authenticate " 573 "to SMTP server.\n%s\n\n"), 574 camel_exception_get_description (ex)); 579 errbuf = g_markup_printf_escaped ( 580 _("Unable to authenticate " 581 "to SMTP server.\n%s\n\n"), 582 camel_exception_get_description (ex)); 575 583 camel_exception_clear (ex); 576 584 }
