Simple
provides a basic plugin implementation of S
to be used as the foundation
for a plugin that overrides only specific callbacks.
session_connect
is called when a client first connects, before any messages are
accepted.
`Accept greeting
initiates a session state and sends the given greeting.
`Disconnect maybe_reply
terminates the connection sending the given
reply. disconnect is NOT called.
session_helo
is called in response to initial handshakes (i.e. HELO or EHLO).
`Continue
will update the session state.
`Deny reply
will send the given reply but leave the session open.
`Disconnect maybe_reply
will send the given reply and close the session
(disconnect is not called)
process_sender
is called in the event of a "MAIL FROM" SMTP command.
`Continue
creates an envelope that is filled in by subsequent commands.
`Reject reply
will abort this message.
process_recipient
is called in the event of a "RCPT TO" SMTP command.
`Continue
augments the envelope in the pipeline and passes it on to the next phase.
`Reject reply
pass through an unmodified envelope to the next phase, omitting
this address from the recipients list.
Called after the message body has been received:
`Consume ok_msg
will discard the message and return a successful response to the
client. It should be used if this plugin has processed the message and does not
intend to relay the message (or a response).
`Reject reply
will discard the message and return an error reply to the client. It
should be used when the plugin does not wish to process this message.
`Send envelopes_to_relay
will spool the given envelopes for further sending and
give a successful response, once these messages have been safely spooled.
`Quarantine (envelopes_to_quarantine, reply, reason)
will save the given messages
to a directory for manual inspection and pass through the given reply to the
client. reason
is used only internally to tell us what check failed.