sync with 0.9.3cvs12
authorPaul Mangan <paul@claws-mail.org>
Wed, 16 Jul 2003 11:53:42 +0000 (11:53 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 16 Jul 2003 11:53:42 +0000 (11:53 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/common/session.c
src/common/session.h
src/compose.c
src/inc.c
src/prefs_account.c
src/prefs_account.h
src/send_message.c

index 8258a64..4966f84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,85 @@
+2003-07-15
+
+       * src/inc.c
+         src/prefs_account.[ch]
+         src/send_message.c
+         src/session.[ch]: added an option to enable/disable non-blocking
+         SSL.
+
+2003-07-15
+
+       * src/compose.c: compose_attach_append(): display message's subject
+         when attaching message/rfc822 file.
+
+2003-07-14
+
+       * src/session.[ch]:
+         session_recv_msg()
+         session_recv_data()
+         session_read_msg_cb()
+         session_read_data_cb(): optimized by removing sock_peek() and
+         buffering received data in user space (correctly implemented
+         this time).
+
+2003-07-11
+
+       * src/session.c: reverted the previous change because it couldn't
+         handle data receiving after messages correctly.
+
+2003-07-11
+
+       * src/session.c:
+         session_recv_msg()
+         session_read_msg_cb(): optimized by removing sock_peek() and
+         buffering messages in user space.
+
+2003-07-11
+
+       * src/imap.[ch]: refactored.
+         Changed all functions that have SockInfo arguments to take
+         IMAPSession.
+         Made imap_cmd_count an instance variable: IMAPSession::cmd_count.
+         imap_open(): only establish TCP (or SSL) connection.
+         imap_session_new(): process greeting and authentication here.
+
+2003-07-10
+
+       * src/imap.[ch]: implemented CRAM-MD5 authentication, and made code
+         cleanups.
+       * src/prefs_account.[ch]: added option menu for IMAP4 authentication
+         type in Receive tab, and hide other protocols' frames.
+
+2003-07-10
+
+       * src/mainwindow.c: send_queue_cb(): don't scan folder twice if
+         error occurred.
+       * src/procmsg.c: procmsg_send_queue(): return number of sent
+         messages.
+
+2003-07-09
+
+       * src/mainwindow.c:
+         main_window_set_toolbar_sensitive()
+         main_window_set_menu_sensitive(): removed the locking of file
+         operations while receiving mail.
+
+2003-07-09
+
+       * src/folder.[ch]: folder_item_remove_msg(): take MsgInfo as an
+         argument instead of message number.
+       * src/imap.[ch]: imap_remove_msg(): reimplemented using
+         imap_remove_msgs().
+       * src/mh.[ch]: mh_do_move(): reimplemented using
+         mh_do_move_msgs_with_dest().
+         mh_copy_msg(): reimplemented using mh_copy_msgs_with_dest().
+       * src/procmsg.c: procmsg_send_queue(): modified to use message list.
+
 2003-07-08
 
        * src/rfc2015.c: rfc2015_is_encrypted(): check MimeInfo::mime_type
          to suppress some warnings.
+       * src/logwindow.c: log_window_append(): don't scroll up when trimming
+         lines.
 
 2003-07-07
 
index e0a4f21..1f73e08 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-16 [paul]      0.9.3claws11
+
+       * sync with 0.9.3cvs12
+               see ChangeLog 2003-07-14 and 2003-07-15
+
 2003-07-16 [christoph] 0.9.3claws10
 
        * src/imap.[ch]
index 728a492..3034b4f 100644 (file)
@@ -1,7 +1,83 @@
+2003-07-15
+
+       * src/inc.c
+         src/prefs_account.[ch]
+         src/send_message.c
+         src/session.[ch]: Èó¥Ö¥í¥Ã¥­¥ó¥° SSL ¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¥ª¥×¥·¥ç¥ó¤ò
+         Äɲá£
+
+2003-07-15
+
+       * src/compose.c: compose_attach_append(): message/rfc822 ¥Õ¥¡¥¤¥ë¤ò
+         ÅºÉÕ¤¹¤ë¤È¤­¤Ë¥á¥Ã¥»¡¼¥¸¤Î·ï̾¤òɽ¼¨¡£
+
+2003-07-14
+
+       * src/session.[ch]:
+         session_recv_msg()
+         session_recv_data()
+         session_read_msg_cb()
+         session_read_data_cb(): sock_peek() ¤òºï½ü¤·¡¢¥æ¡¼¥¶¶õ´Ö¤Ç¥á¥Ã¥»¡¼¥¸
+         ¤ò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤·¤ÆºÇŬ²½(º£²ó¤ÏÀµ¤·¤¯¼ÂÁõ)¡£
+
+2003-07-11
+
+       * src/session.c: ¥á¥Ã¥»¡¼¥¸¤Î¸å¤Î¥Ç¡¼¥¿¼õ¿®¤òÀµ¤·¤¯°·¤¨¤Ê¤«¤Ã¤¿¤¿¤á¡¢
+         Á°¤ÎÊѹ¹¤ò¸µ¤ËÌᤷ¤¿¡£
+
+2003-07-11
+
+       * src/session.c
+         session_recv_msg()
+         session_read_msg_cb(): sock_peek() ¤òºï½ü¤·¡¢¥æ¡¼¥¶¶õ´Ö¤Ç¥á¥Ã¥»¡¼¥¸
+         ¤ò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤·¤ÆºÇŬ²½¡£
+
+2003-07-11
+
+       * src/imap.[ch]: ¥ê¥Õ¥¡¥¯¥¿¥ê¥ó¥°¡£
+         SockInfo ¤ò°ú¿ô¤Ë¤â¤ÄÁ´¤Æ¤Î´Ø¿ô¤ò IMAPSession ¤ò¤È¤ë¤è¤¦¤ËÊѹ¹¡£
+         imap_cmd_count ¤ò¥¤¥ó¥¹¥¿¥ó¥¹ÊÑ¿ô: IMAPSession::cmd_count ¤Ë¤·¤¿¡£
+         imap_open(): TCP (¤Þ¤¿¤Ï SSL)¥³¥Í¥¯¥·¥ç¥ó¤Î¤ß¤ò³ÎΩ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         imap_session_new(): ¥°¥ê¡¼¥Æ¥£¥ó¥°¤Èǧ¾Ú¤ò¤³¤³¤Ç½èÍý¡£
+
+2003-07-10
+
+       * src/imap.[ch]: CRAM-MD5 Ç§¾Ú¤ò¼ÂÁõ¤·¡¢¥³¡¼¥É¤òÀ°Íý¡£
+       * src/prefs_account.[ch]: ¼õ¿®¥¿¥Ö¤Ë IMAP4 Ç§¾ÚÊý¼°¤Î¥ª¥×¥·¥ç¥ó
+         ¥á¥Ë¥å¡¼¤òÄɲä·¡¢Â¾¤Î¥×¥í¥È¥³¥ë¤Î¥Õ¥ì¡¼¥à¤ò±£¤¹¤è¤¦¤Ë¤·¤¿¡£
+
+2003-07-10
+
+       * src/mainwindow.c: send_queue_cb(): ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Ï¥Õ¥©¥ë¥À
+         ¤ò2½Å¤Ë¥¹¥­¥ã¥ó¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+       * src/procmsg.c: procmsg_send_queue(): Á÷¿®¤·¤¿¥á¥Ã¥»¡¼¥¸¿ô¤òÊÖ¤¹
+         ¤è¤¦¤Ë¤·¤¿¡£
+
+2003-07-09
+
+       * src/mainwindow.c:
+         main_window_set_toolbar_sensitive()
+         main_window_set_menu_sensitive(): ¥á¡¼¥ë¼õ¿®Ãæ¤Î¥Õ¥¡¥¤¥ëÁàºî¤Î
+         ¥í¥Ã¥¯¤ò½üµî¡£
+
+2003-07-09
+
+       * src/folder.[ch]: folder_item_remove_msg(): ¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤ÎÂå¤ï¤ê¤Ë
+         MsgInfo ¤ò°ú¿ô¤Ë¤È¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/imap.[ch]: imap_remove_msg(): imap_remove_msgs() ¤ò»ÈÍѤ·¤Æ
+         ºÆ¼ÂÁõ¡£
+       * src/mh.[ch]: mh_do_move(): mh_do_move_msgs_with_dest() ¤ò»ÈÍѤ·¤Æ
+         ºÆ¼ÂÁõ¡£
+         mh_copy_msg(): mh_copy_msgs_with_dest() ¤ò»ÈÍѤ·¤ÆºÆ¼ÂÁõ¡£
+       * src/procmsg.c: procmsg_send_queue(): ¥á¥Ã¥»¡¼¥¸¥ê¥¹¥È¤ò»ÈÍѤ¹¤ë
+         ¤è¤¦¤Ë½¤Àµ¡£
+
 2003-07-08
 
        * src/rfc2015.c: rfc2015_is_encrypted(): ·Ù¹ð¤òÍÞ¤¨¤ë¤¿¤á¤Ë
          MimeInfo::mime_type ¤ò¥Á¥§¥Ã¥¯¡£
+       * src/logwindow.c: log_window_append(): ¹Ô¤òºï½ü¤¹¤ë¤È¤­¤Ë¾å¤Ë
+         ¥¹¥¯¥í¡¼¥ë¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
 
 2003-07-07
 
index d58db4f..debe470 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws10
+EXTRA_VERSION=claws11
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 25618c1..6a29292 100644 (file)
@@ -42,6 +42,9 @@ static gint session_connect_cb                (SockInfo       *sock,
                                         gpointer        data);
 static gint session_close              (Session        *session);
 
+static gboolean session_recv_msg_idle_cb       (gpointer        data);
+static gboolean session_recv_data_idle_cb      (gpointer        data);
+
 static gboolean session_read_msg_cb    (SockInfo       *source,
                                         GIOCondition    condition,
                                         gpointer        data);
@@ -65,6 +68,7 @@ void session_init(Session *session)
 #if USE_OPENSSL
        session->ssl_type = SSL_NONE;
 #endif
+       session->nonblocking = TRUE;
        session->state = SESSION_READY;
        session->last_access_time = time(NULL);
 
@@ -74,8 +78,12 @@ void session_init(Session *session)
 
        session->io_tag = 0;
 
-       session->read_buf = g_string_sized_new(1024);
+       session->read_buf_p = session->read_buf;
+       session->read_buf_len = 0;
+
+       session->read_msg_buf = g_string_sized_new(1024);
        session->read_data_buf = g_byte_array_new();
+
        session->write_buf = NULL;
        session->write_buf_p = NULL;
        session->write_buf_len = 0;
@@ -126,16 +134,18 @@ static gint session_connect_cb(SockInfo *sock, gpointer data)
 
        session->sock = sock;
 
-#if USE_OPENSSL
-       sock_set_nonblocking_mode(sock, FALSE);
-       if (session->ssl_type == SSL_TUNNEL && !ssl_init_socket(sock)) {
-               g_warning("can't initialize SSL.");
-               session->state = SESSION_ERROR;
-               return -1;
+#if USE_SSL
+       if (session->ssl_type == SSL_TUNNEL) {
+               sock_set_nonblocking_mode(sock, FALSE);
+               if (!ssl_init_socket(sock)) {
+                       g_warning("can't initialize SSL.");
+                       session->state = SESSION_ERROR;
+                       return -1;
+               }
        }
 #endif
 
-       sock_set_nonblocking_mode(sock, TRUE);
+       sock_set_nonblocking_mode(sock, session->nonblocking);
 
        debug_print("session: connected\n");
 
@@ -175,7 +185,7 @@ void session_destroy(Session *session)
        session_close(session);
        session->destroy(session);
        g_free(session->server);
-       g_string_free(session->read_buf, TRUE);
+       g_string_free(session->read_msg_buf, TRUE);
        g_byte_array_free(session->read_data_buf, TRUE);
        g_free(session->read_data_terminator);
        g_free(session->write_buf);
@@ -271,7 +281,7 @@ gint session_start_tls(Session *session)
        }
 
        if (nb_mode)
-               sock_set_nonblocking_mode(session->sock, TRUE);
+               sock_set_nonblocking_mode(session->sock, session->nonblocking);
 
        return 0;
 }
@@ -303,16 +313,33 @@ gint session_send_msg(Session *session, SessionMsgType type, const gchar *msg)
 
 gint session_recv_msg(Session *session)
 {
-       g_return_val_if_fail(session->read_buf->len == 0, -1);
+       g_return_val_if_fail(session->read_msg_buf->len == 0, -1);
 
        session->state = SESSION_RECV;
 
-       session->io_tag = sock_add_watch(session->sock, G_IO_IN,
-                                        session_read_msg_cb, session);
+       if (session->read_buf_len > 0)
+               g_idle_add(session_recv_msg_idle_cb, session);
+       else
+               session->io_tag = sock_add_watch(session->sock, G_IO_IN,
+                                                session_read_msg_cb, session);
 
        return 0;
 }
 
+static gboolean session_recv_msg_idle_cb(gpointer data)
+{
+       Session *session = SESSION(data);
+       gboolean ret;
+
+       ret = session_read_msg_cb(session->sock, G_IO_IN, session);
+
+       if (ret == TRUE)
+               session->io_tag = sock_add_watch(session->sock, G_IO_IN,
+                                                session_read_msg_cb, session);
+
+       return FALSE;
+}
+
 /*!
  *\brief       parent (child?): send data to other process
  *
@@ -361,72 +388,95 @@ gint session_recv_data(Session *session, guint size, const gchar *terminator)
        session->read_data_terminator = g_strdup(terminator);
        gettimeofday(&session->tv_prev, NULL);
 
-       session->io_tag = sock_add_watch(session->sock, G_IO_IN,
-                                        session_read_data_cb, session);
+       if (session->read_buf_len > 0)
+               g_idle_add(session_recv_data_idle_cb, session);
+       else
+               session->io_tag = sock_add_watch(session->sock, G_IO_IN,
+                                                session_read_data_cb, session);
 
        return 0;
 }
 
+static gboolean session_recv_data_idle_cb(gpointer data)
+{
+       Session *session = SESSION(data);
+       gboolean ret;
+
+       ret = session_read_data_cb(session->sock, G_IO_IN, session);
+
+       if (ret == TRUE)
+               session->io_tag = sock_add_watch(session->sock, G_IO_IN,
+                                                session_read_data_cb, session);
+
+       return FALSE;
+}
+
 static gboolean session_read_msg_cb(SockInfo *source, GIOCondition condition,
                                    gpointer data)
 {
        Session *session = SESSION(data);
        gchar buf[SESSION_BUFFSIZE];
-       gint read_len;
-       gint to_read_len;
+       gint line_len;
        gchar *newline;
        gchar *msg;
        gint ret;
 
        g_return_val_if_fail(condition == G_IO_IN, FALSE);
 
-       read_len = sock_peek(session->sock, buf, sizeof(buf) - 1);
-
-       if (read_len < 0) {
-               switch (errno) {
-               case EAGAIN:
-                       return TRUE;
-               default:
-                       g_warning("sock_peek: %s\n", g_strerror(errno));
-                       session->state = SESSION_ERROR;
-                       return FALSE;
+       if (session->read_buf_len == 0) {
+               gint read_len;
+
+               read_len = sock_read(session->sock, session->read_buf,
+                                    SESSION_BUFFSIZE - 1);
+
+               if (read_len < 0) {
+                       switch (errno) {
+                       case EAGAIN:
+                               return TRUE;
+                       default:
+                               g_warning("sock_read: %s\n", g_strerror(errno));
+                               session->state = SESSION_ERROR;
+                               return FALSE;
+                       }
                }
+
+               session->read_buf_len = read_len;
        }
 
-       if ((newline = memchr(buf, '\n', read_len)) != NULL)
-               to_read_len = newline - buf + 1;
+       if ((newline = memchr(session->read_buf_p, '\n', session->read_buf_len))
+               != NULL)
+               line_len = newline - session->read_buf_p + 1;
        else
-               to_read_len = read_len;
+               line_len = session->read_buf_len;
 
-       read_len = sock_read(session->sock, buf, to_read_len);
+       if (line_len == 0)
+               return TRUE;
 
-       /* this should always succeed */
-       if (read_len < 0) {
-               g_warning("sock_read: %s\n", g_strerror(errno));
-               session->state = SESSION_ERROR;
-               return FALSE;
-       }
+       memcpy(buf, session->read_buf_p, line_len);
+       buf[line_len] = '\0';
+
+       g_string_append(session->read_msg_buf, buf);
 
-       buf[read_len] = '\0';
+       session->read_buf_len -= line_len;
+       if (session->read_buf_len == 0)
+               session->read_buf_p = session->read_buf;
+       else
+               session->read_buf_p += line_len;
 
        /* incomplete read */
-       if (read_len == 0 || buf[read_len - 1] != '\n') {
-               g_string_append(session->read_buf, buf);
+       if (buf[line_len - 1] != '\n')
                return TRUE;
-       }
 
        /* complete */
-       strretchomp(buf);
-       g_string_append(session->read_buf, buf);
-
        if (session->io_tag > 0) {
                g_source_remove(session->io_tag);
                session->io_tag = 0;
        }
 
        /* callback */
-       msg = g_strdup(session->read_buf->str);
-       g_string_truncate(session->read_buf, 0);
+       msg = g_strdup(session->read_msg_buf->str);
+       strretchomp(msg);
+       g_string_truncate(session->read_msg_buf, 0);
 
        ret = session->recv_msg(session, msg);
        session->recv_msg_notify(session, msg, session->recv_msg_notify_data);
@@ -443,9 +493,7 @@ static gboolean session_read_data_cb(SockInfo *source, GIOCondition condition,
                                     gpointer data)
 {
        Session *session = SESSION(data);
-       gchar buf[SESSION_BUFFSIZE];
        GByteArray *data_buf;
-       gint read_len;
        gint terminator_len;
        gboolean complete = FALSE;
        guint data_len;
@@ -453,26 +501,40 @@ static gboolean session_read_data_cb(SockInfo *source, GIOCondition condition,
 
        g_return_val_if_fail(condition == G_IO_IN, FALSE);
 
-       read_len = sock_read(session->sock, buf, sizeof(buf));
-
-       if (read_len < 0) {
-               switch (errno) {
-               case EAGAIN:
-                       return TRUE;
-               default:
-                       g_warning("sock_read: %s\n", g_strerror(errno));
-                       session->state = SESSION_ERROR;
-                       return FALSE;
+       if (session->read_buf_len == 0) {
+               gint read_len;
+
+               read_len = sock_read(session->sock, session->read_buf,
+                                    SESSION_BUFFSIZE);
+
+               if (read_len < 0) {
+                       switch (errno) {
+                       case EAGAIN:
+                               return TRUE;
+                       default:
+                               g_warning("sock_read: %s\n", g_strerror(errno));
+                               session->state = SESSION_ERROR;
+                               return FALSE;
+                       }
                }
+
+               session->read_buf_len = read_len;
        }
 
        data_buf = session->read_data_buf;
-
-       g_byte_array_append(data_buf, buf, read_len);
        terminator_len = strlen(session->read_data_terminator);
 
+       if (session->read_buf_len == 0)
+               return TRUE;
+
+       g_byte_array_append(data_buf, session->read_buf_p,
+                           session->read_buf_len);
+
+       session->read_buf_len = 0;
+       session->read_buf_p = session->read_buf;
+
        /* check if data is terminated */
-       if (read_len > 0 && data_buf->len >= terminator_len) {
+       if (data_buf->len >= terminator_len) {
                if (memcmp(data_buf->data, session->read_data_terminator,
                           terminator_len) == 0)
                        complete = TRUE;
index d28bc8d..69a34a7 100644 (file)
@@ -95,6 +95,8 @@ struct _Session
        SSLType ssl_type;
 #endif
 
+       gboolean nonblocking;
+
        SessionState state;
 
        time_t last_access_time;
@@ -104,7 +106,11 @@ struct _Session
 
        gint io_tag;
 
-       GString *read_buf;
+       gchar read_buf[SESSION_BUFFSIZE];
+       gchar *read_buf_p;
+       gint read_buf_len;
+
+       GString *read_msg_buf;
        GByteArray *read_data_buf;
        gchar *read_data_terminator;
 
index 969d75a..4d8c21a 100644 (file)
@@ -2060,13 +2060,24 @@ static void compose_attach_append(Compose *compose, const gchar *file,
        if (content_type) {
                ainfo->content_type = g_strdup(content_type);
                if (!strcasecmp(content_type, "message/rfc822")) {
+                       MsgInfo *msginfo;
+                       MsgFlags flags = {0, 0};
+                       gchar *name;
+
                        if (procmime_get_encoding_for_file(file) == ENC_7BIT)
                                ainfo->encoding = ENC_7BIT;
                        else
                                ainfo->encoding = ENC_8BIT;
-                       ainfo->name = g_strdup_printf
-                               (_("Message: %s"),
-                                g_basename(filename ? filename : file));
+
+                       msginfo = procheader_parse_file(file, flags, FALSE, FALSE);
+                       if (msginfo && msginfo->subject)
+                               name = msginfo->subject;
+                       else
+                               name = g_basename(filename ? filename : file);
+
+                       ainfo->name = g_strdup_printf(_("Message: %s"), name);
+
+                       procmsg_msginfo_free(msginfo);
                } else {
                        if (!g_strncasecmp(content_type, "text", 4))
                                ainfo->encoding =
index ad2abaa..47ab46c 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -725,6 +725,9 @@ static IncState inc_pop3_session_do(IncSession *session)
                pop3_session->ac_prefs->popport :
                pop3_session->ac_prefs->ssl_pop == SSL_TUNNEL ? 995 : 110;
        SESSION(pop3_session)->ssl_type = pop3_session->ac_prefs->ssl_pop;
+       if (pop3_session->ac_prefs->ssl_pop != SSL_NONE)
+               SESSION(pop3_session)->nonblocking =
+                       pop3_session->ac_prefs->use_nonblocking_ssl;
 #else
        port = pop3_session->ac_prefs->set_popport ?
                pop3_session->ac_prefs->popport : 110;
index 556c609..228857c 100644 (file)
@@ -167,6 +167,8 @@ static struct SSLPrefs {
        GtkWidget *smtp_nossl_radiobtn;
        GtkWidget *smtp_ssltunnel_radiobtn;
        GtkWidget *smtp_starttls_radiobtn;
+
+       GtkWidget *use_nonblocking_ssl_chkbtn;
 } ssl;
 #endif /* USE_OPENSSL */
 
@@ -438,6 +440,10 @@ static PrefParam param[] = {
         &ssl.smtp_nossl_radiobtn,
         prefs_account_enum_set_data_from_radiobtn,
         prefs_account_enum_set_radiobtn},
+
+       {"use_nonblocking_ssl", "1", &tmp_ac_prefs.use_nonblocking_ssl, P_BOOL,
+        &ssl.use_nonblocking_ssl_chkbtn,
+        prefs_set_data_from_toggle, prefs_set_toggle},
 #endif /* USE_OPENSSL */
 
        /* Advanced */
@@ -1828,6 +1834,12 @@ static void prefs_account_ssl_create(void)
        GtkWidget *smtp_ssltunnel_radiobtn;
        GtkWidget *smtp_starttls_radiobtn;
 
+       GtkWidget *vbox6;
+       GtkWidget *use_nonblocking_ssl_chkbtn;
+       GtkWidget *hbox;
+       GtkWidget *hbox_spc;
+       GtkWidget *label;
+
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -1901,6 +1913,27 @@ static void prefs_account_ssl_create(void)
                             _("Use STARTTLS command to start SSL session"),
                             SSL_STARTTLS);
 
+       vbox6 = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox6);
+       gtk_box_pack_start (GTK_BOX (vbox1), vbox6, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON(vbox6, use_nonblocking_ssl_chkbtn,
+                         _("Use non-blocking SSL"));
+
+       hbox = gtk_hbox_new (FALSE, 0);
+       gtk_widget_show (hbox);
+       gtk_box_pack_start (GTK_BOX (vbox6), hbox, FALSE, FALSE, 0);
+
+       hbox_spc = gtk_hbox_new (FALSE, 0);
+       gtk_widget_show (hbox_spc);
+       gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
+       gtk_widget_set_usize (hbox_spc, 16, -1);
+
+       label = gtk_label_new
+               (_("(Turn this off if you have problems in SSL connection)"));
+       gtk_widget_show (label);
+       gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
        ssl.pop_frame               = pop_frame;
        ssl.pop_nossl_radiobtn      = pop_nossl_radiobtn;
        ssl.pop_ssltunnel_radiobtn  = pop_ssltunnel_radiobtn;
@@ -1919,6 +1952,8 @@ static void prefs_account_ssl_create(void)
        ssl.smtp_nossl_radiobtn     = smtp_nossl_radiobtn;
        ssl.smtp_ssltunnel_radiobtn = smtp_ssltunnel_radiobtn;
        ssl.smtp_starttls_radiobtn  = smtp_starttls_radiobtn;
+
+       ssl.use_nonblocking_ssl_chkbtn = use_nonblocking_ssl_chkbtn;
 }
 
 #undef CREATE_RADIO_BUTTONS
index ddeb1be..d06d3b4 100644 (file)
@@ -92,6 +92,7 @@ struct _PrefsAccount
        SSLType ssl_imap;
        SSLType ssl_nntp;
        SSLType ssl_smtp;
+       gboolean use_nonblocking_ssl;
 #endif /* USE_OPENSSL */
 
        /* Temporarily preserved password */
index a0f7317..45db745 100644 (file)
@@ -365,6 +365,8 @@ gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp)
        port = ac_prefs->set_smtpport ? ac_prefs->smtpport :
                ac_prefs->ssl_smtp == SSL_TUNNEL ? SSMTP_PORT : SMTP_PORT;
        session->ssl_type = ac_prefs->ssl_smtp;
+       if (ac_prefs->ssl_smtp != SSL_NONE)
+               session->nonblocking = ac_prefs->use_nonblocking_ssl;
 #else
        port = ac_prefs->set_smtpport ? ac_prefs->smtpport : SMTP_PORT;
 #endif