Logo Search packages:      
Sourcecode: pwlib version File versions

void PSMTPServer::OnRCPT ( const PCaselessString recipient  )  [protected, virtual]

Parameters:
recipient  Name of recipient.

Definition at line 621 of file inetmail.cxx.

References AmbiguousUser, CannotForward, ForwardDomain(), LocalDomain, LookUpName(), UnknownUser, ValidUser, WillForward, and PInternetProtocol::WriteResponse().

Referenced by ProcessCommand().

{
  PCaselessString toName;
  PCaselessString toDomain;
  PCaselessString forwardList;
  if (ParseMailPath(recipient, "to", toName, toDomain, forwardList) == 0)
    WriteResponse(501, "Syntax error.");
  else {
    switch (ForwardDomain(toDomain, forwardList)) {
      case CannotForward :
        WriteResponse(550, "Cannot do forwarding.");
        break;

      case WillForward :
        if (!forwardList)
          forwardList += ":";
        forwardList += toName;
        if (!toDomain)
          forwardList += "@" + toDomain;
        toNames.AppendString(toName);
        toDomains.AppendString(forwardList);
        break;

      case LocalDomain :
      {
        PString expandedName;
        switch (LookUpName(toName, expandedName)) {
          case ValidUser :
            WriteResponse(250, "Recipient " + toName + " Ok");
            toNames.AppendString(toName);
            toDomains.AppendString("");
            break;

          case AmbiguousUser :
            WriteResponse(553, "User ambiguous.");
            break;

          case UnknownUser :
            WriteResponse(550, "User unknown.");
            break;

          default :
            WriteResponse(550, "Error verifying user.");
        }
      }
    }
  }
}


Generated by  Doxygen 1.6.0   Back to index