Archive Pipeline

From ESM Wiki
Jump to: navigation, search

Archive pipeline is a pipeline that is executed for email archival purpose though it may be used for general purposes.

Contents

Connection with MPP core logic

The pipeline is executed at smtp-end-of-data stage. It is executed when MPP core logic decides that a message need to be archived. If pipeline engines are not defined then old-style archival code is executed instead of the pipeline.

If archive preprocessors are used then the pipeline is executed after preprocessors. Preprocessors may create modified copy of a message been processed. The pipeline acts on this copy and after that copy is discarded. Thus if pipeline postprocessors modify a message they actually modify a copy of a message which then is discarded with all modifications.

If the pipeline is finished normally then MPP core logic will take action defined with <on_archive_success> group option. If the pipeline is finished with error (uncaugh exception) then MPP core logic will take action defined with <on_archive_failure> group option.

Processing logic

Normal processing logic described in overview is applicable for the pipeline. The following postprocessors are defined for the pipeline:

  • Body part replacer allows to replace email body parts with results of engines in the pipeline. May be used in combination with MIME engine to replace body parts with links in body stripping scenario.
  • Headers back inserter allows to insert email headers at the end of existing headers. New email headers are constructed from results of engines in a pipeline.

Configuration

archive_engines
Description: Defines engines sequence for the pipeline. If option is empty then pipeline is undefined and old-style embeded archive code is executed instead of the pipeline.
Configuration type: MPP group-level option.
Value: Space- or comma-separated list of full engine ID's. Default is empty.
archive_exception_engines
Description: Defines exception engines sequence for the pipeline. Exception engines are executed in case of error in pipeline engines according to errors processing mechanism.
Configuration type: MPP group-level option.
Value: Space- or comma-separated list of full engine ID's. Default is empty.
archive_replacers
Description: Specifies postprocessor that replaces value of some property of email with results of engines in the pipeline. What is replaced is defined by option attributes.
Configuration type: MPP group-level option.
Attributes: 1) target specifies a target for replacement. Possible values are:
  • "body_part" specifies that target is body part (body part replacer). Listed engine results should have $body_part dimension otherwise all body parts will be replaced with the same value. Postprocessor looks for a last not null value that corresponds to a body part and replaces the part with this value. If engine results also have $recipient dimension then context is split (message is copied) for each recipient and then replacement is done.

For example:

<archive_replacers target="body_part">engines.mime.generator_1.link engines.mime.generator_2.link</archive_replacers>

will instruct postprocessor to replace body parts with link results of mime.generator_1 and mime.generator_2 engines. Engines should be from different logic branches: if result is null in first engine it may be not null in second and vise versa. If they both have not null result the ambiguity is resolved for the favour of right most not null value.

Value: Space- or comma-separated list of full engine result ID's. Default is empty.
archive_back_inserters
Description: Specifies postprocessor that inserts new request properties after existing properties. New properties are constructed from results of engines in a pipeline. What is inserted is defined by option attributes.
Configuration type: MPP group-level option.
Attributes: 1) target specifies a target for replacement. Possible values are:
  • "headers" specifies that target is email headers (headers back inserter). Listed engine result values should be mime formated headers. If engine results have $recipient dimension then context is split (message is copied) for each recipient and then insertion is done. Values from different engine results and from dimensions other then $recipient are concatenated.

For example:

<archive_back_inserters target="headers">engines.mysql.get_header.result engines.mysql.get_another_header.result</archive_back_inserters>

will instruct postprocessor to insert headers specified by results of mysql.get_header and mysql.get_another_header engines.

Value: Space- or comma-separated list of full engine result ID's. Default is empty.
Personal tools