Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/imap/cmd-logout.c @ 9575:0a00dcc4f0ea HEAD
lib-storage: Allow shared namespace prefix to use %variable modifiers.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 26 May 2010 17:07:51 +0100 |
parents | 00cd9aacd03c |
children |
rev | line source |
---|---|
9532
00cd9aacd03c
Updated copyright notices to include year 2010.
Timo Sirainen <tss@iki.fi>
parents:
8590
diff
changeset
|
1 /* Copyright (c) 2002-2010 Dovecot authors, see the included COPYING file */ |
0 | 2 |
3 #include "common.h" | |
2852 | 4 #include "ostream.h" |
0 | 5 #include "commands.h" |
6 | |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3141
diff
changeset
|
7 bool cmd_logout(struct client_command_context *cmd) |
0 | 8 { |
3141
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
2852
diff
changeset
|
9 struct client *client = cmd->client; |
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
2852
diff
changeset
|
10 |
0 | 11 client_send_line(client, "* BYE Logging out"); |
2813
572f29f4fa22
Send the "* BYE Logging out" before closing mailbox.
Timo Sirainen <tss@iki.fi>
parents:
2665
diff
changeset
|
12 o_stream_uncork(client->output); |
295
c6c0e376008f
close mailbox before sending "OK Logout completed", because the closing may
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
13 |
c6c0e376008f
close mailbox before sending "OK Logout completed", because the closing may
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
14 if (client->mailbox != NULL) { |
7647
879208fdc7e3
Implemented CONTEXT=SEARCH extension.
Timo Sirainen <tss@iki.fi>
parents:
7086
diff
changeset
|
15 client_search_updates_free(client); |
295
c6c0e376008f
close mailbox before sending "OK Logout completed", because the closing may
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
16 /* this could be done at client_disconnect() as well, |
c6c0e376008f
close mailbox before sending "OK Logout completed", because the closing may
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
17 but eg. mbox rewrite takes a while so the waiting is |
c6c0e376008f
close mailbox before sending "OK Logout completed", because the closing may
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
18 better to happen before "OK" message. */ |
3879
928229f8b3e6
deinit, unref, destroy, close, free, etc. functions now take a pointer to
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
19 mailbox_close(&client->mailbox); |
295
c6c0e376008f
close mailbox before sending "OK Logout completed", because the closing may
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
20 } |
c6c0e376008f
close mailbox before sending "OK Logout completed", because the closing may
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
21 |
3141
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
2852
diff
changeset
|
22 client_send_tagline(cmd, "OK Logout completed."); |
4096
904c53275e83
Log a line when IMAP client disconnects with a reason why it happened.
Timo Sirainen <tss@iki.fi>
parents:
3879
diff
changeset
|
23 client_disconnect(client, "Logged out"); |
0 | 24 return TRUE; |
25 } |