Sun Java System Messaging Server 6.3 Administration Guide

20.7.5 Expiring Messages by Message Type

The expire and purge feature allows you to move messages from one folder to another, archive messages, and remove messages from the message store, according to criteria you define in expire rules. You perform these tasks with the imexpire utility.

Because the imexpire utility is run by the administrator, it bypasses quota enforcement.

For information about how to write expire rules and use the imexpire utility, see 20.9 To Set the Automatic Message Removal (Expire and Purge) Feature

You can write expire rules so that messages of different types are expired according to different criteria.

The expire feature is extremely flexible, offering many choices for setting expire criteria. This section describes one example in which text and voice messages are expired according to different criteria.

The example assumes you have configured text and voice message types as follows:


store.messagetype.1 = text/plain

store.messagetype.2 = multipart/voice-message

Assume also that the message store is configured to read the Content-Type header field to determine the message type.


Example 20–3 Sample Rules for Expiring Different Message Types


TextInbox.folderpattern: user/%/INBOX
TextInbox.messageheader.Content-Type: text/plain
TextInbox.messagedays: 365
TextInbox.action: fileinto:Archive


VoiceInbox.folderpattern: user/%/INBOX
VoiceInbox.messageheader.Content-Type: multipart/voice-message
VoiceInbox.savedays: 14
VoiceInbox.action: fileinto:OldMail

VoiceOldMail.folderpattern: user/%/OldMail
VoiceOldMail.messageheader.Content-Type: multipart/voice-message
VoiceOldMail.savedays: 30
VoiceOldMail.action: fileinto:Trash

Trash.folderpattern: user/%/Trash
Trash.savedays: 7
Trash.action: discard

In this example, text messages and voice mail are expired in different ways, and they follow different schedules, as follows:

Note: The savedays rule causes a message to be expired the specified number of days after the message is saved. In a typical voice mail system, a user can save voice mail on the voice mail menu. For text messages, a message is saved when it is moved to a folder. The messagedays rule causes a message to be expired the specified number of days after it first arrives in the message store, no matter which folder it is stored in or how often it is moved.