diff options
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 013eb4a184..51de559c8e 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -318,16 +318,27 @@ fetch_mail_fetch (struct _mail_msg *mm) fm->cache = cache; em_filter_folder_element_filter (mm); + /* need to uncancel so writes/etc. don't fail */ + if (mm->ex.id == CAMEL_EXCEPTION_USER_CANCEL) + camel_operation_uncancel(NULL); + /* save the cache of uids that we've just downloaded */ camel_uid_cache_save (cache); + } - /* if we don't do this, no operations on the folder will work */ - if (mm->ex.id == CAMEL_EXCEPTION_USER_CANCEL) - camel_operation_uncancel(NULL); + if (fm->delete && mm->ex.id == CAMEL_EXCEPTION_NONE) { + /* not keep on server - just delete all the actual messages on the server */ + for (i=0;i<folder_uids->len;i++) { + d(printf("force delete uid '%s'\n", (char *)folder_uids->pdata[i])); + camel_folder_delete_message(folder, folder_uids->pdata[i]); + } + } + if (fm->delete || cache_uids) { /* expunge messages (downloaded so far) */ camel_folder_sync(folder, fm->delete, NULL); } + camel_uid_cache_destroy (cache); camel_folder_free_uids (folder, folder_uids); } else { |