~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/imap/cmd-expunge.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2002-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "imap-common.h"
4
4
#include "imap-commands.h"
19
19
        return TRUE;
20
20
}
21
21
 
22
 
static bool cmd_expunge_finish(struct client_command_context *cmd,
23
 
                               struct mail_search_args *search_args)
 
22
static bool ATTR_NULL(2)
 
23
cmd_expunge_finish(struct client_command_context *cmd,
 
24
                   struct mail_search_args *search_args)
24
25
{
25
26
        struct client *client = cmd->client;
 
27
        const char *errstr;
 
28
        enum mail_error error = MAIL_ERROR_NONE;
26
29
        int ret;
27
30
 
28
31
        ret = imap_expunge(client->mailbox, search_args == NULL ? NULL :
30
33
        if (search_args != NULL)
31
34
                mail_search_args_unref(&search_args);
32
35
        if (ret < 0) {
33
 
                client_send_storage_error(cmd,
34
 
                                          mailbox_get_storage(client->mailbox));
35
 
                return TRUE;
 
36
                errstr = mailbox_get_last_error(client->mailbox, &error);
 
37
                if (error != MAIL_ERROR_PERM) {
 
38
                        client_send_storage_error(cmd,
 
39
                                mailbox_get_storage(client->mailbox));
 
40
                        return TRUE;
 
41
                } else {
 
42
                        return cmd_sync(cmd, 0, IMAP_SYNC_FLAG_SAFE,
 
43
                                t_strdup_printf("OK Expunge ignored: %s.",
 
44
                                                errstr));
 
45
                }
36
46
        }
37
47
 
38
48
        client->sync_seen_deletes = FALSE;
39
 
        client->sync_seen_expunges = FALSE;
40
49
        if ((client->enabled_features & MAILBOX_FEATURE_QRESYNC) != 0) {
41
50
                return cmd_sync(cmd, MAILBOX_SYNC_FLAG_EXPUNGE,
42
51
                                IMAP_SYNC_FLAG_SAFE, "OK Expunge completed.");