Re: Minimal SMTPserver app fails on non-development machine!

Giganews Newsgroups
Subject: Re: Minimal SMTPserver app fails on non-development machine!
Posted by:  nd (no@spam.com)
Date: Fri, 6 May 2005

> Connection to host lost
> ..and telnet terminates prematurely.

Maybe somewhat pathetic, but I keep answering my own posts... hopefully to
the benefit of someone.

I installed Remote debugging on the deployment machine and did some peeking
around inside there (God, I love delphi!)
I found this:

In TIdSMTPServer.CommandDATA:

...
        ReceivedString := StringReplace(ReceivedString, '$hostname',
GStack.HostByAddress(ASender.Context.Binding.PeerIP), [rfReplaceall]); {do
not localize}
...

This fails in idStackWindows at the OS call to HostByAddress - for some
reason, a machine name is not returned, and a Socket error 11004 is thrown.
(This terminates the thread.)
I'm still wondering why, but for the time beeing I've done a quick and dirty
fix by wrapping that statement, and another HostByAddress statement further
down, in a try..except block

Ideas, anyone? And what are the side effects of this "fix"? As far as I can
see, only the informational value of the resulting header ("Mail from:xxx"
and so on) is lost?

Replies

In response to

Minimal SMTPserver app fails on non-development machine! posted by nd on Thu, 5 May 2005