[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-568-g421fce6

ticho at claws-mail.org ticho at claws-mail.org
Thu Jan 3 01:11:07 CET 2019


The branch, gtk3 has been updated
       via  421fce6ee3f290da26f97488eb7b75a7ecb3f88e (commit)
       via  e7e49fb9acbbc42688ad331175138dd1a4b36a89 (commit)
       via  f64d3959689ea365a0e48328c783da8c7ae0cad4 (commit)
       via  24bd5342531c100e6a56ad269d9aa1dedccbd364 (commit)
       via  ec8c36f6bc4d68812d62cdf1f3a37f02d0563591 (commit)
       via  17feba13cdd7901bd97a6540a5c1155862fde747 (commit)
       via  393b3f9be35daa3332b915a11a20b61ef6b80e2e (commit)
       via  088ced3c4d1b710966d14fe9ac44ea16120adb9e (commit)
       via  83d74cbbf6ea95bb7a970467d6869eec4d95b24a (commit)
       via  013e2cf70d0ca5b44e8f0a5876e4680f818e0839 (commit)
       via  1135c8b51920fe16b2b5d3ddd42c203a91df7c66 (commit)
       via  6ff1484e48a850553a9edb5312633ec2eca2e4fb (commit)
       via  f63d7103445e173946db3c88a7c08a436fad5af6 (commit)
       via  a847751979e192e68fd2c2b55e77d773843d5d93 (commit)
       via  4000e9bc70508402998e0432d5da81d45bdc3c19 (commit)
       via  c3356e9c5e8e6123166640fbda2ef5520572ddba (commit)
       via  5fdaf05218fd69fad9b56e888c46eeacd0e89cec (commit)
       via  80f21116290b7be14cb27a162921d0ea6915b2ce (commit)
       via  f59f7fa6cac7bf13f9ea3873398cfbf9e38a5efc (commit)
       via  c8fe9fb73f29ead09c2a3b9ce64bba52bb317fb5 (commit)
       via  302382cdcb989d7a7458ef3e7ef7740c90162d9b (commit)
       via  2ceb0d43d3469c600b0c52f99b752b6a8498fb4a (commit)
       via  516496ca12a2f3d51ceb27ec8b1279672be361f0 (commit)
       via  9914197299078221a5b0b747b36df5c563301f78 (commit)
       via  989513b647107ac08e4d72a00eb5ccc0a6143ef8 (commit)
       via  a214f4f11e57816f8d3b9ba1d863720ed095c112 (commit)
       via  5858606037b9d08d87ca07ec909bc39d76452cde (commit)
       via  c92be95a11655afa5990a822af2eb873f559e6a5 (commit)
       via  8b90dc934a4aa20b0f008647254955f668590bad (commit)
       via  6d0b5371aaabc3e56b1561e2371e9d7d908df3b3 (commit)
       via  fd6f84d6b30d40bcf198cdb7ad3747b0ed27be48 (commit)
      from  51df50ba2a8cb6dd3af2d753ef09bbec96b56327 (commit)

Summary of changes:
 AUTHORS                                            |    1 +
 NEWS                                               |   28 +-
 README                                             |    1 +
 RELEASE_NOTES                                      |  111 +---
 configure.ac                                       |    8 +-
 doc/man/claws-mail.1                               |    4 +-
 src/action.c                                       |    7 +-
 src/addressbook-dbus.c                             |  556 ++++++++++----------
 src/addressbook-dbus.h                             |   28 +-
 src/common/codeconv.h                              |    1 -
 src/common/session.c                               |    3 +
 src/common/session.h                               |    1 +
 src/common/socket.h                                |    1 +
 src/common/ssl.c                                   |   14 +
 src/common/ssl_certificate.c                       |   13 +-
 src/common/tlds.h                                  |    3 +-
 src/common/utils.c                                 |   37 +-
 src/common/utils.h                                 |    1 +
 src/editaddress.c                                  |    2 +-
 src/etpan/etpan-ssl.c                              |   17 +
 src/etpan/imap-thread.c                            |   14 +-
 src/etpan/nntp-thread.c                            |    2 +-
 src/folder.c                                       |   10 +-
 src/gtk/authors.h                                  |    1 +
 src/gtk/foldersort.c                               |   23 +-
 src/gtk/w32_filesel.c                              |    2 +-
 src/html.c                                         |    2 +-
 src/imap.c                                         |   13 +-
 src/inc.c                                          |    5 +-
 src/mimeview.c                                     |    2 +-
 src/msgcache.c                                     |   12 +-
 src/news.c                                         |    6 +-
 src/password.c                                     |    4 +-
 src/plugins/fancy/fancy_viewer.c                   |    2 +-
 src/plugins/libravatar/libravatar_federation.c     |    5 +
 src/plugins/libravatar/libravatar_image.c          |    2 +-
 src/plugins/libravatar/libravatar_missing.c        |    6 +-
 src/plugins/managesieve/managesieve.c              |    1 +
 src/plugins/managesieve/sieve_prefs.c              |    2 +-
 src/plugins/python/Makefile.am                     |    2 +
 src/plugins/python/python_plugin.c                 |   28 +-
 src/plugins/python/python_prefs.c                  |   86 +++
 .../python/{composewindowtype.h => python_prefs.h} |   23 +-
 src/plugins/rssyl/parse822.c                       |    2 +-
 src/plugins/rssyl/rssyl_subscribe.c                |    3 +-
 src/plugins/tnef_parse/tnef_parse.c                |    2 +-
 src/plugins/vcalendar/vcal_folder.c                |    4 +-
 src/plugins/vcalendar/vcal_manager.c               |    2 +-
 src/plugins/vcalendar/vcal_meeting_gtk.c           |    4 +-
 src/pop.c                                          |    1 +
 src/prefs_account.c                                |    3 +
 src/prefs_account.h                                |    1 +
 src/prefs_common.c                                 |   10 +
 src/prefs_common.h                                 |    4 +
 src/procmime.c                                     |   10 +-
 src/send_message.c                                 |    6 +-
 src/summaryview.c                                  |   20 +-
 src/uri_opener.c                                   |   24 +-
 58 files changed, 705 insertions(+), 481 deletions(-)
 create mode 100644 src/plugins/python/python_prefs.c
 copy src/plugins/python/{composewindowtype.h => python_prefs.h} (67%)


- Log -----------------------------------------------------------------
commit 421fce6ee3f290da26f97488eb7b75a7ecb3f88e
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sun Dec 30 16:54:52 2018 +0100

    Fix deprecation warning
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/addressbook-dbus.c b/src/addressbook-dbus.c
index 154550d..517f1e3 100644
--- a/src/addressbook-dbus.c
+++ b/src/addressbook-dbus.c
@@ -95,12 +95,12 @@ static GHashTable* hash_table_new(void) {
 }
 
 static void g_value_email_free(gpointer data) {
-    GValueArray* email = (GValueArray *) data;
+    GArray* email = (GArray *) data;
     GValue* email_member;
     guint i;
 
-    for (i = 0; i < email->n_values; i++) {
-        email_member = g_value_array_get_nth(email, i);
+    for (i = 0; i < email->len; i++) {
+        email_member = g_array_index(email, GValue*, i);
         g_value_unset(email_member);
     }
 }
@@ -137,7 +137,7 @@ static gchar* convert_2_utf8(gchar* locale) {
 static void format_contact(DBusContact* contact, ContactData* c) {
     gchar* firstname;
     gchar* lastname;
-    GValueArray* email = NULL;
+    GArray* email = NULL;
     GValue email_member = {0};
     gchar* str;
     gchar* image = NULL;
@@ -177,12 +177,12 @@ static void format_contact(DBusContact* contact, ContactData* c) {
         g_strdup("image"), g_base64_encode((const guchar *) image, size));
     }
 
-    email = g_value_array_new(0);
+    email = g_array_new(FALSE, FALSE, sizeof(GValue*));
 
     /* Alias is not available but needed so make an empty string */
     g_value_init(&email_member, G_TYPE_STRING);
     g_value_set_string(&email_member, "");
-    g_value_array_append(email, &email_member);
+    g_array_append_val(email, email_member);
     g_value_unset(&email_member);
 
     if (c->email)
@@ -192,7 +192,7 @@ static void format_contact(DBusContact* contact, ContactData* c) {
 
     g_value_init(&email_member, G_TYPE_STRING);
     g_value_set_string(&email_member, str);
-    g_value_array_append(email, &email_member);
+    g_array_append_val(email, email_member);
     g_value_unset(&email_member);
     g_free(str);
 
@@ -203,7 +203,7 @@ static void format_contact(DBusContact* contact, ContactData* c) {
 
     g_value_init(&email_member, G_TYPE_STRING);
     g_value_set_string(&email_member, str);
-    g_value_array_append(email, &email_member);
+    g_array_append_val(email, email_member);
     g_value_unset(&email_member);
     g_free(str);
 
@@ -459,7 +459,7 @@ gboolean addressbook_add_vcard(const gchar* abook, const gchar* vcard, GError**
 }
 
 static gboolean my_compose_create_hook(gpointer source, gpointer user_data) {
-    Compose *compose = (Compose*) source;
+    //Compose *compose = (Compose*) source;
     GError* error = NULL;
 
     gchar* vcard = addressbook_get_vcard("test", &error);

commit e7e49fb9acbbc42688ad331175138dd1a4b36a89
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sun Dec 30 16:17:51 2018 +0100

    Remove mysterious chars and replace with correct tab chars
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/addressbook-dbus.h b/src/addressbook-dbus.h
index d9ca0b9..9ed4fa8 100644
--- a/src/addressbook-dbus.h
+++ b/src/addressbook-dbus.h
@@ -42,30 +42,30 @@ G_BEGIN_DECLS
 #include "compose.h"
 
 typedef struct {
-	gchar*		cn;
-	gchar*		email;
-	gchar*		remarks;
-	gchar*		name;
-	gchar*		book;
-	GdkPixbuf* picture;
+    gchar*  cn;
+    gchar*  email;
+    gchar*  remarks;
+    gchar*  name;
+    gchar*  book;
+    GdkPixbuf* picture;
 } ContactData;
 
 gboolean addressbook_start_service(GError** error);
 void addressbook_install_hooks(GError** error);
 int addressbook_dbus_add_contact(ContactData* contact, GError** error);
 gboolean addrindex_dbus_load_completion(gint (*callBackFunc)
-										(const gchar* name,
-										 const gchar* address,
-										 const gchar* nick,
-										 const gchar* alias,
-										 GList* grp_emails),
-										 GError** error);
+                                        (const gchar* name,
+                                         const gchar* address,
+                                         const gchar* nick,
+                                         const gchar* alias,
+                                         GList* grp_emails),
+                                         GError** error);
 void addressbook_dbus_open(gboolean compose, GError** error);
 GSList* addressbook_dbus_get_books(GError** error);
 void contact_data_free(ContactData** data);
 void addressbook_harvest(FolderItem *folderItem,
-						 gboolean sourceInd,
-						 GList *msgList );
+                         gboolean sourceInd,
+                         GList *msgList );
 void addressbook_connect_signals(Compose* compose);
 gchar* addressbook_get_vcard(const gchar* account, GError** error);
 gboolean addressbook_add_vcard(const gchar* abook, const gchar* vcard, GError** error);

commit f64d3959689ea365a0e48328c783da8c7ae0cad4
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sun Dec 30 16:14:06 2018 +0100

    Remove mysterious chars and replace with correct tab chars
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/addressbook-dbus.c b/src/addressbook-dbus.c
index a71cd06..154550d 100644
--- a/src/addressbook-dbus.c
+++ b/src/addressbook-dbus.c
@@ -27,7 +27,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
+ *
  */
 
 #ifdef HAVE_CONFIG_H
@@ -139,7 +139,7 @@ static void format_contact(DBusContact* contact, ContactData* c) {
     gchar* lastname;
     GValueArray* email = NULL;
     GValue email_member = {0};
-    gchar* str;   
+    gchar* str;
     gchar* image = NULL;
     gsize size;
 

commit 24bd5342531c100e6a56ad269d9aa1dedccbd364
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sun Dec 30 16:12:03 2018 +0100

    Remove mysterious chars and replace with correct tab chars
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/addressbook-dbus.c b/src/addressbook-dbus.c
index 2892b3c..a71cd06 100644
--- a/src/addressbook-dbus.c
+++ b/src/addressbook-dbus.c
@@ -12,8 +12,8 @@
  * More lightweight is achieved by design, in that sence that the whole
  * structure is based on a plugable design.
  *
- * Claws Mail is Copyright (C) 1999-2012 by the Claws Mail Team and
- * Claws-contacts is Copyright (C) 2011 by Michael Rasmussen.
+ * Claws Mail is Copyright (C) 1999-2018 by the Claws Mail Team and
+ * Claws-contacts is Copyright (C) 2018 by Michael Rasmussen.
  *
  * 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
@@ -62,12 +62,12 @@ static GQuark client_object_error_quark() {
 static gboolean init(GError** error) {
     connection = dbus_g_bus_get (DBUS_BUS_SESSION, error);
     if (connection == NULL || *error) {
-		if (! *error)
-			g_set_error(error, client_object_error_quark(), 1, "Unable to connect to dbus");
+        if (! *error)
+            g_set_error(error, client_object_error_quark(), 1, "Unable to connect to dbus");
         g_warning("Unable to connect to dbus: %s", (*error)->message);
         return FALSE;
     }
-    
+
     proxy = dbus_g_proxy_new_for_name (connection,
             "org.clawsmail.Contacts",
             "/org/clawsmail/contacts",
@@ -77,7 +77,7 @@ static gboolean init(GError** error) {
         g_set_error(error, client_object_error_quark(), 1, "Could not get a proxy object");
         return FALSE;
     }
-    
+
     return TRUE;
 }
 
@@ -87,26 +87,26 @@ static void dbus_contact_free(const DBusContact* contact) {
 }
 
 static GHashTable* hash_table_new(void) {
-	GHashTable* hash_table;
-	
-	hash_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
-		
-	return hash_table;
+    GHashTable* hash_table;
+
+    hash_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+
+    return hash_table;
 }
 
 static void g_value_email_free(gpointer data) {
-	GValueArray* email = (GValueArray *) data;
-	GValue* email_member;
-	guint i;
-	
-	for (i = 0; i < email->n_values; i++) {
-		email_member = g_value_array_get_nth(email, i);
-		g_value_unset(email_member);
-	}
+    GValueArray* email = (GValueArray *) data;
+    GValue* email_member;
+    guint i;
+
+    for (i = 0; i < email->n_values; i++) {
+        email_member = g_value_array_get_nth(email, i);
+        g_value_unset(email_member);
+    }
 }
 
 static GPtrArray* g_value_email_new() {
-	return g_ptr_array_new_with_free_func(g_value_email_free);
+    return g_ptr_array_new_with_free_func(g_value_email_free);
 }
 
 static gchar* convert_2_utf8(gchar* locale) {
@@ -140,13 +140,13 @@ static void format_contact(DBusContact* contact, ContactData* c) {
     GValueArray* email = NULL;
     GValue email_member = {0};
     gchar* str;   
-	gchar* image = NULL;
-	gsize size;
-    
+    gchar* image = NULL;
+    gsize size;
+
     contact->data = hash_table_new();
     contact->emails = g_value_email_new();
     firstname = lastname = NULL;
-    
+
     if (c->name) {
         gchar* pos = strchr(c->name, ' ');
         if (pos) {
@@ -165,21 +165,21 @@ static void format_contact(DBusContact* contact, ContactData* c) {
         g_free(firstname);
         g_free(lastname);
     }
-	if (c->cn) {
-		g_hash_table_replace(contact->data,
-			g_strdup("cn"), convert_2_utf8(c->cn));
-	}
-
-	if (c->picture) {
-		gdk_pixbuf_save_to_buffer(
-			c->picture, &image, &size, "png", NULL, NULL);
-		g_hash_table_replace(contact->data,
-			g_strdup("image"), g_base64_encode((const guchar *) image, size));
-	}
-	
+    if (c->cn) {
+        g_hash_table_replace(contact->data,
+        g_strdup("cn"), convert_2_utf8(c->cn));
+    }
+
+    if (c->picture) {
+        gdk_pixbuf_save_to_buffer(
+        c->picture, &image, &size, "png", NULL, NULL);
+        g_hash_table_replace(contact->data,
+        g_strdup("image"), g_base64_encode((const guchar *) image, size));
+    }
+
     email = g_value_array_new(0);
 
-	/* Alias is not available but needed so make an empty string */
+    /* Alias is not available but needed so make an empty string */
     g_value_init(&email_member, G_TYPE_STRING);
     g_value_set_string(&email_member, "");
     g_value_array_append(email, &email_member);
@@ -200,7 +200,7 @@ static void format_contact(DBusContact* contact, ContactData* c) {
         str = convert_2_utf8(c->remarks);
     else
         str = g_strdup("");
-    
+
     g_value_init(&email_member, G_TYPE_STRING);
     g_value_set_string(&email_member, str);
     g_value_array_append(email, &email_member);
@@ -211,277 +211,277 @@ static void format_contact(DBusContact* contact, ContactData* c) {
 }
 
 static DBusHandlerResult contact_add_signal(DBusConnection* bus,
-							   				DBusMessage* message,
-							   				gpointer data) {
-	DBusError error;
+                                            DBusMessage* message,
+                                            gpointer data) {
+    DBusError error;
     gchar *s = NULL;
 
-	if (! compose_instance) {
-		g_message("Missing compose instance\n");
-		return DBUS_HANDLER_RESULT_HANDLED;
-	}
-
-   	dbus_error_init (&error);
-
-	if (dbus_message_is_signal(message, "org.clawsmail.Contacts", "ContactMailTo")) {
-    	if (dbus_message_get_args(
-				message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) {
-      		debug_print("ContactMailTo address received: %s\n", s);
-			compose_entry_append(compose_instance, s, COMPOSE_TO, PREF_NONE);
-    	}
-		else {
-      		debug_print("ContactMailTo received with error: %s\n", error.message);
-      		dbus_error_free(&error);
-    	}
-	}
-	else if (dbus_message_is_signal(message, "org.clawsmail.Contacts", "ContactMailCc")) {
-    	if (dbus_message_get_args(
-				message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) {
-      		debug_print("ContactMailTo address received: %s\n", s);
-			compose_entry_append(compose_instance, s, COMPOSE_CC, PREF_NONE);
-    	}
-		else {
-      		debug_print("ContactMailTo received with error: %s\n", error.message);
-      		dbus_error_free(&error);
-    	}
-	}
-	else if (dbus_message_is_signal(message, "org.clawsmail.Contacts", "ContactMailBcc")) {
-    	if (dbus_message_get_args(
-				message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) {
-      		debug_print("ContactMailTo address received: %s\n", s);
-			compose_entry_append(compose_instance, s, COMPOSE_BCC, PREF_NONE);
-    	}
-		else {
-      		debug_print("ContactMailTo received with error: %s\n", error.message);
-      		dbus_error_free(&error);
-    	}
-	}
-	else {
-		if (error.message) {
-			g_warning("Reception error: %s", error.message);
-			dbus_error_free(&error);
-		}
-		debug_print("Unhandled signal received\n");
-		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-	}
-
-	return DBUS_HANDLER_RESULT_HANDLED;
+    if (! compose_instance) {
+        g_message("Missing compose instance\n");
+        return DBUS_HANDLER_RESULT_HANDLED;
+    }
+
+    dbus_error_init (&error);
+
+    if (dbus_message_is_signal(message, "org.clawsmail.Contacts", "ContactMailTo")) {
+        if (dbus_message_get_args(
+            message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) {
+            debug_print("ContactMailTo address received: %s\n", s);
+            compose_entry_append(compose_instance, s, COMPOSE_TO, PREF_NONE);
+        }
+        else {
+            debug_print("ContactMailTo received with error: %s\n", error.message);
+            dbus_error_free(&error);
+        }
+    }
+    else if (dbus_message_is_signal(message, "org.clawsmail.Contacts", "ContactMailCc")) {
+        if (dbus_message_get_args(
+            message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) {
+            debug_print("ContactMailTo address received: %s\n", s);
+            compose_entry_append(compose_instance, s, COMPOSE_CC, PREF_NONE);
+        }
+        else {
+            debug_print("ContactMailTo received with error: %s\n", error.message);
+            dbus_error_free(&error);
+        }
+    }
+    else if (dbus_message_is_signal(message, "org.clawsmail.Contacts", "ContactMailBcc")) {
+        if (dbus_message_get_args(
+            message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) {
+            debug_print("ContactMailTo address received: %s\n", s);
+            compose_entry_append(compose_instance, s, COMPOSE_BCC, PREF_NONE);
+        }
+        else {
+            debug_print("ContactMailTo received with error: %s\n", error.message);
+            dbus_error_free(&error);
+        }
+    }
+    else {
+        if (error.message) {
+            g_warning("Reception error: %s", error.message);
+            dbus_error_free(&error);
+        }
+        debug_print("Unhandled signal received\n");
+        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+    }
+
+    return DBUS_HANDLER_RESULT_HANDLED;
 }
 
 gboolean addressbook_start_service(GError** error) {
-	gchar* reply = NULL;
-	gboolean result = FALSE;
-	
-	if (! init(error))
-		return result;
-
-	if (!org_clawsmail_Contacts_ping(proxy, &reply, error)) {
-		if (! *error)
-			g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
-		g_warning ("Woops remote method failed: %s", (*error)->message);
-	}
-	if (reply && strcmp("PONG", reply) == 0)
-		result = TRUE;
-		
-	return result;
+    gchar* reply = NULL;
+    gboolean result = FALSE;
+
+    if (! init(error))
+        return result;
+
+    if (!org_clawsmail_Contacts_ping(proxy, &reply, error)) {
+        if (! *error)
+            g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
+        g_warning ("Woops remote method failed: %s", (*error)->message);
+    }
+    if (reply && strcmp("PONG", reply) == 0)
+        result = TRUE;
+
+    return result;
 }
 
 int addressbook_dbus_add_contact(ContactData* contact, GError** error) {
-	DBusContact dbus_contact;
-	
-	if (! init(error))
-		return -1;
-
-	format_contact(&dbus_contact, contact);
-	if (!org_clawsmail_Contacts_add_contact(
-		proxy, contact->book, dbus_contact.data, dbus_contact.emails, error)) {
-		if (! *error)
-			g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
-		g_warning ("Woops remote method failed: %s", (*error)->message);
-		dbus_contact_free(&dbus_contact);
-		return -1;
-	}
-	dbus_contact_free(&dbus_contact);
-	return 0;
+    DBusContact dbus_contact;
+
+    if (! init(error))
+        return -1;
+
+    format_contact(&dbus_contact, contact);
+    if (!org_clawsmail_Contacts_add_contact(
+        proxy, contact->book, dbus_contact.data, dbus_contact.emails, error)) {
+        if (! *error)
+            g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
+        g_warning ("Woops remote method failed: %s", (*error)->message);
+        dbus_contact_free(&dbus_contact);
+        return -1;
+    }
+    dbus_contact_free(&dbus_contact);
+    return 0;
 }
 
 gboolean addrindex_dbus_load_completion(gint (*callBackFunc)
-										(const gchar* name,
-										 const gchar* address,
-										 const gchar* nick,
-										 const gchar* alias,
-										 GList* grp_emails),
-										 GError** error) {
-	gchar **list = NULL, **contacts;
-	gchar *name, *email;
-	
-	if (! init(error))
-		return FALSE;
-
-	if (!org_clawsmail_Contacts_search_addressbook(
-			proxy, "*", NULL, &list, error)) {
-		if (! *error)
-			g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
-		g_warning ("Woops remote method failed: %s", (*error)->message);
-	    g_strfreev(list);
-	    return FALSE;
+                                        (const gchar* name,
+                                         const gchar* address,
+                                         const gchar* nick,
+                                         const gchar* alias,
+                                         GList* grp_emails),
+                                         GError** error) {
+    gchar **list = NULL, **contacts;
+    gchar *name, *email;
+
+    if (! init(error))
+        return FALSE;
+
+    if (!org_clawsmail_Contacts_search_addressbook(
+        proxy, "*", NULL, &list, error)) {
+        if (! *error)
+            g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
+        g_warning ("Woops remote method failed: %s", (*error)->message);
+        g_strfreev(list);
+        return FALSE;
+    }
+    for (contacts = list; *contacts != NULL; contacts += 1) {
+        gchar* tmp = g_strdup(*contacts);
+        gchar* pos = g_strrstr(tmp, "\"");
+    if (pos) {
+            /* Contact has a name as part of email address */
+            *pos = '\0';
+            name = tmp;
+            name += 1;
+            pos += 3;
+            email = pos;
+            pos = g_strrstr(email, ">");
+            if (pos)
+            *pos = '\0';
+        }
+        else {
+            name = "";
+            email = tmp;
+        }
+        debug_print("Adding: %s <%s> to completition\n", name, email);
+        callBackFunc(name, email, NULL, NULL, NULL);
+        g_free(tmp);
     }
-	for (contacts = list; *contacts != NULL; contacts += 1) {
-		gchar* tmp = g_strdup(*contacts);
-		gchar* pos = g_strrstr(tmp, "\"");
-		if (pos) {
-		    /* Contact has a name as part of email address */
-		    *pos = '\0';
-		    name = tmp;
-		    name += 1;
-		    pos += 3;
-		    email = pos;
-		    pos = g_strrstr(email, ">");
-		    if (pos)
-			*pos = '\0';
-		}
-		else {
-		    name = "";
-		    email = tmp;
-		}
-		debug_print("Adding: %s <%s> to completition\n", name, email);
-		callBackFunc(name, email, NULL, NULL, NULL);
-		g_free(tmp);
-	}
 
     return TRUE;
 }
 
 void addressbook_dbus_open(gboolean compose, GError** error) {
-	if (! init(error))
-		return;
-
-	if (!org_clawsmail_Contacts_show_addressbook(proxy, compose, error)) {
-		if (! *error)
-			g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
-		g_warning ("Woops remote method failed: %s", (*error)->message);
-	}
+    if (! init(error))
+        return;
+
+    if (!org_clawsmail_Contacts_show_addressbook(proxy, compose, error)) {
+        if (! *error)
+            g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
+        g_warning ("Woops remote method failed: %s", (*error)->message);
+    }
 }
 
 GSList* addressbook_dbus_get_books(GError** error) {
-	gchar **book_names = NULL, **cur;
-	GSList* books = NULL;
-	
-	if (! init(error)) {
-		return books;
-	}
-	
-	if (!org_clawsmail_Contacts_book_list(proxy, &book_names, error)) {
-		if (! *error)
-			g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
-		g_warning ("Woops remote method failed: %s", (*error)->message);
-		g_strfreev(book_names);
-		return books;
-	}
-	for (cur = book_names; *cur; cur += 1)
-		books = g_slist_prepend(books, g_strdup(*cur));
-	
-	g_strfreev(book_names);
-	
-	return books;
+    gchar **book_names = NULL, **cur;
+    GSList* books = NULL;
+
+    if (! init(error)) {
+        return books;
+    }
+
+    if (!org_clawsmail_Contacts_book_list(proxy, &book_names, error)) {
+        if (! *error)
+            g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
+        g_warning ("Woops remote method failed: %s", (*error)->message);
+        g_strfreev(book_names);
+        return books;
+    }
+    for (cur = book_names; *cur; cur += 1)
+        books = g_slist_prepend(books, g_strdup(*cur));
+
+    g_strfreev(book_names);
+
+    return books;
 }
 
 void contact_data_free(ContactData** data) {
-	ContactData* contact;
-	
-	if (! data && ! *data)
-		return;
-		
-	contact = *data;
-	g_free(contact->cn);
-	g_free(contact->email);
-	g_free(contact->remarks);
-	g_free(contact->name);
-	g_free(contact->book);
-	g_free(contact);
-	*data = NULL;
+    ContactData* contact;
+
+    if (! data && ! *data)
+        return;
+
+    contact = *data;
+    g_free(contact->cn);
+    g_free(contact->email);
+    g_free(contact->remarks);
+    g_free(contact->name);
+    g_free(contact->book);
+    g_free(contact);
+    *data = NULL;
 }
 
 void addressbook_harvest(FolderItem *folderItem,
-						 gboolean sourceInd,
-						 GList *msgList ) {
-	addrgather_dlg_execute(folderItem, sourceInd, msgList);
+                         gboolean sourceInd,
+                         GList *msgList ) {
+    addrgather_dlg_execute(folderItem, sourceInd, msgList);
 }
 
 void addressbook_connect_signals(Compose* compose) {
-	DBusConnection* bus;
-  	DBusError* error = NULL;
-  	
-	g_return_if_fail(compose != NULL);
-	
-	bus = dbus_bus_get (DBUS_BUS_SESSION, error);
-  	if (!bus) {
-    	g_warning ("Failed to connect to the D-BUS daemon: %s", error->message);
-    	dbus_error_free(error);
-    	return;
-  	}
-	
-  	debug_print("Compose: %p\n", compose);
-	compose_instance = compose;
-	dbus_bus_add_match(bus, "type='signal',interface='org.clawsmail.Contacts'", error);
-	if (error) {
-		debug_print("Failed to add match to the D-BUS daemon: %s\n", error->message);
-    	dbus_error_free(error);
-    	return;
-	}
-	dbus_connection_add_filter(bus, contact_add_signal, NULL, NULL);
+    DBusConnection* bus;
+    DBusError* error = NULL;
+
+    g_return_if_fail(compose != NULL);
+
+    bus = dbus_bus_get (DBUS_BUS_SESSION, error);
+    if (!bus) {
+        g_warning ("Failed to connect to the D-BUS daemon: %s", error->message);
+        dbus_error_free(error);
+        return;
+    }
+
+    debug_print("Compose: %p\n", compose);
+    compose_instance = compose;
+    dbus_bus_add_match(bus, "type='signal',interface='org.clawsmail.Contacts'", error);
+    if (error) {
+        debug_print("Failed to add match to the D-BUS daemon: %s\n", error->message);
+        dbus_error_free(error);
+        return;
+    }
+    dbus_connection_add_filter(bus, contact_add_signal, NULL, NULL);
 }
 
 gchar* addressbook_get_vcard(const gchar* account, GError** error) {
-	gchar* vcard = NULL;
-	
-	g_return_val_if_fail(account != NULL, vcard);
-	
-	if (! init(error)) {
-		return vcard;
-	}
-	
-	if (!org_clawsmail_Contacts_get_vcard(proxy, account, &vcard, error)) {
-		if (! *error)
-			g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
-		g_warning ("Woops remote method failed: %s", (*error)->message);
-		g_free(vcard);
-		vcard = NULL;
-	}
-	
-	return vcard;
+    gchar* vcard = NULL;
+
+    g_return_val_if_fail(account != NULL, vcard);
+
+    if (! init(error)) {
+        return vcard;
+    }
+
+    if (!org_clawsmail_Contacts_get_vcard(proxy, account, &vcard, error)) {
+        if (! *error)
+            g_set_error(error, client_object_error_quark(), 1, "Woops remote method failed");
+        g_warning ("Woops remote method failed: %s", (*error)->message);
+        g_free(vcard);
+        vcard = NULL;
+}
+
+    return vcard;
 }
 
 gboolean addressbook_add_vcard(const gchar* abook, const gchar* vcard, GError** error) {
-	gboolean result = FALSE;
-	
-	return result;
+    gboolean result = FALSE;
+
+    return result;
 }
 
 static gboolean my_compose_create_hook(gpointer source, gpointer user_data) {
-	Compose *compose = (Compose*) source;
-	GError* error = NULL;
-
-	gchar* vcard = addressbook_get_vcard("test", &error);
-	if (error) {
-		g_warning("%s", error->message);
-		g_clear_error(&error);
-	}
-	else {
-		debug_print("test.vcf:\n%s\n", vcard);
-		g_free(vcard);
-	}
-	
-	return FALSE;
+    Compose *compose = (Compose*) source;
+    GError* error = NULL;
+
+    gchar* vcard = addressbook_get_vcard("test", &error);
+    if (error) {
+        g_warning("%s", error->message);
+        g_clear_error(&error);
+    }
+    else {
+        debug_print("test.vcf:\n%s\n", vcard);
+        g_free(vcard);
+}
+
+    return FALSE;
 }
 
 void addressbook_install_hooks(GError** error) {
-	if ((guint)-1 == hooks_register_hook(
-			COMPOSE_CREATED_HOOKLIST, my_compose_create_hook, NULL)) {
-		g_warning("Could not register hook for adding vCards");
-		if (error) {
-			g_set_error(error, client_object_error_quark(), 1,
-				"Could not register hook for adding vCards");
-		}
-	}
+    if ((guint)-1 == hooks_register_hook(COMPOSE_CREATED_HOOKLIST, my_compose_create_hook, NULL)) {
+        g_warning("Could not register hook for adding vCards");
+        if (error) {
+            g_set_error(error, client_object_error_quark(), 1,
+                "Could not register hook for adding vCards");
+        }
+    }
 }
+

commit ec8c36f6bc4d68812d62cdf1f3a37f02d0563591
Author: Ricardo Mones <ricardo at mones.org>
Date:   Wed Jan 2 13:21:06 2019 +0100

    Remove mention of unused library

diff --git a/doc/man/claws-mail.1 b/doc/man/claws-mail.1
index 4b3fa7e..85ec7a9 100644
--- a/doc/man/claws-mail.1
+++ b/doc/man/claws-mail.1
@@ -1,4 +1,4 @@
-.TH "CLAWS MAIL" "1" "March 26, 2017" "The Claws Mail team" "User Manuals"
+.TH "CLAWS MAIL" "1" "January 2, 2019" "The Claws Mail team" "User Manuals"
 
 .SH "NAME"
 .LP
@@ -84,7 +84,7 @@ Currently implemented features include:
 .br
 \[bu] internationalization of UI messages by gettext
 .br
-\[bu] support of many code sets, including UTF\-8 (Unicode) (when using libjconv)
+\[bu] support of many code sets, including UTF\-8 (Unicode)
 .br
 \[bu] support for plugins
 \fR

commit 17feba13cdd7901bd97a6540a5c1155862fde747
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Dec 30 16:06:15 2018 +0100

    More user-friendly dependency check for python plugin

diff --git a/configure.ac b/configure.ac
index 679597f..0805631 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1267,6 +1267,7 @@ if test x"$HAVE_GPGME" = xyes; then
 fi
 
 dnl Python *********************************************************************
+missing_python=""
 AM_PATH_PYTHON([2.5], [
 	AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
 	if test x"$PYTHON_CONFIG" = x"" ; then
@@ -1280,6 +1281,7 @@ AM_PATH_PYTHON([2.5], [
 	else
 		AC_MSG_WARN(python-config not found. Maybe you need to install development packages for Python.)
 		HAVE_PYTHON=no
+		missing_python="python-config"
 	fi
 
 	if test x"$HAVE_PYTHON" = xyes; then
@@ -1304,6 +1306,7 @@ AM_PATH_PYTHON([2.5], [
 			AC_MSG_RESULT(no)
 			AC_MSG_WARN(Could not find Python shared libary: ${PYTHON_SHARED_LIB}. Maybe you need to install development packages for Python.)
 			HAVE_PYTHON=no
+			missing_python="libpython"
 		else
 			AC_MSG_RESULT(yes)
 		fi
@@ -1311,6 +1314,9 @@ AM_PATH_PYTHON([2.5], [
 	fi
 	if test x"$HAVE_PYTHON" = xyes; then
 		PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 2.10.3, [AC_DEFINE(ENABLE_PYTHON, [1], [Enable Python support])], HAVE_PYTHON=no)
+		if test x"$HAVE_PYTHON" = xno; then
+			missing_python="pygtk-2.0 >= 2.10.3"
+		fi
 	fi
 ])
 AC_SUBST(PYTHON_SHARED_LIB)
@@ -1717,7 +1723,7 @@ if test x"$enable_python_plugin" != xno; then
 	dependencies_missing=""
 
 	if test x"$HAVE_PYTHON" = xno; then
-		dependencies_missing="python $dependencies_missing"
+		dependencies_missing="$missing_python $dependencies_missing"
 	fi
 
 	if test x"$dependencies_missing" = x; then

commit 393b3f9be35daa3332b915a11a20b61ef6b80e2e
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Dec 30 01:12:27 2018 +0100

    Respect quicksearch focus when refreshing summaryview to show new messages
    
    Fixes bug #2131: Focus stealing after mail check

diff --git a/src/summaryview.c b/src/summaryview.c
index e346253..6fb7f91 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -2347,7 +2347,11 @@ void summary_select_node(SummaryView *summaryview, GtkCMCTreeNode *node,
 		summary_lock(summaryview);
 		GTK_EVENTS_FLUSH();
 		summary_unlock(summaryview);
-		gtk_widget_grab_focus(GTK_WIDGET(ctree));
+
+		/* If quicksearch has focus, let's keep it there. */
+		if (!quicksearch_has_focus(summaryview->quicksearch))
+			summary_grab_focus(summaryview);
+
 		gtkut_ctree_node_move_if_on_the_edge(ctree, node, -1);
 
 		if (display_msg && summaryview->displayed == node)

commit 088ced3c4d1b710966d14fe9ac44ea16120adb9e
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Dec 30 00:48:43 2018 +0100

    Make "Edit Person Details" window not modal
    
    Patch by Salvatore De Paolis. Fixes bug #2045.

diff --git a/src/editaddress.c b/src/editaddress.c
index 8a448aa..c41ce81 100644
--- a/src/editaddress.c
+++ b/src/editaddress.c
@@ -850,7 +850,7 @@ static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
 	/* gtk_container_set_border_width(GTK_CONTAINER(window), 0); */
 	gtk_window_set_title(GTK_WINDOW(window), _("Edit Person Data"));
 	gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
-	gtk_window_set_modal(GTK_WINDOW(window), TRUE);	
+	gtk_window_set_modal(GTK_WINDOW(window), FALSE);
 	g_signal_connect(G_OBJECT(window), "delete_event",
 			 G_CALLBACK(edit_person_delete_event),
 			 cancelled);

commit 83d74cbbf6ea95bb7a970467d6869eec4d95b24a
Author: Stephan Sachse <ste.sachse at gmail.com>
Date:   Sun Jul 26 02:22:15 2015 +0200

    fix nntp manually filtering with account specific rules
    
    manually running filter on nntp folders doesn't work correctly with
    account specific rules. filtering_match_condition() in filtering.c:568
    always gets a NULL as ac_prefs and every check with ac_prefs fails
    subsequently. later cur_account is used instead, what is imo clearly
    wrong and useless.
    
    i have patched summaryview.c:5649 summary_filter() to extract the
    account data from summaryview and hand over them as new parameter to
    summary_filter_func().
    
    works for me on fedora 22 and claws-mail-3.11.1
    
    Signed-off-by: Stephan Sachse <ste.sachse at gmail.com>
    Signed-off-by: Andrej Kacian <ticho at claws-mail.org>

diff --git a/src/summaryview.c b/src/summaryview.c
index 731f6d9..e346253 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -231,7 +231,8 @@ static void summary_unthread_for_exec_func	(GtkCMCTree	*ctree,
 void summary_simplify_subject(SummaryView *summaryview, gchar * rexp,
 			      GSList * mlist);
 
-static void summary_filter_func		(MsgInfo *msginfo);
+static void summary_filter_func		(MsgInfo		*msginfo,
+					 PrefsAccount		*ac_prefs);
 
 static void summary_colorlabel_menu_item_activate_cb
 					  (GtkWidget	*widget,
@@ -5821,6 +5822,7 @@ static gboolean summary_filter_get_mode(void)
 void summary_filter(SummaryView *summaryview, gboolean selected_only)
 {
 	GSList *mlist = NULL, *cur_list;
+	PrefsAccount *ac_prefs = NULL;
 	summary_lock(summaryview);
 
 	/* are there any per-account filtering rules? */
@@ -5855,9 +5857,13 @@ void summary_filter(SummaryView *summaryview, gboolean selected_only)
 		mlist = folder_item_get_msg_list(summaryview->folder_item);
 	}
 	
+	ac_prefs = ((summaryview->folder_item->folder != NULL) &&
+			(summaryview->folder_item->folder->account != NULL))
+		? summaryview->folder_item->folder->account : NULL;
+
 	folder_item_set_batch(summaryview->folder_item, TRUE);
 	for (cur_list = mlist; cur_list; cur_list = cur_list->next) {
-		summary_filter_func((MsgInfo *)cur_list->data);
+		summary_filter_func((MsgInfo *)cur_list->data, ac_prefs);
 	}
 	folder_item_set_batch(summaryview->folder_item, FALSE);
 	
@@ -5884,7 +5890,7 @@ void summary_filter(SummaryView *summaryview, gboolean selected_only)
 	summary_show(summaryview, summaryview->folder_item);
 }
 
-static void summary_filter_func(MsgInfo *msginfo)
+static void summary_filter_func(MsgInfo *msginfo, PrefsAccount *ac_prefs)
 {
 	MailFilteringData mail_filtering_data;
 
@@ -5895,7 +5901,7 @@ static void summary_filter_func(MsgInfo *msginfo)
 	if (hooks_invoke(MAIL_MANUAL_FILTERING_HOOKLIST, &mail_filtering_data))
 		return;
 
-	filter_message_by_msginfo(filtering_rules, msginfo, NULL,
+	filter_message_by_msginfo(filtering_rules, msginfo, ac_prefs,
 			FILTERING_MANUALLY, NULL);
 }
 

commit 013e2cf70d0ca5b44e8f0a5876e4680f818e0839
Author: Stephan Sachse <ste.sachse at gmail.com>
Date:   Sun Jul 26 01:34:55 2015 +0200

    fix nntp filtering on incoming messages
    
    this should fix bug #1920 and bug #2627
    
    folder_item_scan_full() in folder.c at line 2343 applies filter only to
    folder items of special type F_INBOX. but nntp folder items are of
    special folder item type F_NORMAL and folder type F_NEWS. so i change
    the condition for do_filter to also match nntp folders. works for me on
    fedora 22 and claws-mail-3.11.1
    
    Signed-off-by: Stephan Sachse <ste.sachse at gmail.com>
    Signed-off-by: Andrej Kacian <ticho at claws-mail.org>

diff --git a/src/folder.c b/src/folder.c
index 1637ea0..b9a9c99 100644
--- a/src/folder.c
+++ b/src/folder.c
@@ -2372,10 +2372,12 @@ gint folder_item_scan_full(FolderItem *item, gboolean filtering)
 	if (newmsg_list != NULL) {
 		GSList *elem, *to_filter = NULL;
 		gboolean do_filter = (filtering == TRUE) &&
-		    			(item->stype == F_INBOX) &&
-		   			(item->folder->account != NULL) && 
-		   			(item->folder->account->filter_on_recv);
-		
+			(item->folder->account != NULL) &&
+			(item->folder->account->filter_on_recv) &&
+			((item->stype == F_INBOX) ||
+			 ((item->stype == F_NORMAL) &&
+			  (FOLDER_TYPE(item->folder) == F_NEWS)));
+
 		for (elem = newmsg_list; elem != NULL; elem = g_slist_next(elem)) {
 			MsgInfo *msginfo = (MsgInfo *) elem->data;
 

commit 1135c8b51920fe16b2b5d3ddd42c203a91df7c66
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 21:14:25 2018 +0100

    Fix use after free in rare code path in rssyl_subscribe()

diff --git a/src/plugins/rssyl/rssyl_subscribe.c b/src/plugins/rssyl/rssyl_subscribe.c
index 1af78c5..807bafb 100644
--- a/src/plugins/rssyl/rssyl_subscribe.c
+++ b/src/plugins/rssyl/rssyl_subscribe.c
@@ -156,11 +156,10 @@ FolderItem *rssyl_subscribe(FolderItem *parent, const gchar *url,
 	if (!new_item) {
 		if (verbose & RSSYL_SHOW_ERRORS)
 			alertpanel_error(_("Couldn't create folder for new feed '%s'."),
-					myurl);
+					feed_get_url(ctx->feed));
 		feed_free(ctx->feed);
 		g_free(ctx->error);
 		g_free(ctx); 
-		g_free(myurl);
 		return NULL;
 	}
 

commit 6ff1484e48a850553a9edb5312633ec2eca2e4fb
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 17:05:27 2018 +0100

    Restore line removed by mistake in previous commit.

diff --git a/src/gtk/w32_filesel.c b/src/gtk/w32_filesel.c
index 3a37b7b..6fd017f 100644
--- a/src/gtk/w32_filesel.c
+++ b/src/gtk/w32_filesel.c
@@ -170,6 +170,7 @@ static const gboolean _file_open_dialog(const gchar *path, const gchar *title,
 		win_filter16 = g_malloc0(conv_items*sz*2 + sz*3);
 		memcpy(win_filter16, filter16, conv_items*sz);
 		memcpy(win_filter16 + conv_items + 1, filter16, conv_items*sz);
+		g_free(filter16);
 
 		if (error != NULL) {
 			debug_print("dialog title '%s' conversion to UTF-16 failed\n", title);

commit f63d7103445e173946db3c88a7c08a436fad5af6
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 15:51:35 2018 +0100

    Fix incorrect pointer arithmetic in w32_filesel.c
    
    This caused the lpstrFilter parameter to be set up
    incorrectly, and a buffer overflow.

diff --git a/src/gtk/w32_filesel.c b/src/gtk/w32_filesel.c
index 1aa6902..3a37b7b 100644
--- a/src/gtk/w32_filesel.c
+++ b/src/gtk/w32_filesel.c
@@ -169,8 +169,7 @@ static const gboolean _file_open_dialog(const gchar *path, const gchar *title,
 		sz = sizeof(gunichar2);
 		win_filter16 = g_malloc0(conv_items*sz*2 + sz*3);
 		memcpy(win_filter16, filter16, conv_items*sz);
-		memcpy(win_filter16 + conv_items*sz + sz, filter16, conv_items*sz);
-		g_free(filter16);
+		memcpy(win_filter16 + conv_items + 1, filter16, conv_items*sz);
 
 		if (error != NULL) {
 			debug_print("dialog title '%s' conversion to UTF-16 failed\n", title);

commit a847751979e192e68fd2c2b55e77d773843d5d93
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:26:26 2018 +0100

    Do not needlessly cast time_t to long long int for debug_print()

diff --git a/src/plugins/libravatar/libravatar_missing.c b/src/plugins/libravatar/libravatar_missing.c
index 0ff67f0..8f3ebde 100644
--- a/src/plugins/libravatar/libravatar_missing.c
+++ b/src/plugins/libravatar/libravatar_missing.c
@@ -83,7 +83,7 @@ close_exit:
 static void missing_save_item(gpointer key, gpointer value, gpointer data)
 {
 	FILE *file = (FILE *)data;
-	gchar *line = g_strdup_printf("%s %llu\n", (gchar *)key, *((long long unsigned *)value));
+	gchar *line = g_strdup_printf("%s %lu\n", (gchar *)key, *(time_t *)value);
 	if (claws_fputs(line, file) < 0)
 		g_warning("error saving missing item");
 	g_free(line);
@@ -138,10 +138,10 @@ void missing_add_md5(GHashTable *table, const gchar *md5)
 		seen = g_malloc0(sizeof(time_t));
 		*seen = t;
 		g_hash_table_insert(table, g_strdup(md5), seen);
-		debug_print("New md5 %s added with time %llu\n", md5, (long long unsigned)t);
+		debug_print("New md5 %s added with time %lu\n", md5, t);
 	} else {
 		*seen = t; /* just update */
-		debug_print("Updated md5 %s with time %llu\n", md5, (long long unsigned)t);
+		debug_print("Updated md5 %s with time %lu\n", md5, t);
 	}
 }
 
diff --git a/src/plugins/rssyl/parse822.c b/src/plugins/rssyl/parse822.c
index 3f12414..9190889 100644
--- a/src/plugins/rssyl/parse822.c
+++ b/src/plugins/rssyl/parse822.c
@@ -137,7 +137,7 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path)
 				/* Last-Seen timestamp */
 				if( !strcmp(line[0], "X-RSSyl-Last-Seen") ) {
 					ctx->last_seen = atol(line[1]);
-					debug_print("RSSyl: got last_seen timestamp %lld\n", (long long)ctx->last_seen);
+					debug_print("RSSyl: got last_seen timestamp %ld\n", ctx->last_seen);
 				}
 
 				/* ID */
diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c
index 21a9227..db6acf3 100644
--- a/src/plugins/vcalendar/vcal_folder.c
+++ b/src/plugins/vcalendar/vcal_folder.c
@@ -1170,8 +1170,8 @@ static void vcal_set_mtime(Folder *folder, FolderItem *item)
 	}
 
 	item->mtime = s.st_mtime;
-	debug_print("VCAL: forced mtime of %s to %lld\n",
-			item->name?item->name:"(null)", (long long)item->mtime);
+	debug_print("VCAL: forced mtime of %s to %ld\n",
+			item->name?item->name:"(null)", item->mtime);
 	g_free(path);
 }
 
diff --git a/src/plugins/vcalendar/vcal_manager.c b/src/plugins/vcalendar/vcal_manager.c
index 073fd36..d2e8dae 100644
--- a/src/plugins/vcalendar/vcal_manager.c
+++ b/src/plugins/vcalendar/vcal_manager.c
@@ -926,7 +926,7 @@ void vcal_manager_save_event (VCalEvent *event, gboolean export_after)
 	xml_tag_add_attr(tag, xml_attr_new("type", tmp));
 	g_free(tmp);
 	
-	tmp = g_strdup_printf("%lld", (long long)event->postponed);
+	tmp = g_strdup_printf("%ld", event->postponed);
 	xml_tag_add_attr(tag, xml_attr_new("postponed", tmp));
 	g_free(tmp);
 	
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index 178ab58..0e570ad 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -1838,8 +1838,8 @@ void multisync_export(void)
 	list = vcal_folder_get_waiting_events();
 	for (cur = list; cur; cur = cur->next) {
 		VCalEvent *event = (VCalEvent *)cur->data;
-		file = g_strdup_printf("multisync%lld-%d",
-				(long long)time(NULL), i);
+		file = g_strdup_printf("multisync%ld-%d",
+				time(NULL), i);
 
 		i++;
 

commit 4000e9bc70508402998e0432d5da81d45bdc3c19
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:23:03 2018 +0100

    Fix printf formats for size_t and goffset arguments.
    
    Use G_GSIZE_FORMAT and G_GOFFSET_FORMAT macros
    instead of hardcoded literal formats, because these
    types can have different sizes on different platforms.

diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c
index 7c8a244..ebe6168 100644
--- a/src/common/ssl_certificate.c
+++ b/src/common/ssl_certificate.c
@@ -176,11 +176,14 @@ static void gnutls_export_X509_fp(FILE *fp, gnutls_x509_crt_t x509_cert, gnutls_
 	int r;
 	
 	if ((r = gnutls_x509_crt_export(x509_cert, format, output, &cert_size)) < 0) {
-		g_warning("couldn't export cert %s (%zd)", gnutls_strerror(r), cert_size);
+		g_warning("couldn't export cert %s (%"G_GSIZE_FORMAT")", gnutls_strerror(r), cert_size);
 		return;
 	}
-
+#ifdef G_OS_WIN32
+	debug_print("writing %Iu bytes\n",cert_size);
+#else
 	debug_print("writing %zd bytes\n",cert_size);
+#endif
 	if (claws_fwrite(&output, 1, cert_size, fp) < cert_size) {
 		g_warning("failed to write cert: %d %s", errno, g_strerror(errno));
 	}
@@ -197,7 +200,7 @@ size_t gnutls_i2d_X509(gnutls_x509_crt_t x509_cert, unsigned char **output)
 	*output = malloc(cert_size);
 
 	if ((r = gnutls_x509_crt_export(x509_cert, GNUTLS_X509_FMT_DER, *output, &cert_size)) < 0) {
-		g_warning("couldn't export cert %s (%zd)", gnutls_strerror(r), cert_size);
+		g_warning("couldn't export cert %s (%"G_GSIZE_FORMAT")", gnutls_strerror(r), cert_size);
 		free(*output);
 		*output = NULL;
 		return 0;
@@ -216,7 +219,7 @@ size_t gnutls_i2d_PrivateKey(gnutls_x509_privkey_t pkey, unsigned char **output)
 	*output = malloc(key_size);
 
 	if ((r = gnutls_x509_privkey_export(pkey, GNUTLS_X509_FMT_DER, *output, &key_size)) < 0) {
-		g_warning("couldn't export key %s (%zd)", gnutls_strerror(r), key_size);
+		g_warning("couldn't export key %s (%"G_GSIZE_FORMAT")", gnutls_strerror(r), key_size);
 		free(*output);
 		*output = NULL;
 		return 0;
@@ -510,7 +513,7 @@ static gboolean ssl_certificate_compare (SSLCertificate *cert_a, SSLCertificate
 		return FALSE;
 	}
 	if (cert_size_a != cert_size_b) {
-		g_warning("size differ %zd %zd", cert_size_a, cert_size_b);
+		g_warning("size differ %"G_GSIZE_FORMAT" %"G_GSIZE_FORMAT, cert_size_a, cert_size_b);
 		g_free(output_a);
 		g_free(output_b);
 		return FALSE;
diff --git a/src/common/utils.c b/src/common/utils.c
index c4364c4..ec87994 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -4547,7 +4547,7 @@ guchar *g_base64_decode_zero(const gchar *text, gsize *out_len)
 	g_free(tmp);
 
 	if (strlen(out) != *out_len) {
-		g_warning ("strlen(out) %zd != *out_len %" G_GSIZE_FORMAT, strlen(out), *out_len);
+		g_warning ("strlen(out) %"G_GSIZE_FORMAT" != *out_len %"G_GSIZE_FORMAT, strlen(out), *out_len);
 	}
 
 	return out;
@@ -4617,7 +4617,7 @@ get_random_bytes(void *buf, size_t count)
 	/* Read data from the source into buf. */
 #if defined G_OS_WIN32
 	if (!CryptGenRandom(rnd, count, buf)) {
-		debug_print("Could not read %zd random bytes.\n", count);
+		debug_print("Could not read %"G_GSIZE_FORMAT" random bytes.\n", count);
 		CryptReleaseContext(rnd, 0);
 		return FALSE;
 	}
diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c
index c6dd801..be5678c 100644
--- a/src/etpan/imap-thread.c
+++ b/src/etpan/imap-thread.c
@@ -161,7 +161,7 @@ static void imap_logger_cmd(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 8192) {
-		log_print(LOG_PROTOCOL, "IMAP%c [CMD data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [CMD data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	}
 	buf = malloc(size+1);
@@ -196,7 +196,7 @@ static void imap_logger_fetch(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 128 && !direction) {
-		log_print(LOG_PROTOCOL, "IMAP%c [FETCH data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [FETCH data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	}
 	
@@ -222,7 +222,7 @@ static void imap_logger_fetch(int direction, const char * str, size_t size)
 			i++;
 		}
 	} else {
-		log_print(LOG_PROTOCOL, "IMAP%c [data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 	}
 	g_strfreev(lines);
 	free(buf);
@@ -235,7 +235,7 @@ static void imap_logger_uid(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 8192) {
-		log_print(LOG_PROTOCOL, "IMAP%c [UID data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [UID data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	}
 	buf = malloc(size+1);
@@ -277,10 +277,10 @@ static void imap_logger_append(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 8192) {
-		log_print(LOG_PROTOCOL, "IMAP%c [APPEND data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [APPEND data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	} else if (direction == 0 && size > 64) {
-		log_print(LOG_PROTOCOL, "IMAP%c [APPEND data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [APPEND data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	} 
 	buf = malloc(size+1);
@@ -305,7 +305,7 @@ static void imap_logger_append(int direction, const char * str, size_t size)
 			i++;
 		}
 	} else {
-		log_print(LOG_PROTOCOL, "IMAP%c [data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 	}
 	g_strfreev(lines);
 	free(buf);
diff --git a/src/etpan/nntp-thread.c b/src/etpan/nntp-thread.c
index ccaede9..bf67cd0 100644
--- a/src/etpan/nntp-thread.c
+++ b/src/etpan/nntp-thread.c
@@ -136,7 +136,7 @@ static void nntp_logger(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 256) {
-		log_print(LOG_PROTOCOL, "NNTP%c [data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "NNTP%c [data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	}
 	buf = malloc(size+1);
diff --git a/src/imap.c b/src/imap.c
index 264dd7d..db6770a 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -1587,7 +1587,7 @@ static gchar *imap_fetch_msg_full(Folder *folder, FolderItem *item, gint uid,
 				ok = file_strip_crs(filename);
 				if (ok == 0 && cached && cached->size <= have_size) {
 					/* we have it all and stripped */
-					debug_print("...fully cached in fact (%u/%zd); setting flag.\n",
+					debug_print("...fully cached in fact (%u/%"G_GOFFSET_FORMAT"); setting flag.\n",
 							have_size, cached->size);
 					procmsg_msginfo_set_flags(cached, MSG_FULLY_CACHED, 0);
 				}
@@ -1691,7 +1691,7 @@ static gboolean imap_is_msg_fully_cached(Folder *folder, FolderItem *item, gint
 		size = get_file_size_with_crs(filename);
 	}
 	g_free(filename);
-	debug_print("msg %d cached, has size %d, full should be %zd.\n", uid, size, cached->size);
+	debug_print("msg %d cached, has size %d, full should be %"G_GOFFSET_FORMAT".\n", uid, size, cached->size);
 	if (cached && size >= cached->size) {
 		cached->total_size = cached->size;
 		procmsg_msginfo_set_flags(cached, MSG_FULLY_CACHED, 0);
diff --git a/src/msgcache.c b/src/msgcache.c
index 3910255..fd07397 100644
--- a/src/msgcache.c
+++ b/src/msgcache.c
@@ -306,7 +306,7 @@ gint msgcache_get_memory_usage(MsgCache *cache)
 	size_t ni; \
  \
 	if ((ni = claws_fread(&idata, sizeof(idata), 1, fp)) != 1) { \
-		g_warning("read_int: Cache data corrupted, read %zd of %zd at " \
+		g_warning("read_int: Cache data corrupted, read %"G_GSIZE_FORMAT" of %"G_GSIZE_FORMAT" at " \
 			  "offset %ld", ni, sizeof(idata), ftell(fp)); \
 		procmsg_msginfo_free(&msginfo); \
 		error = TRUE; \
@@ -467,16 +467,16 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str,
 	if (!swapping) {
 		if ((ni = claws_fread(&len, sizeof(len), 1, fp) != 1) ||
 		    len > G_MAXINT) {
-			g_warning("read_data_str: Cache data (len) corrupted, read %zd "
-				  "of %zd bytes at offset %ld", ni, sizeof(len),
+			g_warning("read_data_str: Cache data (len) corrupted, read %"G_GSIZE_FORMAT
+				  " of %"G_GSIZE_FORMAT" bytes at offset %ld", ni, sizeof(len),
 				  ftell(fp));
 			return -1;
 		}
 	} else {
 		if ((ni = claws_fread(&len, sizeof(len), 1, fp) != 1) ||
 		    bswap_32(len) > G_MAXINT) {
-			g_warning("read_data_str: Cache data (len) corrupted, read %zd "
-				  "of %zd bytes at offset %ld", ni, sizeof(len),
+			g_warning("read_data_str: Cache data (len) corrupted, read %"G_GSIZE_FORMAT
+				  " of %"G_GSIZE_FORMAT" bytes at offset %ld", ni, sizeof(len),
 				  ftell(fp));
 			return -1;
 		}
@@ -493,7 +493,7 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str,
 	}
 
 	if ((ni = claws_fread(tmpstr, 1, len, fp)) != len) {
-		g_warning("read_data_str: Cache data corrupted, read %zd of %u "
+		g_warning("read_data_str: Cache data corrupted, read %"G_GSIZE_FORMAT" of %u "
 			  "bytes at offset %ld",
 			  ni, len, ftell(fp));
 		g_free(tmpstr);
diff --git a/src/password.c b/src/password.c
index 463715b..8105820 100644
--- a/src/password.c
+++ b/src/password.c
@@ -188,7 +188,7 @@ gboolean master_passphrase_is_correct(const gchar *input)
 	g_strfreev(tokens);
 
 	if (kd_len != KD_LENGTH) {
-		debug_print("master_passphrase is %ld bytes long, should be %d.\n",
+		debug_print("master_passphrase is %"G_GSIZE_FORMAT" bytes long, should be %d.\n",
 				kd_len, KD_LENGTH);
 		g_free(kd);
 		return FALSE;
@@ -488,7 +488,7 @@ gchar *password_decrypt_gnutls(const gchar *password,
 			g_free(tmp);
 		return NULL;
 	}
-	debug_print("Encrypted password string length: %lu\n", len);
+	debug_print("Encrypted password string length: %"G_GSIZE_FORMAT"\n", len);
 
 	/* Initialize the decryption */
 	ret = gnutls_cipher_init(&handle, algo, &key, &iv);
diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c
index 3792e84..a6eddb2 100644
--- a/src/plugins/fancy/fancy_viewer.c
+++ b/src/plugins/fancy/fancy_viewer.c
@@ -457,7 +457,7 @@ static void resource_request_starting_cb(WebKitWebView		*view,
 		webkit_network_request_set_uri(request, "about:blank");
 	}
 	else
-		debug_print("Starting request of %zu %s\n", strlen(uri), uri);
+		debug_print("Starting request of %"G_GSIZE_FORMAT" %s\n", strlen(uri), uri);
 }
 
 static gboolean fancy_text_search(MimeViewer *_viewer, gboolean backward,
diff --git a/src/plugins/libravatar/libravatar_image.c b/src/plugins/libravatar/libravatar_image.c
index d36408e..9a0338b 100644
--- a/src/plugins/libravatar/libravatar_image.c
+++ b/src/plugins/libravatar/libravatar_image.c
@@ -37,7 +37,7 @@
 static size_t write_image_data_cb(void *ptr, size_t size, size_t nmemb, void *stream)
 {
 	size_t written = claws_fwrite(ptr, size, nmemb, (FILE *)stream);
-	debug_print("received %zu bytes from avatar server\n", written);
+	debug_print("received %"G_GSIZE_FORMAT" bytes from avatar server\n", written);
 
 	return written;
 }
diff --git a/src/plugins/tnef_parse/tnef_parse.c b/src/plugins/tnef_parse/tnef_parse.c
index be8812d..82a8f9e 100644
--- a/src/plugins/tnef_parse/tnef_parse.c
+++ b/src/plugins/tnef_parse/tnef_parse.c
@@ -297,7 +297,7 @@ static gboolean tnef_parse (MimeParser *parser, MimeInfo *mimeinfo)
 	if (mimeinfo->content == MIMECONTENT_FILE)
 		debug_print("content: %s\n", mimeinfo->data.filename);
 	else 
-		debug_print("contents in memory (len %zd)\n", 
+		debug_print("contents in memory (len %"G_GSIZE_FORMAT")\n", 
 			strlen(mimeinfo->data.mem));
 	
 	tnef = g_new0(TNEFStruct, 1);
diff --git a/src/procmime.c b/src/procmime.c
index 1a375be..ca9da56 100644
--- a/src/procmime.c
+++ b/src/procmime.c
@@ -1309,7 +1309,7 @@ EncodingType procmime_get_encoding_for_text_file(const gchar *file, gboolean *ha
 		octet_percentage = 0.0;
 
 	debug_print("procmime_get_encoding_for_text_file(): "
-		    "8bit chars: %zd / %zd (%f%%)\n", octet_chars, total_len,
+		    "8bit chars: %"G_GSIZE_FORMAT" / %"G_GSIZE_FORMAT" (%f%%)\n", octet_chars, total_len,
 		    100.0 * octet_percentage);
 
 	if (octet_percentage > 0.20 || force_b64) {
@@ -2511,7 +2511,7 @@ static gint procmime_write_message_rfc822(MimeInfo *mimeinfo, FILE *fp)
 			}
 			len = strlen(buf);
 			if (claws_fwrite(buf, sizeof(gchar), len, fp) < len) {
-				g_warning("failed to dump %zd bytes from file", len);
+				g_warning("failed to dump %"G_GSIZE_FORMAT" bytes from file", len);
 				claws_fclose(infp);
 				return -1;
 			}
@@ -2523,7 +2523,7 @@ static gint procmime_write_message_rfc822(MimeInfo *mimeinfo, FILE *fp)
 	case MIMECONTENT_MEM:
 		len = strlen(mimeinfo->data.mem);
 		if (claws_fwrite(mimeinfo->data.mem, sizeof(gchar), len, fp) < len) {
-			g_warning("failed to dump %zd bytes from mem", len);
+			g_warning("failed to dump %"G_GSIZE_FORMAT" bytes from mem", len);
 			return -1;
 		}
 		break;
@@ -2575,7 +2575,7 @@ static gint procmime_write_multipart(MimeInfo *mimeinfo, FILE *fp)
 				break;
 			len = strlen(buf);
 			if (claws_fwrite(buf, sizeof(gchar), len, fp) < len) {
-				g_warning("failed to write %zd", len);
+				g_warning("failed to write %"G_GSIZE_FORMAT, len);
 				claws_fclose(infp);
 				return -1;
 			}
@@ -2590,7 +2590,7 @@ static gint procmime_write_multipart(MimeInfo *mimeinfo, FILE *fp)
 			*(str2 - 2) = '\0';
 		len = strlen(str);
 		if (claws_fwrite(str, sizeof(gchar), len, fp) < len) {
-			g_warning("failed to write %zd from mem", len);
+			g_warning("failed to write %"G_GSIZE_FORMAT" from mem", len);
 			g_free(str);
 			return -1;
 		}

commit c3356e9c5e8e6123166640fbda2ef5520572ddba
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:21:19 2018 +0100

    Fix pid handling in debug output of kill_children_cb()
    
    On Windows, "pid" points to a HANDLE object, not to
    an integer.

diff --git a/src/action.c b/src/action.c
index 8a6e76d..52cc357 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1056,13 +1056,14 @@ static void kill_children_cb(GtkWidget *widget, gpointer data)
 
 	for (cur = children->list; cur; cur = cur->next) {
 		child_info = (ChildInfo *)(cur->data);
+#ifdef G_OS_WIN32
+		debug_print("Killing child group HANDLE %p\n", child_info->pid);
+		TerminateProcess(child_info->pid, 0);
+#else
 		debug_print("Killing child group id %d\n", child_info->pid);
-#ifdef G_OS_UNIX
 		if (child_info->pid && kill(child_info->pid, child_info->next_sig) < 0)
 			perror("kill");
 		child_info->next_sig = SIGKILL;
-#else
-		TerminateProcess(child_info->pid, 0);
 #endif
 	}
 }

commit 5fdaf05218fd69fad9b56e888c46eeacd0e89cec
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:09:42 2018 +0100

    Emulate strftime's %r on Windows which does not have that

diff --git a/src/common/utils.c b/src/common/utils.c
index feda18d..c4364c4 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -4234,7 +4234,11 @@ size_t fast_strftime(gchar *buf, gint buflen, const gchar *format, struct tm *lt
 				}
 				break;
 			case 'r':
+#ifdef G_OS_WIN32
+				strftime(subbuf, 64, "%I:%M:%S %p", lt);
+#else
 				strftime(subbuf, 64, "%r", lt);
+#endif
 				len = strlen(subbuf); CHECK_SIZE();
 				strncpy2(curpos, subbuf, buflen - total_done);
 				break;

commit 80f21116290b7be14cb27a162921d0ea6915b2ce
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:08:46 2018 +0100

    Fix missing ws2tcpip.h include for Windows

diff --git a/src/common/utils.c b/src/common/utils.c
index 195193b..feda18d 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -49,8 +49,10 @@
 #include <ctype.h>
 #include <errno.h>
 #include <sys/param.h>
-#ifndef G_OS_WIN32
-#include <sys/socket.h>
+#ifdef G_OS_WIN32
+#  include <ws2tcpip.h>
+#else
+#  include <sys/socket.h>
 #endif
 
 #if (HAVE_WCTYPE_H && HAVE_WCHAR_H)

commit f59f7fa6cac7bf13f9ea3873398cfbf9e38a5efc
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:01:56 2018 +0100

    Remove an unused enum which was committed by mistake

diff --git a/src/common/codeconv.h b/src/common/codeconv.h
index 862d303..61c3a06 100644
--- a/src/common/codeconv.h
+++ b/src/common/codeconv.h
@@ -178,12 +178,6 @@ struct _CodeConverter
 #define C_INTERNAL		C_UTF_8
 #define CS_INTERNAL		CS_UTF_8
 
-typedef enum {
-	CODECONV_NOSPACE = -2,
-	CODECONV_FAIL = -1,
-	CODECONV_OK   = 0
-} CodeconvResult;
-
 void conv_utf8todisp	(gchar *outbuf, gint outlen, const gchar *inbuf);
 void conv_localetodisp	(gchar *outbuf, gint outlen, const gchar *inbuf);
 

commit c8fe9fb73f29ead09c2a3b9ce64bba52bb317fb5
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 13:53:25 2018 +0100

    Remove use of %hhu format in managesieve for g_strdup_printf()

diff --git a/src/plugins/managesieve/sieve_prefs.c b/src/plugins/managesieve/sieve_prefs.c
index ec37130..a398cfc 100644
--- a/src/plugins/managesieve/sieve_prefs.c
+++ b/src/plugins/managesieve/sieve_prefs.c
@@ -579,7 +579,7 @@ void sieve_prefs_account_set_config(
 		enc_userid = g_base64_encode(config->userid, len);
 	}
 
-	confstr = g_strdup_printf("%c%c %s %c%hu %hhu %hhu %hhu %s",
+	confstr = g_strdup_printf("%c%c %s %c%hu %hu %hu %hu %s",
 			config->enable ? 'y' : 'n',
 			config->use_host ? 'y' : 'n',
 			config->host && config->host[0] ? config->host : "!",

commit 302382cdcb989d7a7458ef3e7ef7740c90162d9b
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 13:19:30 2018 +0100

    Fix alertpanel API use in win32 part of mimeview.c

diff --git a/src/common/codeconv.h b/src/common/codeconv.h
index 2704985..862d303 100644
--- a/src/common/codeconv.h
+++ b/src/common/codeconv.h
@@ -178,6 +178,11 @@ struct _CodeConverter
 #define C_INTERNAL		C_UTF_8
 #define CS_INTERNAL		CS_UTF_8
 
+typedef enum {
+	CODECONV_NOSPACE = -2,
+	CODECONV_FAIL = -1,
+	CODECONV_OK   = 0
+} CodeconvResult;
 
 void conv_utf8todisp	(gchar *outbuf, gint outlen, const gchar *inbuf);
 void conv_localetodisp	(gchar *outbuf, gint outlen, const gchar *inbuf);
diff --git a/src/mimeview.c b/src/mimeview.c
index 745dcab..11faa54 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -2301,7 +2301,7 @@ static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo,
 					"your computer.\n\n"
 					"Do you want to run this file?"), GTK_STOCK_CANCEL, 
 					_("Run binary"),
-		      		      NULL, FALSE, NULL, ALERT_WARNING, G_ALERTDEFAULT);
+		      		      NULL, ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING);
 		if (val == G_ALERTALTERNATE) {
 			debug_print("executing binary\n");
 			ShellExecute(NULL, L"open", (LPCWSTR)fn16, NULL, NULL, SW_SHOW);

commit 2ceb0d43d3469c600b0c52f99b752b6a8498fb4a
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Dec 27 13:50:13 2018 +0100

    Fix incorrect charset conversion in sc_html_read_line().
    
    When converting from single-byte to multi-byte encoding,
    the resulting string can sometimes have more bytes than
    the original.

diff --git a/src/html.c b/src/html.c
index b702404..eb921c7 100644
--- a/src/html.c
+++ b/src/html.c
@@ -135,7 +135,7 @@ gchar *sc_html_parse(SC_HTMLParser *parser)
 static SC_HTMLState sc_html_read_line(SC_HTMLParser *parser)
 {
 	gchar buf[SC_HTMLBUFSIZE];
-	gchar buf2[SC_HTMLBUFSIZE];
+	gchar buf2[SC_HTMLBUFSIZE*4];
 	gint index;
 	gint n;
 

commit 516496ca12a2f3d51ceb27ec8b1279672be361f0
Author: wwp <subscript at free.fr>
Date:   Mon Dec 24 19:49:46 2018 +0100

    Set a proper copyright header to the files added to the Python plugin
    source code.

diff --git a/src/plugins/python/python_prefs.c b/src/plugins/python/python_prefs.c
index bfc2c19..29ef1b7 100644
--- a/src/plugins/python/python_prefs.c
+++ b/src/plugins/python/python_prefs.c
@@ -1,20 +1,18 @@
-/*
- * Claws Mail -- A GTK+ based, lightweight, and fast e-mail client
- * Copyright(C) 1999-2015 the Claws Mail Team
- * == Fancy Plugin ==
- * This file Copyright (C) 2009-2015 Salvatore De Paolis
- * <iwkse at claws-mail.org> and the Claws Mail Team
+/* Python plugin for Claws Mail
+ * Copyright (C) 2009-2018 Holger Berndt and The Claws Mail Team
+ *
  * 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
  * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
+ *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write tothe Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/src/plugins/python/python_prefs.h b/src/plugins/python/python_prefs.h
index c762fc9..807ac37 100644
--- a/src/plugins/python/python_prefs.h
+++ b/src/plugins/python/python_prefs.h
@@ -1,20 +1,18 @@
-/* 
- * Claws Mail -- A GTK+ based, lightweight, and fast e-mail client
- * Copyright(C) 1999-2018 the Claws Mail Team
- * == Fancy Plugin ==
- * This file Copyright (C) 2009 -2014 Salvatore De Paolis
- * <iwkse at claws-mail.org> and the Claws Mail Team
+/* Python plugin for Claws Mail
+ * Copyright (C) 2009-2018 Holger Berndt and The Claws Mail Team
+ *
  * 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
  * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
+ *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write tothe Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef PYTHON_PREFS_H

commit 9914197299078221a5b0b747b36df5c563301f78
Author: wwp <subscript at free.fr>
Date:   Mon Dec 24 19:44:30 2018 +0100

    Window sizes are now remembered for the Python console,
    the 'Open URLs' and the 'Set mailbox order' windows.

diff --git a/src/gtk/foldersort.c b/src/gtk/foldersort.c
index fe5717d..a5a09b0 100644
--- a/src/gtk/foldersort.c
+++ b/src/gtk/foldersort.c
@@ -26,6 +26,7 @@
 #include "foldersort.h"
 #include "inc.h"
 #include "utils.h"
+#include "prefs_common.h"
 
 enum {
 	FOLDERSORT_COL_NAME,
@@ -209,6 +210,14 @@ static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, FolderSortDia
 	return FALSE;
 }
 
+static void foldersort_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation)
+{
+	cm_return_if_fail(allocation != NULL);
+
+	prefs_common.foldersortwin_width = allocation->width;
+	prefs_common.foldersortwin_height = allocation->height;
+}
+
 void foldersort_open()
 {
 	FolderSortDialog *dialog = g_new0(FolderSortDialog, 1);
@@ -233,6 +242,7 @@ void foldersort_open()
 	GtkCellRenderer *rdr;
 	GtkTreeSelection *selector;
 	GtkTreeIter iter;
+	static GdkGeometry geometry;
 
 	window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "foldersort");
 	g_object_set_data(G_OBJECT(window), "window", window);
@@ -240,9 +250,10 @@ void foldersort_open()
 	gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
 	gtk_window_set_title(GTK_WINDOW(window), _("Set mailbox order"));
 	gtk_window_set_modal(GTK_WINDOW(window), TRUE);
-	gtk_window_set_default_size(GTK_WINDOW(window), 400, 300);
 	g_signal_connect(G_OBJECT(window), "delete_event",
 			 G_CALLBACK(delete_event), dialog);
+	g_signal_connect (G_OBJECT(window), "size_allocate",
+			 G_CALLBACK (foldersort_size_allocate_cb), NULL);
 	g_signal_connect(G_OBJECT(window), "key_press_event",
 			 G_CALLBACK(key_pressed), dialog);
 
@@ -326,6 +337,16 @@ void foldersort_open()
 	gtk_widget_show(movedown_btn);
 	gtk_box_pack_start(GTK_BOX(btn_vbox), movedown_btn, FALSE, FALSE, 0);
 
+	if (!geometry.min_height) {
+		geometry.min_width = 400;
+		geometry.min_height = 300;
+	}
+
+	gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+				      GDK_HINT_MIN_SIZE);
+	gtk_widget_set_size_request(window, prefs_common.foldersortwin_width,
+				    prefs_common.foldersortwin_height);
+
 	dialog->window = window;
 	dialog->moveup_btn = moveup_btn;
 	dialog->movedown_btn = movedown_btn;
diff --git a/src/plugins/python/Makefile.am b/src/plugins/python/Makefile.am
index 36ca7c4..6c2e988 100644
--- a/src/plugins/python/Makefile.am
+++ b/src/plugins/python/Makefile.am
@@ -29,6 +29,8 @@ python_la_SOURCES = \
 	nodetype.c \
 	nodetype.h \
 	python_plugin.c \
+	python_prefs.c \
+	python_prefs.h \
 	python-hooks.c \
 	python-hooks.h \
 	python-shell.c \
diff --git a/src/plugins/python/python_plugin.c b/src/plugins/python/python_plugin.c
index e9fcd6e..c07181b 100644
--- a/src/plugins/python/python_plugin.c
+++ b/src/plugins/python/python_plugin.c
@@ -40,6 +40,7 @@
 #include "python-hooks.h"
 #include "clawsmailmodule.h"
 #include "file-utils.h"
+#include "python_prefs.h"
 
 #define PYTHON_SCRIPTS_BASE_DIR "python-scripts"
 #define PYTHON_SCRIPTS_MAIN_DIR "main"
@@ -70,13 +71,32 @@ static gboolean python_console_delete_event(GtkWidget *widget, GdkEvent *event,
   return TRUE;
 }
 
+static void size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation)
+{
+	cm_return_if_fail(allocation != NULL);
+
+	python_config.console_win_width = allocation->width;
+	python_config.console_win_height = allocation->height;
+}
+
 static void setup_python_console(void)
 {
   GtkWidget *vbox;
   GtkWidget *console;
+  static GdkGeometry geometry;
 
   python_console = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-  gtk_widget_set_size_request(python_console, 600, 400);
+  g_signal_connect (G_OBJECT(python_console), "size_allocate",
+		   G_CALLBACK (size_allocate_cb), NULL);
+  if (!geometry.min_height) {
+	  geometry.min_width = 600;
+	  geometry.min_height = 400;
+  }
+
+  gtk_window_set_geometry_hints(GTK_WINDOW(python_console), NULL, &geometry,
+				    GDK_HINT_MIN_SIZE);
+  gtk_widget_set_size_request(python_console, python_config.console_win_width,
+				  python_config.console_win_height);
 
   vbox = gtk_vbox_new(FALSE, 0);
   gtk_container_add(GTK_CONTAINER(python_console), vbox);
@@ -652,6 +672,9 @@ gint plugin_init(gchar **error)
   if(!check_plugin_version(MAKE_NUMERIC_VERSION(3,7,6,9), VERSION_NUMERIC, _("Python"), error))
     return -1;
 
+  /* init/load prefs */
+  python_prefs_init();
+
   /* load hooks */
   hook_compose_create = hooks_register_hook(COMPOSE_CREATED_HOOKLIST, my_compose_create_hook, NULL);
   if(hook_compose_create == 0) {
@@ -727,6 +750,9 @@ gboolean plugin_done(void)
 
   parasite_python_done();
 
+  /* save prefs */
+  python_prefs_done();
+
   debug_print("Python plugin done and unloaded.\n");
   return FALSE;
 }
diff --git a/src/plugins/python/python_prefs.c b/src/plugins/python/python_prefs.c
new file mode 100644
index 0000000..bfc2c19
--- /dev/null
+++ b/src/plugins/python/python_prefs.c
@@ -0,0 +1,88 @@
+/*
+ * Claws Mail -- A GTK+ based, lightweight, and fast e-mail client
+ * Copyright(C) 1999-2015 the Claws Mail Team
+ * == Fancy Plugin ==
+ * This file Copyright (C) 2009-2015 Salvatore De Paolis
+ * <iwkse at claws-mail.org> and the Claws Mail Team
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write tothe Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#include "claws-features.h"
+#endif
+
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include "common/version.h"
+#include "defs.h"
+#include "claws.h"
+#include "plugin.h"
+#include "file-utils.h"
+#include "utils.h"
+#include "prefs.h"
+#include "prefs_common.h"
+#include "prefs_gtk.h"
+#include "python_prefs.h"
+
+#define PREFS_BLOCK_NAME "Python"
+
+PythonConfig python_config;
+
+static PrefParam prefs[] = {
+        {"console_win_width", "-1", &python_config.console_win_width,
+		P_INT, NULL, NULL, NULL},
+        {"console_win_height", "-1", &python_config.console_win_height,
+		P_INT, NULL, NULL, NULL},
+        {0,0,0,0,0,0,0}
+};
+
+void python_prefs_init(void)
+{
+	static gchar *path[3];
+	gchar *rcpath;
+
+	path[0] = _("Plugins");
+	path[1] = "Python";
+	path[2] = NULL;
+
+	prefs_set_default(prefs);
+	rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
+	prefs_read_config(prefs, PREFS_BLOCK_NAME, rcpath, NULL);
+	g_free(rcpath);
+}
+
+void python_prefs_done(void)
+{
+	PrefFile *pref_file;
+	gchar *rc_file_path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
+					  COMMON_RC, NULL);
+	pref_file = prefs_write_open(rc_file_path);
+	g_free(rc_file_path);
+
+	if (!(pref_file) || (prefs_set_block_label(pref_file, PREFS_BLOCK_NAME) < 0))
+		return;
+	
+	if (prefs_write_param(prefs, pref_file->fp) < 0) {
+		g_warning("failed to write Python Plugin configuration");
+		prefs_file_close_revert(pref_file);
+		return;
+	}
+
+	if (fprintf(pref_file->fp, "\n") < 0) {
+		FILE_OP_ERROR(rc_file_path, "fprintf");
+		prefs_file_close_revert(pref_file);
+	} else
+		prefs_file_close(pref_file);
+}
diff --git a/src/plugins/python/python_prefs.h b/src/plugins/python/python_prefs.h
new file mode 100644
index 0000000..c762fc9
--- /dev/null
+++ b/src/plugins/python/python_prefs.h
@@ -0,0 +1,36 @@
+/* 
+ * Claws Mail -- A GTK+ based, lightweight, and fast e-mail client
+ * Copyright(C) 1999-2018 the Claws Mail Team
+ * == Fancy Plugin ==
+ * This file Copyright (C) 2009 -2014 Salvatore De Paolis
+ * <iwkse at claws-mail.org> and the Claws Mail Team
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write tothe Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef PYTHON_PREFS_H
+#define PYTHON_PREFS_H
+
+typedef struct _PythonConfig PythonConfig;
+
+struct _PythonConfig
+{
+	gint		console_win_width;
+	gint		console_win_height;
+};
+
+extern PythonConfig python_config;
+
+void python_prefs_init(void);
+void python_prefs_done(void);
+
+#endif
diff --git a/src/prefs_common.c b/src/prefs_common.c
index 61fcbeb..976b70e 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -1062,6 +1062,16 @@ static PrefParam param[] = {
 	{"sslmanwin_height", "-1", &prefs_common.sslmanwin_height, P_INT,
 	 NULL, NULL, NULL},
 
+	{"uriopenerwin_width", "-1", &prefs_common.uriopenerwin_width, P_INT,
+	 NULL, NULL, NULL},
+	{"uriopenerwin_height", "-1", &prefs_common.uriopenerwin_height, P_INT,
+	 NULL, NULL, NULL},
+
+	{"foldersortwin_width", "400", &prefs_common.foldersortwin_width, P_INT,
+	 NULL, NULL, NULL},
+	{"foldersortwin_height", "300", &prefs_common.foldersortwin_height, P_INT,
+	 NULL, NULL, NULL},
+
 	{"addressbookwin_width", "520", &prefs_common.addressbookwin_width, P_INT,
 	 NULL, NULL, NULL},
 	{"addressbookwin_height", "-1", &prefs_common.addressbookwin_height, P_INT,
diff --git a/src/prefs_common.h b/src/prefs_common.h
index 6f68d69..0a9fb18 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -498,6 +498,10 @@ struct _PrefsCommon
 	gint tagswin_height;
 	gint sslmanwin_width;
 	gint sslmanwin_height;
+	gint uriopenerwin_width;
+	gint uriopenerwin_height;
+	gint foldersortwin_width;
+	gint foldersortwin_height;
 	gint addressbookwin_width;
 	gint addressbookwin_height;
 	gint addressbookeditpersonwin_width;
diff --git a/src/uri_opener.c b/src/uri_opener.c
index fe855a7..ec6e19e 100644
--- a/src/uri_opener.c
+++ b/src/uri_opener.c
@@ -35,7 +35,6 @@
 #include "textview.h"
 #include "mimeview.h"
 #include "prefs_common.h"
-#include "prefs_common.h"
 
 enum {
 	URI_OPENER_URL,
@@ -154,12 +153,20 @@ static GtkWidget *uri_opener_scrolled_win_create(void)
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
 				       GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 				       
-	gtk_widget_set_size_request(scrolledwin, 500, 250);
+	gtk_widget_set_size_request(scrolledwin, 200, 250);
 	gtk_widget_show(scrolledwin);
 	
 	return scrolledwin;
 }
 
+static void uri_opener_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation)
+{
+	cm_return_if_fail(allocation != NULL);
+
+	prefs_common.uriopenerwin_width = allocation->width;
+	prefs_common.uriopenerwin_height = allocation->height;
+}
+
 static void uri_opener_create(void) 
 {
 	GtkWidget *window;
@@ -173,6 +180,7 @@ static void uri_opener_create(void)
 	GtkWidget *open_btn;
 	GtkWidget *close_btn;
 	GtkWidget *scrolledwin;
+	static GdkGeometry geometry;
 
 	window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "uri_opener");
 	gtk_window_set_title (GTK_WINDOW(window),
@@ -183,6 +191,8 @@ static void uri_opener_create(void)
 	gtk_window_set_resizable(GTK_WINDOW (window), TRUE);
 	g_signal_connect(G_OBJECT(window), "delete_event",
 			 G_CALLBACK(uri_opener_close_cb), NULL);
+	g_signal_connect (G_OBJECT(window), "size_allocate",
+			 G_CALLBACK (uri_opener_size_allocate_cb), NULL);
 	g_signal_connect(G_OBJECT(window), "key_press_event",
 			 G_CALLBACK(key_pressed), NULL);
 	MANAGE_WINDOW_SIGNALS_CONNECT (window);
@@ -225,6 +235,16 @@ static void uri_opener_create(void)
 	gtk_widget_show_all(vbox1);
 	gtk_container_add(GTK_CONTAINER (window), vbox1);
 
+	if (!geometry.min_height) {
+		geometry.min_width = 450;
+		geometry.min_height = 300;
+	}
+
+	gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+				      GDK_HINT_MIN_SIZE);
+	gtk_widget_set_size_request(window, prefs_common.uriopenerwin_width,
+				    prefs_common.uriopenerwin_height);
+
 	opener.window = window;
 	opener.hbox_scroll = hbox_scroll;
 	opener.hbox1 = hbox1;

commit 989513b647107ac08e4d72a00eb5ccc0a6143ef8
Author: Paul <paul at claws-mail.org>
Date:   Sat Dec 22 10:24:59 2018 +0000

    for release 3.17.3

diff --git a/NEWS b/NEWS
index b666d39..d6bf35d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,31 @@
 Changes of the  Claws Mail GTK2 branch
 
+* 3.17.3
+--------
+
+* Add support for TLS Server Name Indication (SNI). This enables the
+  sending of your hostname, if available, to the server so that it
+  can select the appropriate certificate for your domain. This is
+  useful for servers which host multiple domains on the same IP
+  address.
+  This is a hidden Account preference, 'use_tls_sni', and is enabled
+  by default.
+
+* SSL/TLS certificate manager: The Delete key will now delete the
+  selected certificate.
+
+* Window sizes are now remembered for the 'Apply tags' and SSL/TLS
+  certificate manager windows.
+
+* bug fixes:
+	o bug 3519, 'Links including umlauts are broken'
+	o bug 4134, ''Save message to' option not set when it should
+		     be'
+	o prevent the Tools/SSL/TLS Certificates dialogue from
+	  crashing when certificate filenames contain a fingerprint.
+	o build on GNU Hurd.
+	o various build fixes when building without GnuTLS.
+
 * 3.17.2
 --------
 
@@ -15,7 +41,7 @@ Changes of the  Claws Mail GTK2 branch
   The Message List page contains the new 'Lock column headers'
   option. The Defaults page contains several new options for new
   folders.
-
+  
 * New Folder Properties: It is now possible to control signing and
   encrypting options on the Compose page. By default it follows the
   Account preferences, but they can be overridden to always sign
diff --git a/README b/README
index 7fee5f1..667e856 100644
--- a/README
+++ b/README
@@ -587,6 +587,7 @@ https://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
 
 GTK 2 Version
 -------------
+2018-12-22	3.17.3
 2018-12-14	3.17.2
 2018-08-26	3.17.1
 2018-08-15	3.17.0
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 598101f..91df7c3 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -1,4 +1,4 @@
-14th December 2018                                  Claws Mail 3.17.2
+22nd December 2018                                  Claws Mail 3.17.3
 
 		    CLAWS MAIL  RELEASE NOTES
                     http://www.claws-mail.org
@@ -9,101 +9,28 @@ email client.
 New in this release:
 ~~~~~~~~~~~~~~~~~~~~
 
-* Message List: A context menu has been added to the column headers,
-  it has two entries: a new option, 'Lock column headers', and 'Set
-  displayed colums'.
+* Add support for TLS Server Name Indication (SNI). This enables the
+  sending of your hostname, if available, to the server so that it
+  can select the appropriate certificate for your domain. This is
+  useful for servers which host multiple domains on the same IP
+  address.
+  This is a hidden Account preference, 'use_tls_sni', and is enabled
+  by default.
 
-* Folder List:  A context menu has been added to the column headers,
-  containing 'Set displayed columns'.
+* SSL/TLS certificate manager: The Delete key will now delete the
+  selected certificate.
 
-* Preferences: The Display/Summaries option page has been split into
-  three notebook pages: Folder List, Message List, and Defaults.
-  The Message List page contains the new 'Lock column headers'
-  option. The Defaults page contains several new options for new
-  folders.
-
-* New Folder Properties: It is now possible to control signing and
-  encrypting options on the Compose page. By default it follows the
-  Account preferences, but they can be overridden to always sign
-  and/or encrypt, or never sign/encrypt.
-
-* Saving sent messages: The global preference, 'Save sent messages',
-  can now be overriden by the Folder Property and Account
-  preferences. The global preference no longer needs to be activated
-  for the Account Preference, 'Put sent messages in ...' option to
-  function. Likewise, the Folder Property, 'Save copy of outgoing
-  messages to this folder instead of Sent', no longer relies on the
-  global preference being set.
-
-* SSL/TLS certificates: The SHA-256 fingerprint is now displayed, and
-  the MD5 fingerprint has been removed.
-
-* SSL/TLS certificates list: Status and Expiry columns have been
-  added, and expired and invalid certificates are now clearly
-  indicated.
-
-* QuickSearch: body searches are now quicker.
-
-* QuickSearch: symbols used in Extended searches are now expanded
-  in the 'Edit' dialogue.
-
-* Re-editing: Flags and tags are now preserved when re-editing a
-  message.
-
-* Fancy plugin: The minimum required webkitgtk version is now 1.10.0.
-
-* PDF Viewer plugin: Ctrl+scroll now zooms.
-
-* Tools: added cm-break.pl script, which breaks thread references for
-  the selected messages; textviewer.pl has been updated and now
-  requires perl 5.14.1.
-
-* The legacy "sylpheed-claws" symlink is no longer installed in the
-  bindir.
-
-* New translation: Portuguese.
-
-* Updated translations: Brazilian Portuguese, Catalan, Czech, Danish,
-  Dutch, French, German, Russian, Slovak, Spanish, Swedish, Turkish.
+* Window sizes are now remembered for the 'Apply tags' and SSL/TLS
+  certificate manager windows.
 
 * bug fixes:
-	o bug 3418, 'Building on a Cross Compiling toolchain doesn't
-		     work'
-	o bug 3889, 'Address and quoted message inconsistent in
-		     reply'
-	o bug 4114, 'autogen.sh: Fix argument quoting'
-	o bug 4115, 'autogen: avoid unwarranted re-configure'
-	o bug 4120, 'New cert files are created in $HOME instead of
-		     in ~/.claws-mail/certs'
-	o byg 4121, 'Moving a subfolder in another folder erases its
-		     processing rules' (sic)
-	o bug 4132, '"Mark all as (un)read" dialog appears when
-		     acting on 1 message only'
-	o bug 4133, 'trying to read message from an NNTP group (with
-		     all expired articles.'
-	o regression where mail was not being checked at startup when
-	  it should have been
-	o links not being opened in browser when Fancy menu is opened
-	  with a keyboard
-	o show correct address:port in SOCKS5 proxy connection failure
-	  message
-	o prevent unexpected loss of drafted message
-	o Quicksearch eating keypresses it didn't handle
-	o build on Debian 7
-	o build on FreeBSD, sys/wait.h is needed for WEXITSTATUS
-	  macro
-	o Reply from mainwindow menu and toolbar when mainwindow's
-	  messageview is hidden
-	o CID 1438531 Fix wrong test leading to dead code
-	o CID 1439871 and validate Unicode char strictly
-	o CID 1439996 and remove unnecessary comparison
-	o Fancy: left-click on links not opening in browser
-	o RSSyl: lost processing rules when renaming folder
-	o annoyance where your current reading is disturbed when a
-	  new msg is filtered into the current folder
-	o don't leave the user in limbo when privacy system is 'none'
-	  and auto signing/encrypting is set
-	o several memory leaks
+	o bug 3519, 'Links including umlauts are broken'
+	o bug 4134, ''Save message to' option not set when it should
+		     be'
+	o prevent the Tools/SSL/TLS Certificates dialogue from
+	  crashing when certificate filenames contain a fingerprint.
+	o build on GNU Hurd.
+	o various build fixes when building without GnuTLS.
 
 For further details of the numbered bugs and RFEs listed above
 see https://www.claws-mail.org/bug/[BUG NUMBER]

commit a214f4f11e57816f8d3b9ba1d863720ed095c112
Author: Ricardo Mones <ricardo at mones.org>
Date:   Fri Dec 21 18:52:23 2018 +0100

    Update list of TLDs for release

diff --git a/src/common/tlds.h b/src/common/tlds.h
index e1872ff..8c2f137 100644
--- a/src/common/tlds.h
+++ b/src/common/tlds.h
@@ -6,7 +6,7 @@
 #define __TLDS_H__
 
 static const gchar *toplvl_domains [] = {
-	/* Version 2018121300, Last Updated Thu Dec 13 07:07:01 2018 UTC */
+	/* Version 2018122100, Last Updated Fri Dec 21 07:07:02 2018 UTC */
 	"aaa",
 	"aarp",
 	"abarth",
@@ -1159,7 +1159,6 @@ static const gchar *toplvl_domains [] = {
 	"sony",
 	"soy",
 	"space",
-	"spiegel",
 	"sport",
 	"spot",
 	"spreadbetting",

commit 5858606037b9d08d87ca07ec909bc39d76452cde
Author: Ricardo Mones <ricardo at mones.org>
Date:   Fri Dec 21 18:44:28 2018 +0100

    Libravatar: fix API usage if built without GnuTLS
    
    Thanks Andrej for reporting!

diff --git a/src/plugins/libravatar/libravatar_federation.c b/src/plugins/libravatar/libravatar_federation.c
index c419a14..9f8266e 100644
--- a/src/plugins/libravatar/libravatar_federation.c
+++ b/src/plugins/libravatar/libravatar_federation.c
@@ -78,6 +78,7 @@ static void add_federated_url_for_domain(const gchar *url, const gchar *domain)
  */
 gchar *federated_url_for_address(const gchar *address)
 {
+#if defined USE_GNUTLS
 	gchar *domain = NULL, *last = NULL, *addr = NULL, *url = NULL;
 	gchar *host = NULL;
 	guint16 port = 0;
@@ -142,5 +143,9 @@ invalid_addr:
 
 	debug_print("invalid address for libravatar federated domain\n");
 	return NULL;
+#else
+	debug_print("federated domains disabled (built without GnuTLS support)\n");
+	return NULL;
+#endif
 }
 

commit c92be95a11655afa5990a822af2eb873f559e6a5
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Dec 21 10:48:12 2018 +0100

    Fix a mistake I made in commit fd6f84d6b.

diff --git a/src/etpan/etpan-ssl.c b/src/etpan/etpan-ssl.c
index f853789..2657ec3 100644
--- a/src/etpan/etpan-ssl.c
+++ b/src/etpan/etpan-ssl.c
@@ -178,7 +178,7 @@ void etpan_connect_ssl_context_cb(struct mailstream_ssl_context * ssl_context, v
 	 * to give the server a chance to select the correct certificate in the
 	 * virtual hosting case where multiple domain names are hosted on the
 	 * same IP address. */
-	if (session->use_tls_sni &&
+	if (account->use_tls_sni &&
 			!is_numeric_host_address(account->recv_server)) {
 		int r;
 

commit 8b90dc934a4aa20b0f008647254955f668590bad
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Dec 21 10:45:48 2018 +0100

    Fix a harmless compiler warning in imap_cmd_login().

diff --git a/src/imap.c b/src/imap.c
index 1ce9f39..264dd7d 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -4091,7 +4091,7 @@ static gint imap_cmd_login(IMAPSession *session,
 	gint ok;
 
 	if (!strcmp(type, "plaintext") && imap_has_capability(session, "LOGINDISABLED")) {
-		gint ok = MAILIMAP_ERROR_BAD_STATE;
+		ok = MAILIMAP_ERROR_BAD_STATE;
 		if (imap_has_capability(session, "STARTTLS")) {
 #ifdef USE_GNUTLS
 			log_warning(LOG_PROTOCOL, _("Server requires STARTTLS to log in.\n"));

commit 6d0b5371aaabc3e56b1561e2371e9d7d908df3b3
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Dec 21 10:44:34 2018 +0100

    Fix outdated uses of alertpanel() in code paths for --disable-gnutls.

diff --git a/src/imap.c b/src/imap.c
index 7124d83..1ce9f39 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -1154,9 +1154,8 @@ static IMAPSession *imap_session_new(Folder * folder,
 			  "Do you want to continue connecting to this "
 			  "server? The communication would not be "
 			  "secure."),
-			  GTK_STOCK_CANCEL, _("Con_tinue connecting"), 
-			  NULL, FALSE, NULL, ALERT_WARNING,
-			  G_ALERTDEFAULT) != G_ALERTALTERNATE)
+			  GTK_STOCK_CANCEL, _("Con_tinue connecting"), NULL,
+				ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING) != G_ALERTALTERNATE)
 			return NULL;
 	}
 	port = account->set_imapport ? account->imapport
diff --git a/src/inc.c b/src/inc.c
index 0711f92..5a0bdff 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -877,9 +877,8 @@ static IncState inc_pop3_session_do(IncSession *session)
 			  "Do you want to continue connecting to this "
 			  "server? The communication would not be "
 			  "secure."),
-			  GTK_STOCK_CANCEL, _("Con_tinue connecting"), 
-			  NULL, FALSE, NULL, ALERT_WARNING,
-			  G_ALERTDEFAULT) != G_ALERTALTERNATE)
+			  GTK_STOCK_CANCEL, _("Con_tinue connecting"), NULL,
+				ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING) != G_ALERTALTERNATE)
 			return INC_CANCEL;
 	}
 #endif
diff --git a/src/news.c b/src/news.c
index 126db15..1cfb6f8 100644
--- a/src/news.c
+++ b/src/news.c
@@ -406,9 +406,8 @@ static Session *news_session_new_for_folder(Folder *folder)
 			  "Do you want to continue connecting to this "
 			  "server? The communication would not be "
 			  "secure."),
-			  GTK_STOCK_CANCEL, _("Con_tinue connecting"), 
-			  NULL, FALSE, NULL, ALERT_WARNING,
-			  G_ALERTDEFAULT) != G_ALERTALTERNATE)
+			  GTK_STOCK_CANCEL, _("Con_tinue connecting"), NULL,
+				ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING) != G_ALERTALTERNATE)
 			return NULL;
 	}
 	port = ac->set_nntpport ? ac->nntpport : NNTP_PORT;
diff --git a/src/send_message.c b/src/send_message.c
index 820b097..61f5e55 100644
--- a/src/send_message.c
+++ b/src/send_message.c
@@ -290,9 +290,8 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
 				  "Do you want to continue connecting to this "
 				  "server? The communication would not be "
 				  "secure."),
-				  GTK_STOCK_CANCEL, _("Con_tinue connecting"),
-				  NULL, FALSE, NULL, ALERT_WARNING,
-				  G_ALERTDEFAULT) != G_ALERTALTERNATE) {
+				  GTK_STOCK_CANCEL, _("Con_tinue connecting"), NULL,
+					ALERTFOCUS_FIRST, FALSE, NULL, ALERT_WARNING) != G_ALERTALTERNATE) {
 				session_destroy(session);
 				return -1;
 			}

commit fd6f84d6b30d40bcf198cdb7ad3747b0ed27be48
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Dec 21 10:21:10 2018 +0100

    Add Server Name Indication support to TLS connections, if applicable.
    
    Adds a hidden pref "use_tls_sni".
    
    Patch by Alex Smith.
    Closes bug #4103: TLS SNI (Server Name Indication) support for IMAP, POP & SMTP

diff --git a/AUTHORS b/AUTHORS
index e6eb907..5c5d9f5 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -325,3 +325,4 @@ contributors (in addition to the above; based on Changelog)
 	Michael Schwendt
 	Eric S. Raymond
 	Avinash Sonawane
+	Alex Smith
diff --git a/src/common/session.c b/src/common/session.c
index 1342ef9..2dc0a0a 100644
--- a/src/common/session.c
+++ b/src/common/session.c
@@ -69,6 +69,7 @@ void session_init(Session *session, const void *prefs_account, gboolean is_smtp)
 	session->port = 0;
 #ifdef USE_GNUTLS
 	session->ssl_type = SSL_NONE;
+	session->use_tls_sni = TRUE;
 #endif
 	session->nonblocking = TRUE;
 	session->state = SESSION_READY;
@@ -194,6 +195,7 @@ static gint session_connect_cb(SockInfo *sock, gpointer data)
 
 #ifdef USE_GNUTLS
 	sock->gnutls_priority = session->gnutls_priority;
+	sock->use_tls_sni = session->use_tls_sni;
 
 	if (session->ssl_type == SSL_TUNNEL) {
 		sock_set_nonblocking_mode(sock, FALSE);
@@ -407,6 +409,7 @@ gint session_start_tls(Session *session)
 
 	session->sock->ssl_cert_auto_accept = session->ssl_cert_auto_accept;
 	session->sock->gnutls_priority = session->gnutls_priority;
+	session->sock->use_tls_sni = session->use_tls_sni;
 
 	if (nb_mode)
 		sock_set_nonblocking_mode(session->sock, FALSE);
diff --git a/src/common/session.h b/src/common/session.h
index 5cd518b..13a56c9 100644
--- a/src/common/session.h
+++ b/src/common/session.h
@@ -160,6 +160,7 @@ struct _Session
 #ifdef USE_GNUTLS
 	SSLType ssl_type;
 	gchar *gnutls_priority;
+	gboolean use_tls_sni;
 #endif
 };
 
diff --git a/src/common/socket.h b/src/common/socket.h
index 2c78066..005f5a0 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -84,6 +84,7 @@ struct _SockInfo
 	const void *account;
 	gboolean is_smtp;
 	gboolean ssl_cert_auto_accept;
+	gboolean use_tls_sni;
 };
 
 void refresh_resolvers			(void);
diff --git a/src/common/ssl.c b/src/common/ssl.c
index a143820..cc38c22 100644
--- a/src/common/ssl.c
+++ b/src/common/ssl.c
@@ -410,6 +410,20 @@ gboolean ssl_init_socket(SockInfo *sockinfo)
 
 	gnutls_record_disable_padding(session);
 
+	/* If we have a host name, rather than a numerical IP address, tell
+	 * gnutls to send it in the server name identification extension field,
+	 * to give the server a chance to select the correct certificate in the
+	 * virtual hosting case where multiple domain names are hosted on the
+	 * same IP address. */
+	if (sockinfo->use_tls_sni &&
+			sockinfo->hostname != NULL &&
+			!is_numeric_host_address(sockinfo->hostname)) {
+		r = gnutls_server_name_set(session, GNUTLS_NAME_DNS,
+				sockinfo->hostname, strlen(sockinfo->hostname));
+		debug_print("Set GnuTLS session server name indication to %s, status = %d\n",
+			    sockinfo->hostname, r);
+	}
+
 	gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
 
 	if (claws_ssl_get_cert_file()) {
diff --git a/src/common/utils.c b/src/common/utils.c
index a815c48..195193b 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -1908,6 +1908,29 @@ const gchar *get_domain_name(void)
 #endif
 }
 
+/* Tells whether the given host address string is a valid representation of a
+ * numerical IP (v4 or, if supported, v6) address.
+ */
+gboolean is_numeric_host_address(const gchar *hostaddress)
+{
+	struct addrinfo hints, *res;
+	int err;
+
+	/* See what getaddrinfo makes of the string when told that it is a
+	 * numeric IP address representation. */
+	memset(&hints, 0, sizeof(struct addrinfo));
+	hints.ai_family = AF_UNSPEC;
+	hints.ai_socktype = 0;
+	hints.ai_flags = AI_NUMERICHOST;
+	hints.ai_protocol = 0;
+
+	err = getaddrinfo(hostaddress, NULL, &hints, &res);
+	if (err == 0)
+		freeaddrinfo(res);
+
+	return (err == 0);
+}
+
 off_t get_file_size(const gchar *file)
 {
 #ifdef G_OS_WIN32
diff --git a/src/common/utils.h b/src/common/utils.h
index 64a639f..d51cc00 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -395,6 +395,7 @@ const gchar *get_tmp_dir		(void);
 const gchar *get_locale_dir		(void);
 gchar *get_tmp_file			(void);
 const gchar *get_domain_name		(void);
+gboolean is_numeric_host_address	(const gchar *hostaddress);
 const gchar *get_desktop_file(void);
 #ifdef G_OS_WIN32
 const gchar *w32_get_themes_dir    (void);
diff --git a/src/etpan/etpan-ssl.c b/src/etpan/etpan-ssl.c
index aeb5be9..f853789 100644
--- a/src/etpan/etpan-ssl.c
+++ b/src/etpan/etpan-ssl.c
@@ -171,6 +171,23 @@ void etpan_connect_ssl_context_cb(struct mailstream_ssl_context * ssl_context, v
 		gnutls_x509_crt_deinit(x509);
 		gnutls_x509_privkey_deinit(pkey);
 	}
+
+#if (defined LIBETPAN_API_CURRENT && LIBETPAN_API_CURRENT >= 23)
+	/* If we have a host name, rather than a numerical IP address, tell
+	 * gnutls to send it in the Server Name Identification extension field,
+	 * to give the server a chance to select the correct certificate in the
+	 * virtual hosting case where multiple domain names are hosted on the
+	 * same IP address. */
+	if (session->use_tls_sni &&
+			!is_numeric_host_address(account->recv_server)) {
+		int r;
+
+		r = mailstream_ssl_set_server_name(ssl_context, account->recv_server);
+		debug_print("Set libetpan SSL mail stream server name indication to %s, status = %d\n",
+			    account->recv_server, r);
+	}
+#endif /* LIBETPAN_API_CURRENT >= 23 */
+
 }
 
 #endif /* USE_GNUTLS */
diff --git a/src/gtk/authors.h b/src/gtk/authors.h
index 628f7d9..5765007 100644
--- a/src/gtk/authors.h
+++ b/src/gtk/authors.h
@@ -283,6 +283,7 @@ static char *CONTRIBS_LIST[] = {
 "shigeri",
 "Jesse Skinner",
 "Ville Skyttä",
+"Alex Smith",
 "Dale P. Smith",
 "Avinash Sonawane",
 "Andrea Spadaccini",
diff --git a/src/imap.c b/src/imap.c
index 9b78b79..7124d83 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -1277,7 +1277,9 @@ static IMAPSession *imap_session_new(Folder * folder,
 		session->uidplus = FALSE;
 		session->cmd_count = 1;
 	}
+	SESSION(session)->use_tls_sni = account->use_tls_sni;
 #endif
+
 	log_message(LOG_PROTOCOL, "IMAP connection is %s-authenticated\n",
 		    (session->authenticated) ? "pre" : "un");
 	
diff --git a/src/news.c b/src/news.c
index 634a050..126db15 100644
--- a/src/news.c
+++ b/src/news.c
@@ -361,6 +361,7 @@ static Session *news_session_new(Folder *folder, const PrefsAccount *account, gu
 	nntp_init(folder);
 
 #ifdef USE_GNUTLS
+	SESSION(session)->use_tls_sni = account->use_tls_sni;
 	if (ssl_type != SSL_NONE)
 		r = nntp_threaded_connect_ssl(folder, server, port, proxy_info);
 	else
diff --git a/src/plugins/managesieve/managesieve.c b/src/plugins/managesieve/managesieve.c
index 74b08d3..d4d40e8 100644
--- a/src/plugins/managesieve/managesieve.c
+++ b/src/plugins/managesieve/managesieve.c
@@ -1058,6 +1058,7 @@ static void sieve_session_reset(SieveSession *session)
 	session->state = SIEVE_CAPABILITIES;
 #ifdef USE_GNUTLS
 	session->tls_init_done = FALSE;
+	SESSION(session)->use_tls_sni = account->use_tls_sni;
 #endif
 	session->avail_auth_type = 0;
 	session->auth_type = 0;
diff --git a/src/pop.c b/src/pop.c
index 6de10c6..2b8c70a 100644
--- a/src/pop.c
+++ b/src/pop.c
@@ -538,6 +538,7 @@ Session *pop3_session_new(PrefsAccount *account)
 	if (account->set_gnutls_priority && account->gnutls_priority &&
 			strlen(account->gnutls_priority) != 0)
 		SESSION(session)->gnutls_priority = g_strdup(account->gnutls_priority);
+	SESSION(session)->use_tls_sni = account->use_tls_sni;
 #endif
 
 	session->state = POP3_READY;
diff --git a/src/prefs_account.c b/src/prefs_account.c
index dc17252..84b0978 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -787,6 +787,9 @@ static PrefParam ssl_param[] = {
 	 &ssl_page.use_nonblocking_ssl_checkbtn,
 	 prefs_set_data_from_toggle, prefs_set_toggle},
 
+	{"use_tls_sni", "1", &tmp_ac_prefs.use_tls_sni, P_BOOL,
+	 NULL, NULL, NULL},
+
 	{"in_ssl_client_cert_file", "", &tmp_ac_prefs.in_ssl_client_cert_file, P_STRING,
 	 &ssl_page.entry_in_cert_file, prefs_set_data_from_entry, prefs_set_entry},
 
diff --git a/src/prefs_account.h b/src/prefs_account.h
index 6c956cf..4c53fea 100644
--- a/src/prefs_account.h
+++ b/src/prefs_account.h
@@ -86,6 +86,7 @@ struct _PrefsAccount
 
 	gboolean ssl_certs_auto_accept;
 	gboolean use_nonblocking_ssl;
+	gboolean use_tls_sni;
 
 	/* Receive */
 	gboolean use_apop_auth;
diff --git a/src/send_message.c b/src/send_message.c
index ce8b125..820b097 100644
--- a/src/send_message.c
+++ b/src/send_message.c
@@ -280,6 +280,7 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
 		if (ac_prefs->set_gnutls_priority && ac_prefs->gnutls_priority &&
 		    strlen(ac_prefs->gnutls_priority))
 			session->gnutls_priority = g_strdup(ac_prefs->gnutls_priority);
+		session->use_tls_sni = ac_prefs->use_tls_sni;
 #else
 		if (ac_prefs->ssl_smtp != SSL_NONE) {
 			if (alertpanel_full(_("Insecure connection"),

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list