Capturing messages via Sieve scripts
The MTA has a private Sieve extension action, "
capture", that takes an argument specifying a destination address to which to send an encapsulated copy of the original message. "
capture" is supported only in system Sieves: that is, channel Sieves or the MTA
systemfilter(in legacy configuration, the
imta.filterfile). By default, this causes generation of a new message to the capturer in almost exactly the same DSN format (see Format of captured message copies) as results from use of the
ldap_captureattribute (discussed in Capture triggered via LDAP attribute).
New in MS 6.3 are the optional, nonpositional parameters
:message. The default is
:dsn, which corresponds to the only behavior previously available, that of captured copies being in encapsulated format as with
ldap_capture attribute use. However, if the new-in-6.3 "
:message" parameter is specified, then the "capture" message copy may instead be generated without MIME encapsulation (though the envelope From address of the new message copy will be set to that of the "owner" of the Sieve filter).
New in MS 7.0 update 2 is the optional parameter
:journal, which is an alternative to
:dsn. This new
:journal parameter causes the Sieve "
capture" action to produce Microsoft Exchange's "envelope journaling" format. This format consists of a multipart MIME message where the first part contains envelope information in a semi-structured format and the second part is the actual message.
Because the "
capture" action can, like any other Sieve action, be coded into use in a Sieve script doing complicated filtering of messages, it is especially well-suited to cases where it is desired to "capture" only particular sorts of messages (e.g., those containing particular header lines, particular combinations of senders and recipients, particular sorts of message contents, etc.). For some examples, see Example Sieve external lists with properties.
However, Sieve filter based "capture", especially with the new-in-6.3
:message argument or the new-in-7.0u2
:journal argument, may also be a useful part of an archiving approach. See Format of captured message copies for a discussion of the possible formats for captured message copies.