Commands Valid in the Selected State
CHECK
The CHECK command performs server- or mailstore-dependent mailbox housekeeping not normally performed as part of each IMAP command (also known as a checkpoint).
Usage
CHECK
|
Arguments
| None |
Untagged server responses
| None |
Results
| OK (CHECK completed) |
| BAD (command unknown or invalid arguments) |
Example
A00002 CHECK
A00002 OK CompletedCLOSE
The CLOSE command removes from the currently selected mailbox all messages that have the \\Deleted flag set and returns the user from the selected state back to the authenticated state. Unlike the EXPUNGE command, no untagged EXPUNGE responses are sent for the removed messages by the CLOSE command.
Usage
CLOSE
|
Arguments
| None |
Untagged server responses
| None |
Results
| OK (CLOSE completed successfully) |
| NO (No mailbox selected: CLOSE command failed) |
| BAD (command unknown or invalid arguments) |
Example
A00008 CLOSE
A00008 OK CompletedCOPY
The COPY command copies the specified messages from the selected mailbox into the specified mailbox.
Usage
COPY
|
Arguments
| Set of messages to copy |
| Name of target mailbox |
Untagged server responses
| None |
Results
| OK (successfully copied) |
| NO (COPY command failed) |
| BAD (command unknown or invalid arguments) |
Example
A00322 COPY 1:5 saved-messages
A00322 OK CompletedEXPUNGE
The EXPUNGE command permanently removes all messages that have the \\Deleted flag set from the selected mailbox.
Usage
EXPUNGE
|
Arguments
| None |
Untagged server responses
| One or more untagged EXPUNGE responses |
Results
| OK (EXPUNGE completed successfully) ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access