Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/imap/cmd-copy.c @ 296:d66aa1f1fb2d HEAD
Added fast-flag for mailbox opening, which doesn't do any index compressing
or cache updating. This flag is set when mailbox is opened by APPEND, COPY
or STATUS (ie. not SELECT/EXAMINE).
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 23 Sep 2002 13:42:20 +0300 |
parents | 3b1985cbc908 |
children | 20769b7516a2 |
rev | line source |
---|---|
0 | 1 /* Copyright (C) 2002 Timo Sirainen */ |
2 | |
3 #include "common.h" | |
4 #include "commands.h" | |
5 | |
6 int cmd_copy(Client *client) | |
7 { | |
8 Mailbox *destbox; | |
9 const char *messageset, *mailbox; | |
10 | |
11 /* <message set> <mailbox> */ | |
12 if (!client_read_string_args(client, 2, &messageset, &mailbox)) | |
13 return FALSE; | |
14 | |
15 if (!client_verify_mailbox_name(client, mailbox, TRUE)) | |
16 return TRUE; | |
17 | |
18 /* open the destination mailbox */ | |
19 if (!client_verify_mailbox_name(client, mailbox, TRUE)) | |
20 return TRUE; | |
21 | |
22 destbox = client->storage->open_mailbox(client->storage, | |
296
d66aa1f1fb2d
Added fast-flag for mailbox opening, which doesn't do any index compressing
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
23 mailbox, FALSE, TRUE); |
0 | 24 if (destbox == NULL) { |
25 client_send_storage_error(client); | |
26 return TRUE; | |
27 } | |
28 | |
29 /* copy the mail */ | |
30 if (client->mailbox->copy(client->mailbox, destbox, | |
31 messageset, client->cmd_uid)) { | |
32 client_sync_mailbox(client); | |
33 client_send_tagline(client, "OK Copy completed."); | |
34 } else | |
35 client_send_storage_error(client); | |
36 | |
37 destbox->close(destbox); | |
38 return TRUE; | |
39 } |