X-Git-Url: http://git.megabrutal.com/?p=mgsmtp.git;a=blobdiff_plain;f=Relay.pas;h=cea792d52c5237a026db4f17fb390c413e16fd1f;hp=4984bc1ea5bf04fb6b427a5bfce48c3c77ee74fb;hb=6f8e6026b5d35a3fa41a124032caed6621a9f86e;hpb=4806fe76baf12d97f1afe2f9b29ea384d37aa839 diff --git a/Relay.pas b/Relay.pas index 4984bc1..cea792d 100644 --- a/Relay.pas +++ b/Relay.pas @@ -377,7 +377,14 @@ begin end; Result:= true; end - else AdministerMassFailure(Result); + else if (Response.GetNumericCode >= 500) and (Response.GetNumericCode <= 504) then begin + { It seems the remote site did not understand our EHLO, that is, + let's admit, quite odd in the 21st century... + Whatever, let's fall back to RFC 821 then. } + TCP.SendCommand(SMTP_C_HELO, MainServerConfig.Name); + TCP.ReadResponse(Response); + Result:= Response.GetNumericCode = SMTP_R_OK; + end; if Result then begin if FRoutingTarget.Auth then begin @@ -408,7 +415,8 @@ begin else Authenticated:= true; if not Authenticated then AdministerMassFailure(Result); - end; + end + else AdministerMassFailure(Result); end else AdministerMassFailure(Result); @@ -474,7 +482,14 @@ end; function TRelayer.DeliverMessagePart(Chunk: TStrings): boolean; { Sends a chunk of the message. } +var i: integer; begin + { Check for lines starting with dots. } + for i:= 0 to Chunk.Count - 1 do + if (Length(Chunk.Strings[i]) > 0) and (Chunk.Strings[i][1] = '.') then + Chunk.Strings[i]:= '.' + Chunk.Strings[i]; + + { Send text. } Result:= TCP.WriteBuffer(PChar(Chunk.Text), Length(Chunk.Text)) <> -1; end;