FTransactionComplete:= false;
FRoutingTarget:= RoutingTable.GetRouteInfo(Envelope.RelayHost);
Response:= TRFCReply.Create;
+ TCP:= nil;
FillChar(SMTPExtensions, SizeOf(TSMTPExtensions), #0);
end;
begin
FRoutingTarget.Free;
Response.Free;
+ if TCP <> nil then TCP.Free;
inherited Destroy;
end;
Inc(i);
end;
Result:= TCP.Connected;
+ if not TCP.Connected then FreeAndNil(TCP);
end
else Result:= false;
MXList.Free;
begin
TCP.SendCommand(SMTP_C_QUIT);
{TCP.ReadResponse(Response);}
- TCP.Free;
+ FreeAndNil(TCP);
end;
{
MegaBrutal's SMTP Server (MgSMTP)
- Copyright (C) 2010-2015 MegaBrutal
+ Copyright (C) 2010-2018 MegaBrutal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
AssignDeliveryStatusToSMTPCodes(CurrEnv, Relayer.IsTransactionComplete);
Relayer.CloseConnection;
- Relayer.Free;
HandleDeliveryResults(SpoolObject, false, CurrEnv, FailEnv, 0, '');
end
else begin
HandleDeliveryResults(SpoolObject, false, CurrEnv, FailEnv, DS_DELAYED or DS_CONNECTIONFAIL, DSMSG_CONNECTIONFAIL + Relayer.RelayServerName);
end;
- { Free envelope. }
+ { Free relayer and envelope. }
+ Relayer.Free;
CurrEnv.Free;
end;