Store.expirerule file rulesets

From Messaging Server Technical Reference Wiki
Jump to: navigation, search


store.expirerule file rulesets

As of MS 6.2p4, the rules in a store.expirerule file can be grouped into rule sets by prefixing the attribute names with a textual rule name. For instance:


Rule1.regexp: 1
Rule1.folderpattern: user/.*
Rule1.messagedays: 30
Rule2.folderpattern: user/.*@example.org/.*
Rule2.messagedays: 15

The attributes which may be specified in a rule set are listed in imexpire Ruleset Attributes.

imexpire Ruleset Attributes
Attribute expirerule Option Description (Attribute Value)
action None; expirerule options always operate as discard rule Specifies an action to perform on the messages matching the expiration rules. The possible values are:
  • discard -- discards the message. This is the default.
  • report -- prints the mailbox name, uid-validity, and uid to stdout. The message is not changed by this action.
  • archive -- archives the message with the Compliance and Content Management System. The message is not changed by this action. This is a form of operational archiving, and is no longer supported as of MS 8.0.2.
  • fileinto: folder-name -- files the message into the specified folder. The shared folder prefix can be specified to file messages to folders owned by another user. The original message is discarded if the fileinto operation is successful.
exclusive exclusive Specifies whether or not this is an exclusive rule. The default is 0 (this rule is not exclusive) If specified as exclusive, then only this rule applies to the specified mailbox(es) and all other rules are ignored. If more than one exclusive rule exists, the last exclusive rule loaded will be used. For example, if a global and a local exclusive rule are specified, the local rule will be used. If there is more than one global exclusive rule, the last global rule listed by configutil is used. (1 or 0)
expires   imexpire will select the message if the date value specified by an Expires: header field value is older than the expiration date based on the messagedays attribute value. If multiple expiration header fields are specified, the earliest expiration date will be used. (string)
expiry-date   imexpire will select the message if the date value specified by an Expiry-date: header field value is older than the expiration date based on the messagedays attribute value. If multiple expiration header fields are specified, the earliest expiration date will be used. (string)
folderpattern folderpattern Specifies the folders affected by this rule. The format must start with user/, which represents the directory DATAROOT/store/partition/*/. See imexpire folder patterns. (POXIX regular expression)
messagecount messagecount Maximum number of messages in a folder. Oldest messages are expunged as additional messages are delivered. (integer)
foldersizebytes foldersizebytes Maximum size of folder, in bytes, before the oldest messages are expunged when additional messages are delivered. (integer in bytes)
messagedays messagedays Number of days in the Message Store before message is expunged. (integer)
messagesize messagesize Maximum size of message, in bytes, before it is marked to be expunged. (integer in bytes)
messagesizedays messagesizedays Grace period: days an over-sized message should remain in a folder. (integer)
messageheader.field-name  

Specifies a header field name and header field value string. The header field name and header field values are not case-sensitive, and regular expressions are not recognized. Example:


Rule1.messageheader.Subject: Get Rich Now!

Headers other than Subject: can be used. (string)

regexp   Enable UNIX regular expression in rules creation. If not set, IMAP expressions will be used. See imexpire folder patterns for further details. (0 or 1)
savedays   Number of days a message is saved in a folder until being expunged. (integer)
seen seen \Seen is an IMAP system flag set by the Message Store when the user opens a message. If the store.expirerule file rule set attribute seen is set to and, then the message must be seen and another rule criterion must be met before the rule is fulfilled. If the attribute seen is set to or, then a message only needs to be seen or another rule criterion be met before the rule is fulfilled. The default is and. (and or or)
sieve  

A Sieve test specifying message selection criteria. Example:


Rule17.sieve: header :contains "Subject" "Make money fast"

In order for sieve attribute values to take effect, the expiresieve Message Store option must be enabled; they will be ignored otherwise. Note that by also using a rule set action of fileinto: folder-name in a rule set with a sieve test, an effect of performing a Sieve "fileinto" based on a Sieve test can be obtained; that is, the rule set's sieve value supplies the Sieve test and the rule set's action: fileinto: supplies the fileinto folder name. (string)

deleted deleted \Deleted is an IMAP system flag set by the Message Store when the user deletes a message. If the store.expirerule file rule set attribute deleted is set to and, then the message must be deleted and another rule criterion must be met before the rule is fulfilled. If the attribute deleted is set to or, then a message only needs to be deleted or another rule criterion be met before the rule is fulfilled. The default is and. (and or or)
join   (New in MS 7.0.4) join may only be specified when exclusive rule is set. join can take the values and or or (case insensitive). Specifying join: and means all rule criteria are combined as a single rule. If join is set to or then each criterion cause expiration regardless of other criteria. Specifying invalid value to join will defaults to AND i.e default value for join is AND. (and or or)
userflag.flag-name   (New in MS 7.0.5, as well as MS 7.0.4.24) Valid values are 'and' and 'or'; the default is 'and'. Specify user IMAP flags in expiration rules. For instance, the following rule expires those messages with the 'junk' flag set, and which are older than 30 days:

messagedays: 30
userflag.junk: and

channel   (New in MS 7.0.5) Specify the name of an MTA channel as which to "run" for purposes of spam/virus filtering. In order for a channel attribute value to take effect, the expiresieve Message Store option must be enabled. (string)
rescanhours   (New in MS 7.0.5) When using imexpire to perform post-delivery spam/virus filtering, the rescanhours tells imexpire to rescan those message that have not been scanned for the specified number of hours. The default is 10. In order for any rescanhours attribute value to take effect, the expiresieve Message Store option must be enabled. (integer)

Note that discarded messages are only expunged at the end of the imexpire run, that is, only one expunge operation is performed on each folder.


See also: