PROCEDURE rap$define_smtp (
  protocol, p: key
      (stream_socket, ss)
      (cdna_session, cs)
    keyend = stream_socket
  status)


*IF $variable(rav$proc_doc,declared)<>'UNKNOWN'

"    This request defines the SMTP client.
"
*IFEND


  "$FORMAT=OFF"
  VAR
    command_file: file = $unique($local)
    ignore_status: status
    local_status: status
  VAREND
  "$FORMAT=ON"


  IF protocol = stream_socket THEN
COLLECT_TEXT command_file until='    collect_end' sm='?'
      $system.osf$command_library.manage_network_applications
        define_tcpip_application application=osa$smtp_client protocol=?protocol?
          change_maximum_sockets maximum_sockets=100
        quit
        activate_tcpip_application application=osa$smtp_client
      quit
    collect_end
  ELSE
COLLECT_TEXT command_file until='  collect_end' sm='?'
    put_line 'WARNING - TCP/IP Gateway support terminated at release level 1.7.1' o=$response
    $system.osf$command_library.manage_network_applications
      define_client client=osa$smtp_client protocol=?protocol?
        change_maximum_connections mc=100
      end_define_client
      activate_client client=osa$smtp_client
    quit
  collect_end
  IFEND

  include_file command_file status=local_status
  delete_file command_file status=ignore_status

  IF local_status.normal THEN
    put_line ' SMTP client is defined' o=$response
  IFEND

  EXIT_PROC WITH local_status WHEN NOT local_status.normal

PROCEND rap$define_smtp

