X-Git-Url: http://git.megabrutal.com/?p=mgsmtp.git;a=blobdiff_plain;f=Listener.pas;fp=Listener.pas;h=52d753d3d59c94a1bfc1ba3f1574fc6c2815911e;hp=fc92edd86a77c31ac0a808354e03fc3710940c71;hb=a48c41148c3655c6c0de176060d739d3438e25f7;hpb=443339e2756df295317b7136b3262e368fdb9bfa diff --git a/Listener.pas b/Listener.pas index fc92edd..52d753d 100644 --- a/Listener.pas +++ b/Listener.pas @@ -42,6 +42,8 @@ type protected procedure HandleClient(Connection: TTCPConnection); override; procedure ReceiveEMailData(TCP: TTCPRFCConnection; Response: TRFCReply; SpoolObject: TSpoolObjectCreator); + public + function StartListen: boolean; end; @@ -132,10 +134,18 @@ constructor TMgSMTPListener.Create(const Address: string; Port: word); begin { Request connection objects with support for RFC-style commands & responses. } inherited Create(Address, Port, NET_TCP_RFCSUPPORT); - Logger.AddLine('Server', 'Listening on address: ' + Address + ':' + IntToStr(Port)); end; +function TMgSMTPListener.StartListen: boolean; +begin + Result:= inherited StartListen; + if Result then + Logger.AddLine('Server', 'Listening on address: ' + GetSockAddrStr) + else + Logger.AddLine('Server', 'Failed to listen on address: ' + GetSockAddrStr); +end; + procedure TMgSMTPListener.HandleClient(Connection: TTCPConnection); { This is the procedure that actually handles the clients. It receives an object that manages the established connection in the parameter.