smtp_server_data
Since: Dev Builds Only
The functionality described in this section requires a dev build of KumoMTA. You can obtain a dev build by following the instructions in the Installation section.
Called by the ESMTP server after receiving the message data, but before responding to the client in the live SMTP session.
The message content will be exactly the data passed to the server via the
DATA
command; no trace or other headers will have been added at this stage.
The event handler will be passed a Message object.
The conn_meta parameter represents the connection metadata and can be used to share state between the various SMTP listener event handlers. See Connection Metadata for more information.
If the client issued multiple "RCPT TO"
commands in the same transaction,
each one will result in a recipient being added to the recipient list in the
message, which you can review and/or modify via
Message::recipient_list and
Message::set_recipient.
This event is the best place to carry out policy that:
- Validates/mutates message content/headers, regardless of the recipient list
- Validates/modifies the recipient list for eg: alias expansion, legal capture
It is NOT recommended to perform recipient-oriented actions at this stage;
instead you should put those in
smtp_server_message_received which will be
called once smtp_server_data
completes.