Implements a simple forwarding policy, to transform or replace recipients.
- class slimta.policy.forward.Forward¶
Enveloperecipient is run through
re.sub()to see if it is modified. If a recipient matches a mapping rule, no further mapping rules are processed. Mapping rules are checked in the order that they were added.
- add_mapping(pattern, repl[, count=0])¶
Adds a mapping rule.
QueuePolicysub-classes must override this method, which will be called by the
envelope – The
Envelopeobject the policy execution should apply any changes to. This envelope object may be modified, though if new envelopes are returned this object is discarded.
Optionally return or generate an iterable of
Envelopeobjects to replace the given
envelopegoing forward. Returning
Noneor an empty list will keep using