Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

void PSMTPServer::OnHELO ( const PCaselessString remoteHost  )  [protected, virtual]

Parameters:
remoteHost  Name of remote host.

Definition at line 460 of file inetmail.cxx.

References PIPSocket::GetHostName(), PIPSocket::GetPeerHostName(), PInternetProtocol::GetSocket(), PString::IsEmpty(), and PInternetProtocol::WriteResponse().

Referenced by ProcessCommand().

{
  extendedHello = FALSE;
  ServerReset();

  PCaselessString peerHost;
  PIPSocket * socket = GetSocket();
  if (socket != NULL)
    peerHost = socket->GetPeerHostName();

  PString response = PIPSocket::GetHostName() & "Hello" & peerHost + ", ";

  if (remoteHost == peerHost)
    response += "pleased to meet you.";
  else if (remoteHost.IsEmpty())
    response += "why do you wish to remain anonymous?";
  else
    response += "why do you wish to call yourself \"" + remoteHost + "\"?";

  WriteResponse(250, response);
}


Generated by  Doxygen 1.6.0   Back to index