aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index ad789dcd14..335b8e71f6 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -214,6 +214,12 @@ real_fetch_mail (gpointer user_data)
} else {
CamelFolder *sourcefolder;
+ store = camel_session_get_store (session, url, ex);
+ if (!store) {
+ async_mail_exception_dialog ("Unable to get new mail", ex, fb);
+ goto cleanup;
+ }
+
camel_service_connect (CAMEL_SERVICE (store), ex);
if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE) {
gtk_object_unref (GTK_OBJECT (dest_folder));
@@ -324,18 +330,22 @@ real_fetch_mail (gpointer user_data)
g_free (url);
if (dest_url)
g_free (dest_url);
+
if (folder) {
camel_folder_sync (folder, TRUE, ex);
gtk_object_unref (GTK_OBJECT (folder));
}
+
if (dest_folder) {
camel_folder_sync (dest_folder, TRUE, ex);
gtk_object_unref (GTK_OBJECT (dest_folder));
}
+
if (store) {
camel_service_disconnect (CAMEL_SERVICE (store), ex);
gtk_object_unref (GTK_OBJECT (store));
}
+
if (dest_store && dest_store != fb->folder->parent_store) {
camel_service_disconnect (CAMEL_SERVICE (dest_store), ex);
gtk_object_unref (GTK_OBJECT (dest_store));