X-Git-Url: http://git.megabrutal.com/?p=mgsmtp.git;a=blobdiff_plain;f=Relay.pas;h=e863023fde92a7f11ca9eadb8476511ddb0f1749;hp=cf3876027bef390a883e18f7771258ceced65416;hb=7c2747623547f74cab3bdb565b24edbd81fef086;hpb=54baea76c00e60c3e49bc3a3fa4292cf637dfbf9 diff --git a/Relay.pas b/Relay.pas index cf38760..e863023 100644 --- a/Relay.pas +++ b/Relay.pas @@ -1,6 +1,6 @@ { 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 @@ -331,7 +331,10 @@ var MXList: TStrings; i: integer; begin MXList:= GetCorrectMXRecordList(RelayServerName); if MXList.Count >= 1 then begin - TCP:= TTCPRFCConnection.Create(MXList.Strings[0], RelayServerPort); + TCP:= TTCPRFCConnection.Create; + TCP.SetBindAddress(AF_INET, MainServerConfig.BindAddress); + TCP.SetBindAddress(AF_INET6, MainServerConfig.BindAddress6); + TCP.Connect(MXList.Strings[0], RelayServerPort); TCP.SetSockTimeOut(DEF_SOCK_TIMEOUT); i:= 1; while (not TCP.Connected) and (i < MXList.Count) do begin