class->settings_type,
CAMEL_TYPE_SETTINGS));
settings = g_object_new (class->settings_type, NULL);
+ camel_settings_load_from_url (settings, camel_service_get_camel_url (service));
}
if (service->priv->settings != NULL)
camel_imap_response_free (store, response);
}
- if (local_error == NULL && delete_originals) {
+ if (local_error == NULL && delete_originals && (mark_moved || !trash_path)) {
for (i = last; i < uid; i++) {
camel_folder_delete_message (
source, uids->pdata[i]);
return FALSE;
}
+ /* There is a real trash folder set, which is not on a google account
+ and copied messages should be deleted, thus do not move them into
+ a trash folder, but just expunge them, because the copy part of
+ the operation was successful.
+ */
+ if (trash_path && !mark_moved && delete_originals)
+ camel_imap_expunge_uids_only (source, uids, cancellable, NULL);
+
return TRUE;
}