2005-06-10 [colin] 1.9.11cvs57
authorColin Leroy <colin@colino.net>
Fri, 10 Jun 2005 19:23:40 +0000 (19:23 +0000)
committerColin Leroy <colin@colino.net>
Fri, 10 Jun 2005 19:23:40 +0000 (19:23 +0000)
* src/imap.c
o Fix a format string error
o init ssl socket outside of the thread
  (it possibly invokes gtk calls)
* src/procmime.c
o Put back the buffer to its necessary size
o Fix changing a file pointer without keeping
  track of it (thanks Valgrind)
* src/common/smtp.c
o Fix automatic STARTTLS if login should be done
  and the server only allows it after starting TLS
* src/gtk/gtkinputdialog.c
o Eat GDK_Return so that the combo popup doesn't
  appear when we press Enter to validate the combo
  input dialog (as seen in the Open with... dialog)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/common/smtp.c
src/gtk/inputdialog.c
src/imap.c
src/procmime.c

index 53df00083beea87ee5811415f1a76b60122cf3c4..667c9f95d3273ebfbae7c6f6532220d414354afb 100644 (file)
@@ -1,3 +1,21 @@
+2005-06-10 [colin]     1.9.11cvs57
+
+       * src/imap.c
+               o Fix a format string error
+               o init ssl socket outside of the thread 
+                 (it possibly invokes gtk calls)
+       * src/procmime.c
+               o Put back the buffer to its necessary size
+               o Fix changing a file pointer without keeping
+                 track of it (thanks Valgrind)
+       * src/common/smtp.c
+               o Fix automatic STARTTLS if login should be done
+                 and the server only allows it after starting TLS
+       * src/gtk/gtkinputdialog.c
+               o Eat GDK_Return so that the combo popup doesn't 
+                 appear when we press Enter to validate the combo
+                 input dialog (as seen in the Open with... dialog)
+
 2005-06-10 [colin]     1.9.11cvs56
 
        * src/imap.c
index dc553c8f8f342f50afd61944867cf20686fec386..57a931eb65fbf6f713665c088365b2ff83cd83bb 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.179.2.21 -r 1.179.2.22 src/imap.c;  ) > 1.9.11cvs54.patchset
 ( cvs diff -u -r 1.179.2.22 -r 1.179.2.23 src/imap.c;  ) > 1.9.11cvs55.patchset
 ( cvs diff -u -r 1.179.2.23 -r 1.179.2.24 src/imap.c;  ) > 1.9.11cvs56.patchset
+( cvs diff -u -r 1.179.2.24 -r 1.179.2.25 src/imap.c;  cvs diff -u -r 1.49.2.46 -r 1.49.2.47 src/procmime.c;  cvs diff -u -r 1.11.2.11 -r 1.11.2.12 src/common/smtp.c;  cvs diff -u -r 1.2.2.8 -r 1.2.2.9 src/gtk/inputdialog.c;  ) > 1.9.11cvs57.patchset
index ca4743d402c35c0e25e74a2bb80f89117c685604..79761864d46ead9936329b47ee523d97fa12d465 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=56
+EXTRA_VERSION=57
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4148617e15833f3d179b0e59eb6c8a678d95c484..23ba517fa08034f5f8d2fbfdb71424b5480cdbaa 100644 (file)
@@ -299,6 +299,10 @@ static gint smtp_ehlo_recv(SMTPSession *session, const gchar *msg)
                        session->max_message_size = atoi(p);
                        session->esmtp_flags |= ESMTP_SIZE;
                }
+               if (g_ascii_strncasecmp(p, "STARTTLS", 8) == 0) {
+                       p += 9;
+                       session->avail_auth_type |= SMTPAUTH_TLS_AVAILABLE;
+               }
                return SM_OK;
        } else if ((msg[0] == '1' || msg[0] == '2' || msg[0] == '3') &&
            (msg[3] == ' ' || msg[3] == '\0'))
@@ -597,8 +601,16 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
                }
 #endif
                if (smtp_session->user) {
-                       if (smtp_auth(smtp_session) != SM_OK)
-                               smtp_from(smtp_session);
+                       if (smtp_auth(smtp_session) != SM_OK) {
+#if USE_OPENSSL
+                               if (session->ssl_type == SSL_NONE
+                               &&  smtp_session->tls_init_done == FALSE
+                               &&  (smtp_session->avail_auth_type & SMTPAUTH_TLS_AVAILABLE))
+                                       smtp_starttls(smtp_session);
+                               else
+#endif
+                                       smtp_from(smtp_session);
+                       }
                } else
                        smtp_from(smtp_session);
                break;
index d0c7392f9555614ef9ecca579a8545a98d84ec13..8e955dbf2d4f20400afeecf34e5e2def2f10f172 100644 (file)
@@ -353,6 +353,11 @@ static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data
        if (event && event->keyval == GDK_Escape) {
                ack = FALSE;
                fin = TRUE;
+       } else if (event && event->keyval == GDK_Return) {
+               ack = TRUE;
+               fin = TRUE;
+               return TRUE; /* do not let Return pass - it
+                             * pops up the combo on validating */
        }
 
        return FALSE;
index c2e2e4fe2de378566ecff3d0f06fc49a488779aa..8cfd4115ecc0bc0d46c7d5f3af80bf7a33167e62 100644 (file)
@@ -521,7 +521,7 @@ static gchar *imap_getline(SockInfo *sock)
                /* don't let the interface freeze while waiting */
                sylpheed_do_idle();
        }
-       debug_print("---imap_getline_thread done %s\n");
+       debug_print("---imap_getline_thread done\n");
 
        /* get the thread's return value and clean its resources */
        pthread_join(pt, (void *)&line);
@@ -2075,16 +2075,6 @@ void *imap_open_thread(void *data)
                return NULL;
        }
 
-#if USE_OPENSSL
-       if (td->ssl_type == SSL_TUNNEL && !ssl_init_socket(sock)) {
-               log_warning(_("Can't establish IMAP4 session with: %s:%d\n"),
-                           td->server, td->port);
-               sock_close(sock);
-               sock = NULL;
-               td->done = TRUE;
-               return NULL;
-       }
-#endif
        td->done = TRUE;
        return sock;
 }
@@ -2158,6 +2148,16 @@ static SockInfo *imap_open(const gchar *server, gushort port)
 
        /* get the thread's return value and clean its resources */
        pthread_join(pt, (void *)&sock);
+#if USE_OPENSSL
+       if (sock && td->ssl_type == SSL_TUNNEL && !ssl_init_socket(sock)) {
+               log_warning(_("Can't establish IMAP4 session with: %s:%d\n"),
+                           td->server, td->port);
+               sock_close(sock);
+               sock = NULL;
+               td->done = TRUE;
+               return NULL;
+       }
+#endif
        g_free(td->server);
        g_free(td);
 
index 49bea7b5804ebbd91a91646b859ccc0eb3cd05bf..bb84330071d2e20403d883b92655ea92c51aea6f 100644 (file)
@@ -434,7 +434,7 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
        }
 
        if (encoding == ENC_BASE64) {
-               gchar inbuf[B64_LINE_SIZE+1], outbuf[B64_BUFFSIZE];
+               gchar inbuf[B64_LINE_SIZE], outbuf[B64_BUFFSIZE];
                FILE *tmp_fp = infp;
                gchar *tmp_file = NULL;
 
@@ -458,6 +458,7 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
                                gchar *out = canonicalize_str(mimeinfo->data.mem);
                                fclose(infp);
                                infp = str_open_as_stream(out);
+                               tmp_fp = infp;
                                g_free(out);
                                if (infp == NULL)
                                        return FALSE;