(Relay) Minor optimization to TRelayer.OpenConnection
[mgsmtp.git] / Relay.pas
index 3df2b330ca14ec3d79d61d5200980f7f74597ded..bcbcc9d92ee6842c5de66b050df69c6890e949e1 100644 (file)
--- a/Relay.pas
+++ b/Relay.pas
@@ -333,9 +333,8 @@ begin
    if MXList.Count >= 1 then begin
       TCP:= TTCPRFCConnection.Create;
       TCP.SetBindAddress(MainServerConfig.BindAddress);
    if MXList.Count >= 1 then begin
       TCP:= TTCPRFCConnection.Create;
       TCP.SetBindAddress(MainServerConfig.BindAddress);
-      TCP.Connect(MXList.Strings[0], RelayServerPort);
       TCP.SetSockTimeOut(DEF_SOCK_TIMEOUT);
       TCP.SetSockTimeOut(DEF_SOCK_TIMEOUT);
-      i:= 1;
+      i:= 0;
       while (not TCP.Connected) and (i < MXList.Count) do begin
          TCP.Connect(MXList.Strings[i], RelayServerPort);
          Inc(i);
       while (not TCP.Connected) and (i < MXList.Count) do begin
          TCP.Connect(MXList.Strings[i], RelayServerPort);
          Inc(i);