methodiSmtpServerPolicy.MessageComplete
function MessageComplete(const aSession: tSmtpSession; const aEnvelope: iSmtpEnvelope; const aData: tBytes; var aCode: Integer; var aText: string): Boolean;
The message, dot-unstuffed, with the Received stamp already prepended. Returning True is a promise to the client that the message is accepted - so anything that has to be durable must be durable BEFORE this returns.
aEnvelope IS A SNAPSHOT AND MAY BE KEPT. It is not aSession.Envelope: that one is the live transaction and is cleared the moment this returns, ready for the next message on the same connection, so an implementation that stored it would find it emptied by the time it looked. This one belongs to the message and outlives the call for as long as a reference is held - which is what lets a spool or a queue take it as it stands. aData, by contrast, is WIPED when this returns: copy what you keep.