Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CheckGroup ¶
CheckGroup is a module container for a group of Check implementations.
It allows to share a set of filter configurations between using named configuration blocks (module instances) system.
It is registered globally under the name 'checks'. The object does not implement any standard module interfaces besides module.Module and is specific to the message pipeline.
func (CheckGroup) InstanceName ¶
func (cg CheckGroup) InstanceName() string
func (CheckGroup) Name ¶
func (CheckGroup) Name() string
type Module ¶
type Module struct { *MsgPipeline // contains filtered or unexported fields }
func (*Module) InstanceName ¶
type MsgPipeline ¶
type MsgPipeline struct { Hostname string Resolver dns.Resolver // Used to indicate the pipeline is handling messages received from the // external source and not from any other module. That is, this MsgPipeline // is an instance embedded in endpoint/smtp implementation, for example. // // This is a hack since only MsgPipeline can execute some operations at the // right time but it is not a good idea to execute them multiple multiple // times for a single message that might be actually handled my multiple // pipelines via 'msgpipeline' module or 'reroute' directive. // // At the moment, the only such operation is the addition of the Received // header field. See where it happens for explanation on why it is done // exactly in this place. FirstPipeline bool Log log.Logger // contains filtered or unexported fields }
MsgPipeline is a object that is responsible for selecting delivery targets for the message and running necessary checks and modifiers.
It implements module.DeliveryTarget.
It is not a "module object" and is intended to be used as part of message source (Submission, SMTP, JMAP modules) implementation.
func Mock ¶
func Mock(tgt module.DeliveryTarget, globalChecks []module.Check) *MsgPipeline
Mock returns a MsgPipeline that merely delivers messages to a specified target and runs a set of checks.
It is meant for use in tests for modules that embed a pipeline object.
func (*MsgPipeline) RunEarlyChecks ¶
func (d *MsgPipeline) RunEarlyChecks(ctx context.Context, state *smtp.ConnectionState) error
func (*MsgPipeline) Start ¶
func (d *MsgPipeline) Start(ctx context.Context, msgMeta *module.MsgMetadata, mailFrom string) (module.Delivery, error)
Start starts new message delivery, runs connection and sender checks, sender modifiers and selects source block from config to use for handling.
Returned module.Delivery implements PartialDelivery. If underlying target doesn't support it, msgpipeline will copy the returned error for all recipients handled by target.