When you configure the store.messagetype.x.flagname parameter for a message type, you create a unique flag that identifies the message type. This flag cannot be modified by end users.
Messaging Server presents the message-type flag as a user flag to IMAP clients. Mapping the message type to a user flag allows mail clients to use simple IMAP commands to manipulate messages by message type.
For example, you can perform the following operations:
Use the IMAP FETCH FLAGS command to display a message-type flag name as a user-defined flag to the client.
For a sample use of the IMAP FETCH FLAGS command, see Example 20–1, shown below.
Use a message-type flag as a keyword in an IMAP SEARCH command.
For a sample use of the IMAP SEARCH command, see Example 20–1, shown below.
The message-type user flag is read only. It cannot be modified by IMAP commands.
The following examples assume you configure the message-type configutil parameters with the values shown here:
store.messagetype.enable = yes store.messagetype.1 = text/plain store.messagetype.1.flagname = text store.messagetype.1.quotaroot = text store.messagetype.2 = multipart/voice-message store.messagetype.2.flagname = voice_message store.messagetype.2.quotaroot = voice |
The following IMAP session fetches messages for the currently selected mailbox:
2 fetch 1:2 (flags rfc822) * 1 FETCH (FLAGS (\Seen text) RFC822 {164} Date: Wed, 8 July 2006 03:39:57 -0700 (PDT) From: bob.smith@siroe.com To: john.doe@siroe.com Subject: Hello Content-Type: TEXT/plain; charset=us-ascii * 2 FETCH (FLAGS (\Seen voice_message) RFC822 {164} Date: Wed, 8 July 2006 04:17:22 -0700 (PDT) From: sally.lee@siroe.com To: john.doe@siroe.com Subject: Our Meeting Content-Type: MULTIPART/voice-message; ver=2.0 2 OK COMPLETED |
In the preceding example, two messages are fetched, one text message and one voice mail.
The message-type flags are displayed in the format configured with the store.messagetype.*.flagname parameter.
The Content-Type header fields identify the message types. The message-type names are displayed as they were received in the incoming messages. They use mixed uppercase and lowercase letters and include the message-type arguments such as charset=us-ascii.
The following IMAP session searches for voice messages for the currently selected mailbox:
3 search keyword voice_message * SEARCH 2 4 6 3 OK COMPLETED |
In the preceding example, messages 2, 4, and 6 are voice messages. The keyword used in the search is voice_message, the value of the store.messagetype.2.flagname parameter.