2005-05-05 [paul] 1.0.4cvs7
authorPaul Mangan <paul@claws-mail.org>
Thu, 5 May 2005 07:40:44 +0000 (07:40 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 5 May 2005 07:40:44 +0000 (07:40 +0000)
backported from GTK2...

* src/compose.c
Fix 'Request return receipt' from folder
properties (bug #708)
* src/folderview.c
Fix duplicate hotkeys in Folderview's contextual
menu
* src/mainwindow.c
Fix duplicate hotkeys in Mainwindow's menu
* src/messageview.c
Fix window resizing
* src/partial_download.c
* src/pop.c
Escape login when writing uidl file
fixes bug #736
* src/prefs_account.c
Fix smtp auth type off-by-one. We forgot to
add PLAIN in the prefs-to-gui setter func and
as a result, the selected auth when opening
account prefs was not the correct one
* src/prefs_common.c
* src/prefs_common.h
* src/prefs_filtering.c
Save Filtering's window size
* src/procmime.c
Fix possible DOS in mime parser
(see bug #634)
* src/plugins/pgpmime/pgpmime.c
Fix bus error on 64bit

15 files changed:
ChangeLog.claws
PATCHSETS
configure.ac
src/compose.c
src/folderview.c
src/mainwindow.c
src/messageview.c
src/partial_download.c
src/plugins/pgpmime/pgpmime.c
src/pop.c
src/prefs_account.c
src/prefs_common.c
src/prefs_common.h
src/prefs_filtering.c
src/procmime.c

index 7465eb3..11804e4 100644 (file)
@@ -1,3 +1,36 @@
+2005-05-05 [paul]      1.0.4cvs7
+
+       backported from GTK2...
+
+       * src/compose.c
+               Fix 'Request return receipt' from folder
+               properties (bug #708)
+       * src/folderview.c
+               Fix duplicate hotkeys in Folderview's contextual
+               menu
+       * src/mainwindow.c
+               Fix duplicate hotkeys in Mainwindow's menu
+       * src/messageview.c
+               Fix window resizing
+       * src/partial_download.c
+       * src/pop.c
+               Escape login when writing uidl file
+               fixes bug #736
+       * src/prefs_account.c
+               Fix smtp auth type off-by-one. We forgot to
+               add PLAIN in the prefs-to-gui setter func and
+               as a result, the selected auth when opening
+               account prefs was not the correct one
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/prefs_filtering.c
+               Save Filtering's window size
+       * src/procmime.c
+               Fix possible DOS in mime parser
+               (see bug #634)
+       * src/plugins/pgpmime/pgpmime.c
+               Fix bus error on 64bit
+
 2005-04-13 [holger]    1.0.4cvs6
 
        * src/prefs_filtering.c
index 7752bdb..9b34faa 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.460 -r 1.461 ChangeLog; cvs diff -u -r 1.455 -r 1.456 ChangeLog.jp; cvs diff -u -r 1.20 -r 1.21 src/send_message.c; cvs diff -u -r 1.17 -r 1.18 src/common/socket.c; ) > 1.0.4cvs4.patchset
 ( cvs diff -u -r 1.78 -r 1.79 src/account.c; cvs diff -u -r 1.482 -r 1.483 src/compose.c; cvs diff -u -r 1.72 -r 1.73 src/filtering.c; cvs diff -u -r 1.179 -r 1.180 src/inc.c; cvs diff -u -r 1.124 -r 1.125 src/prefs_account.c; cvs diff -u -r 1.57 -r 1.58 src/prefs_account.h; ) > 1.0.4cvs5.patchset
 ( cvs diff -u -r 1.65 -r 1.66 src/prefs_filtering.c; ) > 1.0.4cvs6.patchset
+( cvs diff -u -r 1.483 -r 1.484 src/compose.c; cvs diff -u -r 1.259 -r 1.260 src/folderview.c; cvs diff -u -r 1.318 -r 1.319 src/mainwindow.c; cvs diff -u -r 1.136 -r 1.137 src/messageview.c; cvs diff -u -r 1.3 -r 1.4 src/partial_download.c; cvs diff -u -r 1.74 -r 1.75 src/pop.c; cvs diff -u -r 1.125 -r 1.126 src/prefs_account.c; cvs diff -u -r 1.233 -r 1.234 src/prefs_common.c; cvs diff -u -r 1.118 -r 1.119 src/prefs_common.h; cvs diff -u -r 1.66 -r 1.67 src/prefs_filtering.c; cvs diff -u -r 1.106 -r 1.107 src/procmime.c; cvs diff -u -r 1.18 -r 1.19 src/plugins/pgpmime/pgpmime.c; ) > 1.0.4cvs7.patchset
index c770c0e..b4cb48d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=6
+EXTRA_VERSION=7
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index 4492481..c947796 100644 (file)
@@ -760,7 +760,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                        compose_entry_mark_default_to(compose, item->prefs->default_to);
                }
                if (item && item->ret_rcpt) {
-                       menu_set_active(ifactory, "/Message/Request Return Receipt", TRUE);
+                       menu_set_active(ifactory, "/Options/Request Return Receipt", TRUE);
                }
        } else {
                if (mailto) {
@@ -770,7 +770,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                 * CLAWS: just don't allow return receipt request, even if the user
                 * may want to send an email. simple but foolproof.
                 */
-               menu_set_sensitive(ifactory, "/Message/Request Return Receipt", FALSE); 
+               menu_set_sensitive(ifactory, "/Options/Request Return Receipt", FALSE); 
        }
        compose_add_field_list( compose, listAddress );
 
@@ -972,7 +972,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                compose->replyinfo = procmsg_msginfo_copy(msginfo);
 
        if (msginfo->folder && msginfo->folder->ret_rcpt)
-               menu_set_active(ifactory, "/Message/Request Return Receipt", TRUE);
+               menu_set_active(ifactory, "/Options/Request Return Receipt", TRUE);
 
        /* Set save folder */
        if (msginfo->folder && msginfo->folder->prefs && msginfo->folder->prefs->save_copy_to_folder) {
index 9b55b2e..e396f9d 100644 (file)
@@ -236,15 +236,15 @@ GHashTable *folderview_popups;
 
 static GtkItemFactoryEntry folderview_common_popup_entries[] =
 {
-       {N_("/Mark all _read"),         NULL, mark_all_read_cb, 0, NULL},
+       {N_("/Mark all re_ad"),         NULL, mark_all_read_cb, 0, NULL},
        {N_("/_Search folder..."),      NULL, folderview_search_cb, 0, NULL},
        {N_("/_Properties..."),         NULL, folderview_property_cb, 0, NULL},
-       {N_("/Pr_ocessing..."),         NULL, folderview_processing_cb, 0, NULL},
+       {N_("/Process_ing..."),         NULL, folderview_processing_cb, 0, NULL},
 };
 
 static GtkItemFactoryEntry folder_view_trash_popup_entries[] = {
        {N_("/------"),                 NULL, NULL, 0, "<Separator>"},
-       {N_("/Empty trash..."),         NULL, folderview_empty_trash_cb, 0, NULL},
+       {N_("/Empty _trash..."),        NULL, folderview_empty_trash_cb, 0, NULL},
 };
 
 
index 7c145e9..91750cb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -447,7 +447,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_File/_Import mbox file..."),     NULL, import_mbox_cb, 0, NULL},
        {N_("/_File/_Export to mbox file..."),  NULL, export_mbox_cb, 0, NULL},
-       {N_("/_File/_Export selected to mbox file..."), 
+       {N_("/_File/Exp_ort selected to mbox file..."), 
                                                NULL, export_list_mbox_cb, 0, NULL},
        {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_File/Empty all _Trash folders"), "<shift>D", empty_trash_cb, 0, NULL},
@@ -645,7 +645,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Open in new _window"),      "<control><alt>N", open_msg_cb, 0, NULL},
        {N_("/_View/Mess_age source"),          "<control>U", view_source_cb, 0, NULL},
-       {N_("/_View/Show all _headers"),        "<control>H", show_all_header_cb, 0, "<ToggleItem>"},
+       {N_("/_View/Show all headers"),         "<control>H", show_all_header_cb, 0, "<ToggleItem>"},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/_Update summary"),          "<control><alt>U", update_summary_cb,  0, NULL},
 
@@ -712,19 +712,19 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, create_filter_cb, FILTER_BY_TO, NULL},
        {N_("/_Tools/_Create filter rule/by _Subject"),
                                                NULL, create_filter_cb, FILTER_BY_SUBJECT, NULL},
-       {N_("/_Tools/_Create processing rule"), NULL, NULL, 0, "<Branch>"},
-       {N_("/_Tools/_Create processing rule/_Automatically"),
+       {N_("/_Tools/C_reate processing rule"), NULL, NULL, 0, "<Branch>"},
+       {N_("/_Tools/C_reate processing rule/_Automatically"),
                                                NULL, create_processing_cb, FILTER_BY_AUTO, NULL},
-       {N_("/_Tools/_Create processing rule/by _From"),
+       {N_("/_Tools/C_reate processing rule/by _From"),
                                                NULL, create_processing_cb, FILTER_BY_FROM, NULL},
-       {N_("/_Tools/_Create processing rule/by _To"),
+       {N_("/_Tools/C_reate processing rule/by _To"),
                                                NULL, create_processing_cb, FILTER_BY_TO, NULL},
-       {N_("/_Tools/_Create processing rule/by _Subject"),
+       {N_("/_Tools/C_reate processing rule/by _Subject"),
                                                NULL, create_processing_cb, FILTER_BY_SUBJECT, NULL},
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
        {N_("/_Tools/Actio_ns"),                NULL, NULL, 0, "<Branch>"},
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
-       {N_("/_Tools/_Check for new messages in all folders"),
+       {N_("/_Tools/Ch_eck for new messages in all folders"),
                                                NULL, update_folderview_cb, 0, NULL},
        {N_("/_Tools/Delete du_plicated messages"),
                                                NULL, NULL, 0, "<Branch>"},
@@ -736,7 +736,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Tools/E_xecute"),                "X", execute_summary_cb, 0, NULL},
 #ifdef USE_OPENSSL
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
-       {N_("/_Tools/SSL certi_ficates..."),    
+       {N_("/_Tools/SSL cer_tificates..."),    
                                                NULL, ssl_manager_open_cb, 0, NULL},
 #endif
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
@@ -752,24 +752,24 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Configuration/_Edit accounts..."),
                                                NULL, account_edit_open, 0, NULL},
        {N_("/_Configuration/---"),             NULL, NULL, 0, "<Separator>"},
-       {N_("/_Configuration/_Preferences..."),
+       {N_("/_Configuration/P_references..."),
                                                NULL, prefs_open_cb, 0, NULL},
-       {N_("/_Configuration/Pre-processing..."),
+       {N_("/_Configuration/Pre-pr_ocessing..."),
                                                NULL, prefs_pre_processing_open_cb, 0, NULL},
-       {N_("/_Configuration/Post-processing..."),
+       {N_("/_Configuration/Post-pro_cessing..."),
                                                NULL, prefs_post_processing_open_cb, 0, NULL},
        {N_("/_Configuration/_Filtering..."),
                                                NULL, prefs_filtering_open_cb, 0, NULL},
        {N_("/_Configuration/_Templates..."),   NULL, prefs_template_open_cb, 0, NULL},
        {N_("/_Configuration/_Actions..."),     NULL, prefs_actions_open_cb, 0, NULL},
-       {N_("/_Configuration/Plugins..."),      NULL, plugins_open_cb, 0, NULL},
+       {N_("/_Configuration/Plu_gins..."),     NULL, plugins_open_cb, 0, NULL},
 
        {N_("/_Help"),                          NULL, NULL, 0, "<Branch>"},
        {N_("/_Help/_Manual (Local)"),          NULL, manual_open_cb, MANUAL_MANUAL_LOCAL, NULL},
-       {N_("/_Help/_Manual (Sylpheed Doc Homepage)"),
+       {N_("/_Help/Ma_nual (Sylpheed Doc Homepage)"),
                                                NULL, manual_open_cb, MANUAL_MANUAL_SYLDOC, NULL},
        {N_("/_Help/_FAQ (Local)"),             NULL, manual_open_cb, MANUAL_FAQ_LOCAL, NULL},
-       {N_("/_Help/_FAQ (Sylpheed Doc Homepage)"),
+       {N_("/_Help/FA_Q (Sylpheed Doc Homepage)"),
                                                NULL, manual_open_cb, MANUAL_FAQ_SYLDOC, NULL},
        {N_("/_Help/_Claws FAQ (Claws Documentation)"),
                                                NULL, manual_open_cb, MANUAL_FAQ_CLAWS, NULL},
index 611fd39..e970b24 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -426,14 +426,23 @@ MessageView *messageview_create_with_new_window(MainWindow *mainwin)
 {
        MessageView *msgview;
        GtkWidget *window;
+       static GdkGeometry geometry;
 
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title(GTK_WINDOW(window), _("Sylpheed - Message View"));
        gtk_window_set_wmclass(GTK_WINDOW(window), "message_view", "Sylpheed");
        gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, FALSE);
+
+       if (!geometry.min_height) {
+               geometry.min_width = 320;
+               geometry.min_height = 200;
+       }
+       gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+                                     GDK_HINT_MIN_SIZE);
+
        gtk_widget_set_usize(window, prefs_common.msgwin_width,
                             prefs_common.msgwin_height);
-
+       
        msgview = messageview_create(mainwin);
 
        gtk_signal_connect(GTK_OBJECT(window), "size_allocate",
index 80e0506..0b4bfe6 100644 (file)
@@ -72,7 +72,10 @@ int partial_msg_in_uidl_list(MsgInfo *msginfo)
        time_t recv_time;
        time_t now;
        gint partial_recv;
+       gchar *sanitized_uid = g_strdup(msginfo->account_login);
        
+       subst_for_filename(sanitized_uid);
+
        if (!msginfo->account_server
        ||  !msginfo->account_login
        ||  !msginfo->partial_recv)
@@ -86,13 +89,15 @@ int partial_msg_in_uidl_list(MsgInfo *msginfo)
                g_free(path);
                path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                   "uidl-", msginfo->account_server,
-                                  "-", msginfo->account_login, NULL);
+                                  "-", sanitized_uid, NULL);
                if ((fp = fopen(path, "rb")) == NULL) {
                        if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
+                       g_free(sanitized_uid);
                        g_free(path);
                        return FALSE;
                }
        }
+       g_free(sanitized_uid);
        g_free(path);
 
        now = time(NULL);
@@ -134,9 +139,13 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download)
        int start = TRUE;
        gchar partial_recv[POPBUFSIZE];
        int err = -1;
-
        gchar *filename;
        MsgInfo *tinfo;
+       gchar *sanitized_uid = g_strdup(tinfo->account_login);
+       
+       subst_for_filename(sanitized_uid);
+       
+
        filename = procmsg_get_message_file_path(msginfo);
        if (!filename) {
                g_warning("can't get message file path.\n");
@@ -151,7 +160,8 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download)
        }
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S, tinfo->account_server,
-                          "-", tinfo->account_login, NULL);
+                          "-", sanitized_uid, NULL);
+
        if ((fp = fopen(path, "rb")) == NULL) {
                perror("fopen1");
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
@@ -168,7 +178,10 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download)
 
        pathnew = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S, tinfo->account_server,
-                          "-", tinfo->account_login, ".new", NULL);
+                          "-", sanitized_uid, ".new", NULL);
+       
+       g_free(sanitized_uid);
+
        if ((fpnew = fopen(pathnew, "wb")) == NULL) {
                perror("fopen2");
                fclose(fp);
@@ -321,22 +334,27 @@ gchar *partial_get_filename(const gchar *server, const gchar *login,
        time_t recv_time;
        time_t now;
        gint partial_recv;
-       
+       gchar *sanitized_uid = g_strdup(login); 
+
+       subst_for_filename(sanitized_uid);
+
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S, 
-                          server, "-", login, NULL);
+                          server, "-", sanitized_uid, NULL);
        if ((fp = fopen(path, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
                path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                   "uidl-", server,
-                                  "-", login, NULL);
+                                  "-", sanitized_uid, NULL);
                if ((fp = fopen(path, "rb")) == NULL) {
                        if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
+                       g_free(sanitized_uid);
                        g_free(path);
                        return result;
                }
        }
+       g_free(sanitized_uid);
        g_free(path);
 
        now = time(NULL);
index 4484bc0..6a8d61c 100644 (file)
@@ -417,7 +417,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account)
        gchar *boundary, *sigcontent;
        GpgmeCtx ctx;
        GpgmeData gpgtext, gpgsig;
-       guint len;
+       size_t len;
        struct passphrase_cb_info_s info;
 
        memset (&info, 0, sizeof info);
@@ -505,7 +505,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
        MimeInfo *msgcontent, *encmultipart, *newinfo;
        FILE *fp;
        gchar *boundary, *enccontent;
-       guint len;
+       size_t len;
        gchar *textstr;
        GpgmeData gpgtext, gpgenc;
        gchar **recipients, **nextrecp;
index b57d097..2360e68 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -267,7 +267,7 @@ static gint pop3_getrange_uidl_recv(Pop3Session *session, const gchar *data,
                                        session->partial_recv_table, id);
 
                if ((!session->ac_prefs->getall && recv_time != RECV_TIME_NONE)
-               ||  partial_recv != POP3_TOTALLY_RECEIVED) {
+               || partial_recv != POP3_TOTALLY_RECEIVED) {
                        session->msg[num].received = 
                                (partial_recv != POP3_MUST_COMPLETE_RECV);
                        session->msg[num].partial_recv = partial_recv;
@@ -563,13 +563,18 @@ void pop3_get_uidl_table(PrefsAccount *ac_prefs, Pop3Session *session)
        time_t recv_time;
        time_t now;
        gint partial_recv;
+       gchar *sanitized_uid = g_strdup(ac_prefs->userid);
+       
+       subst_for_filename(sanitized_uid);
        
        table = g_hash_table_new(g_str_hash, g_str_equal);
        partial_recv_table = g_hash_table_new(g_str_hash, g_str_equal);
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S, ac_prefs->recv_server,
-                          "-", ac_prefs->userid, NULL);
+                          "-", sanitized_uid, NULL);
+                          
+       g_free(sanitized_uid);
        if ((fp = fopen(path, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
@@ -633,13 +638,20 @@ gint pop3_write_uidl_list(Pop3Session *session)
        FILE *fp;
        Pop3MsgInfo *msg;
        gint n;
+       gchar *sanitized_uid = g_strdup(session->ac_prefs->userid);
+       
+       subst_for_filename(sanitized_uid);
+       
 
        if (!session->uidl_is_valid) return 0;
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S,
                           session->ac_prefs->recv_server,
-                          "-", session->ac_prefs->userid, NULL);
+                          "-", sanitized_uid, NULL);
+       
+       g_free(sanitized_uid);
+
        if ((fp = fopen(path, "wb")) == NULL) {
                FILE_OP_ERROR(path, "fopen");
                g_free(path);
index ca31596..c86bae2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -2575,15 +2575,18 @@ static void prefs_account_smtp_auth_type_set_optmenu(PrefParam *pparam)
        GtkWidget *menuitem;
 
        switch (type) {
-       case SMTPAUTH_LOGIN:
+       case SMTPAUTH_PLAIN:
                gtk_option_menu_set_history(optmenu, 1);
                break;
-       case SMTPAUTH_CRAM_MD5:
+       case SMTPAUTH_LOGIN:
                gtk_option_menu_set_history(optmenu, 2);
                break;
-       case SMTPAUTH_DIGEST_MD5:
+       case SMTPAUTH_CRAM_MD5:
                gtk_option_menu_set_history(optmenu, 3);
                break;
+       case SMTPAUTH_DIGEST_MD5:
+               gtk_option_menu_set_history(optmenu, 4);
+               break;
        case 0:
        default:
                gtk_option_menu_set_history(optmenu, 0);
index 7e295cf..93774cd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -719,6 +719,11 @@ static PrefParam param[] = {
        {"color_new", "179", &prefs_common.color_new, P_COLOR,
         NULL, NULL, NULL},
 
+       {"filteringwin_width", "500", &prefs_common.filteringwin_width, P_INT,
+        NULL, NULL, NULL},
+       {"filteringwin_height", "-1", &prefs_common.filteringwin_height, P_INT,
+        NULL, NULL, NULL},
+
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
index 6beb6e9..7fc4e55 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -285,6 +285,9 @@ struct _PrefsCommon
        gulong color_new;
        
        GList *summary_quicksearch_history;
+       
+       gint filteringwin_width;
+       gint filteringwin_height;
 };
 
 extern PrefsCommon prefs_common;
index 499dc02..426a02a 100644 (file)
@@ -137,6 +137,15 @@ void prefs_filtering_open(GSList ** p_processing,
        start_address_completion();
 }
 
+static void prefs_filtering_size_allocate_cb(GtkWidget *widget,
+                                        GtkAllocation *allocation)
+{
+       g_return_if_fail(allocation != NULL);
+
+       prefs_common.filteringwin_width = allocation->width;
+       prefs_common.filteringwin_height = allocation->height;
+}
+
 /* prefs_filtering_close() - just to have one common exit point */
 static void prefs_filtering_close(void)
 {
@@ -181,6 +190,7 @@ static void prefs_filtering_create(void)
        GtkWidget *up_btn;
        GtkWidget *down_btn;
        GtkWidget *bottom_btn;
+       static GdkGeometry geometry;
 
        gchar *title[1];
 
@@ -209,6 +219,8 @@ static void prefs_filtering_create(void)
                            GTK_SIGNAL_FUNC(prefs_filtering_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT(window), "key_press_event",
                            GTK_SIGNAL_FUNC(prefs_filtering_key_pressed), NULL);
+       gtk_signal_connect (GTK_OBJECT(window), "size_allocate",
+                           GTK_SIGNAL_FUNC(prefs_filtering_size_allocate_cb), NULL);
        MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_signal_connect (GTK_OBJECT(ok_btn), "clicked",
                            GTK_SIGNAL_FUNC(prefs_filtering_ok), NULL);
@@ -353,7 +365,15 @@ static void prefs_filtering_create(void)
        gtk_signal_connect (GTK_OBJECT (bottom_btn), "clicked",
                            GTK_SIGNAL_FUNC (prefs_filtering_bottom), NULL);
 
-       gtk_widget_set_usize(window, 500, -1);
+       if (!geometry.min_height) {
+               geometry.min_width = 500;
+               geometry.min_height = 400;
+       }
+
+       gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+                                     GDK_HINT_MIN_SIZE);
+       gtk_widget_set_usize(window, prefs_common.filteringwin_width, 
+                                    prefs_common.filteringwin_height);
 
        gtk_widget_show_all(window);
 
index 0cc9844..437c6bf 100644 (file)
@@ -1197,7 +1197,7 @@ gchar *procmime_get_content_type_str(MimeMediaType type,
        return g_strdup_printf("%s/%s", type_str, subtype);
 }
 
-void procmime_parse_mimepart(MimeInfo *parent,
+int procmime_parse_mimepart(MimeInfo *parent,
                             gchar *content_type,
                             gchar *content_encoding,
                             gchar *content_description,
@@ -1293,6 +1293,7 @@ void procmime_parse_multipart(MimeInfo *mimeinfo)
        gint boundary_len = 0, lastoffset = -1, i;
        gchar buf[BUFFSIZE];
        FILE *fp;
+       int result = 0;
 
        boundary = g_hash_table_lookup(mimeinfo->typeparameters, "boundary");
        if (!boundary)
@@ -1307,13 +1308,13 @@ void procmime_parse_multipart(MimeInfo *mimeinfo)
                return;
        }
        fseek(fp, mimeinfo->offset, SEEK_SET);
-       while ((p = fgets(buf, sizeof(buf), fp)) != NULL) {
+       while ((p = fgets(buf, sizeof(buf), fp)) != NULL && result == 0) {
                if (ftell(fp) > (mimeinfo->offset + mimeinfo->length))
                        break;
 
                if (IS_BOUNDARY(buf, boundary, boundary_len)) {
                        if (lastoffset != -1) {
-                               procmime_parse_mimepart(mimeinfo,
+                               result = procmime_parse_mimepart(mimeinfo,
                                                        hentry[0].body, hentry[1].body,
                                                        hentry[2].body, hentry[3].body, 
                                                        hentry[4].body, 
@@ -1574,7 +1575,7 @@ static void procmime_parse_content_encoding(const gchar *content_encoding, MimeI
        return;
 }
 
-void procmime_parse_mimepart(MimeInfo *parent,
+int procmime_parse_mimepart(MimeInfo *parent,
                             gchar *content_type,
                             gchar *content_encoding,
                             gchar *content_description,
@@ -1589,8 +1590,17 @@ void procmime_parse_mimepart(MimeInfo *parent,
        /* Create MimeInfo */
        mimeinfo = procmime_mimeinfo_new();
        mimeinfo->content = MIMECONTENT_FILE;
-       if (parent != NULL)
+       if (parent != NULL) {
+               if (g_node_depth(parent->node) > 32) {
+                       /* 32 is an arbitrary value
+                        * this avoids DOSsing ourselves 
+                        * with enormous messages
+                        */
+                       procmime_mimeinfo_free_all(mimeinfo);
+                       return -1;                      
+               }
                g_node_append(parent->node, mimeinfo->node);
+       }
        mimeinfo->data.filename = g_strdup(filename);
        mimeinfo->offset = offset;
        mimeinfo->length = length;
@@ -1641,6 +1651,8 @@ void procmime_parse_mimepart(MimeInfo *parent,
                default:
                        break;
        }
+
+       return 0;
 }
 
 static gchar *typenames[] = {