Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodiSmtpServerPolicy.CheckConnection

function CheckConnection(const aSession: tSmtpSession; var aCode: Integer; var aText: string): Boolean;
THE CONNECTION ITSELF, asked before the banner is composed and before the peer has said a word. The envelope already carries RemoteAddress, TransportInfo and SecureChannel, so this is the earliest - and by a wide margin the cheapest - place to decide that a peer is not welcome: a refusal here costs one reply and no transaction state at all.

REFUSING CLOSES THE CONNECTION. There is nothing to continue: the peer has not asked a question, so there is no next command that could mean anything. RFC 5321 sec.3.1 provides 554 for precisely this greeting, and that is the pre-loaded code. A 4xx tells a legitimate sender to come back, which is what a rate limit wants.