2006-06-29 [colin] 2.3.1cvs36
authorColin Leroy <colin@colino.net>
Thu, 29 Jun 2006 07:01:57 +0000 (07:01 +0000)
committerColin Leroy <colin@colino.net>
Thu, 29 Jun 2006 07:01:57 +0000 (07:01 +0000)
* src/imap.c
Better handling of login errors (ask the password
again once), alert in case of error. Fix three
signedness warnings.

ChangeLog
PATCHSETS
configure.ac
src/imap.c

index 956f6295be43e6ca89573176d555dc59858dc226..0e0b81ef66a9ba871d874932beb292538dcbf4ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-06-29 [colin]     2.3.1cvs36
+
+       * src/imap.c
+               Better handling of login errors (ask the password
+               again once), alert in case of error. Fix three
+               signedness warnings.
+
 2006-06-28 [wwp]       2.3.1cvs35
 
        * src/prefs_template.c
index 6af0437fa39ccd94abc6f48783854f4fbf51c515..316074cd77f7dde3a8db066bf2eb83c6af1d3862 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.83.2.72 -r 1.83.2.73 src/mimeview.c;  ) > 2.3.1cvs33.patchset
 ( cvs diff -u -r 1.105.2.58 -r 1.105.2.59 src/prefs_account.c;  ) > 2.3.1cvs34.patchset
 ( cvs diff -u -r 1.12.2.24 -r 1.12.2.25 src/prefs_template.c;  cvs diff -u -r 1.43.2.38 -r 1.43.2.39 src/prefs_matcher.c;  cvs diff -u -r 1.1.4.26 -r 1.1.4.27 src/prefs_filtering_action.c;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/prefs_quote.c;  ) > 2.3.1cvs35.patchset
+( cvs diff -u -r 1.179.2.123 -r 1.179.2.124 src/imap.c;  ) > 2.3.1cvs36.patchset
index db16cf10a0b8f6060b27182d144468459f3c4bc9..5be70c2df61f1254f507d5a07ef89d22974214d1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=35
+EXTRA_VERSION=36
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 3d69188a53c72d8e504ba07477dc8abf61c35336..4cee841fac9bd3a48a4dc11e4d2476f907789d10 100644 (file)
@@ -862,11 +862,13 @@ static IMAPSession *imap_session_new(Folder * folder,
 static void imap_session_authenticate(IMAPSession *session, 
                                      const PrefsAccount *account)
 {
-       gchar *pass;
+       gchar *pass, *acc_pass;
+       gboolean failed = FALSE;
 
        g_return_if_fail(account->userid != NULL);
-
-       pass = account->passwd;
+       acc_pass = account->passwd;
+try_again:
+       pass = acc_pass;
        if (!pass && account->imap_auth_type != IMAP_AUTH_ANON) {
                gchar *tmp_pass;
                tmp_pass = input_dialog_query_password(account->recv_server, account->userid);
@@ -880,12 +882,21 @@ static void imap_session_authenticate(IMAPSession *session,
        statusbar_print_all(_("Connecting to IMAP4 server %s...\n"),
                                account->recv_server);
        if (imap_auth(session, account->userid, pass, account->imap_auth_type) != IMAP_SUCCESS) {
-               imap_threaded_disconnect(session->folder);
-               imap_cmd_logout(session);
                statusbar_pop_all();
                
+               if (!failed) {
+                       acc_pass = NULL;
+                       failed = TRUE;
+                       goto try_again;
+               } else {
+                       imap_threaded_disconnect(session->folder);
+                       imap_cmd_logout(session);
+                       alertpanel_error(_("Couldn't login to IMAP server %s."), account->recv_server);
+               }               
+
                return;
-       }
+       } 
+
        statusbar_pop_all();
        session->authenticated = TRUE;
 }
@@ -2663,7 +2674,7 @@ static gint imap_cmd_append(IMAPSession *session, const gchar *destfolder,
 
        flag_list = imap_flag_to_lep(flags);
        r = imap_threaded_append(session->folder, destfolder,
-                        file, flag_list, new_uid);
+                        file, flag_list, (int *)new_uid);
        mailimap_flag_list_free(flag_list);
 
        if (r != MAILIMAP_NO_ERROR) {
@@ -3077,7 +3088,8 @@ gint imap_get_num_list(Folder *folder, FolderItem *_item, GSList **msgnum_list,
 {
        IMAPFolderItem *item = (IMAPFolderItem *)_item;
        IMAPSession *session;
-       gint ok, nummsgs = 0, exists, uid_val, uid_next = 0;
+       gint ok, nummsgs = 0, exists;
+       guint32 uid_next = 0, uid_val = 0;
        GSList *uidlist = NULL;
        gchar *dir;
        gboolean selected_folder;