Customize Notification Process

The xcomntfy script is used, when notification is requested, to notify users that a transfer has completed successfully. System administrators can modify this script to customize notification procedures, if necessary. For any other post-processing modifications, we recommend that you use xcompp.
The xcomntfy script is used, when notification is requested, to notify users that a transfer has completed successfully. System administrators can modify this script to customize notification procedures, if necessary. For any other post-processing modifications, we recommend that you use xcompp.
About xcomntfy
XCOMNTFY uses one of the following programs to read the queue entry to determine the user id and password to send an email.
  • xcommail to use the MAPI (Messaging Application Programming Interface)
  • xcomsmtp to use the SMTP interface
Notification is done using the notify script, which is defined to
XCOM Data Transport
for UNIX and Linux with the parameter, XNOTIFYCMD$XCOM_HOME/cmd/xcomntfy, in the xcom.glb global file.  $XCOM_HOME is an environment variable.
You need to set up the notify script to use xcommail or xcomsmtp. A sample notify script is distributed with
XCOM Data Transport
.
Sample Script
The supplied script uses mailx(1) to notify the named user logins.
#!/bin/sh # @(#)xcomntfy.sh 1.2 3/28/92 08:42:41 # This procedure (xcomntfy) is called by CA XCOM Data Transport # transaction program when the NOTIFY parameter is set to YES. # # The arguments passed to the xcomntfy procedure are: # # -q q_entryname # # -h how # # The following $how will be treated as 'M' (mail to user) by default: # T - TSO; # R - ROSCOE; # C - CICS; # L - another LU; # M - mail to user. # The following $how will be treated as 'W' (write to user) by default: # W - write to user. # The following $how will be treated as 'A' (write to all users) by # default: # A - all; # # -u login # # Note: 1.Other information about the transfer can be extracted # from the output of xcomqm -D$q_entryname command # for postprocessing # 2.If specified in $how method fails, the mail message will be # sent to $LOGNAME or root. #uncomment following to diagnose problems with script # set -xv if [ `uname` = 'SunOS' ] then MAIL=Mail else MAIL=mailx fi # required for HPUX-10 if [ `uname` = 'HP-UX' ] then PATH=/opt/xcom/bin:$PATH fi while test $# -gt 0 do case "$1" in -h) how="$2" shift;; -q) q_entryname="$2" shift;; -u) login="$2" shift;; esac shift done case "$how" in [TRCLMV]* ) xcomqm -D$q_entryname| $MAIL -s "xfer $q_entryname" ${login:-${LOGNAME:-root}} >/dev/null 2>&1 ;; [W]* ) xcomqm -D$q_entryname| if [ "$login" != "" ] then (write $login || $MAIL -s "xfer $q_entryname" ${login:-${LOGNAME:-root}}) >/dev/null 2>&1 fi ;; [A]* ) xcomqm -D$q_entryname| (wall || $MAIL -s "xfer $q_entryname" ${login:-${LOGNAME:-root}}) >/dev/null 2>&1 ;; * ) ;; esac # put user defined notification # script here exit 0
Requirements for SMTP Notifies
Following the requirements for addresses and related parameters for SMTP notifies.
  • From Addresses
  • To Addresses
From Addresses
This section describes the requirements for to addresses and related parameters for SMTP notifies (local and remote).
Local Notifies
For an SMTP email
local
notify,
XCOM Data Transport
checks the following parameters to use as the from address:
  • XCOM_USERID (in the global file)
    If neither of these parameters has been specified, then the results are as follows: No notify happens.
  • XCOM Data Transport
    displays an error message.
  • Set the following parameters:
  • LCLNTFYL={ALL|WARN|ERROR}
  • LOCAL_NOTIFY=(local user)
  • MAIL_TYPE=SMTP (global file parameter)
  • NOTIFYL=MAIL
  • SMTP_SERVER={SMTP server address|name} (global file parameter)
  • XNOTIFYCMD=$XCOM_HOME/cmd/xcomntfy (global file parameter)
Remote Notifies
For an SMTP email remote notifies,
XCOM Data Transport
checks the following parameters to use as the from address:
  • First, the USERID of the remote user (in the configuration file)
  • Second, XCOM_USERID (in the global file)
If parameters have of these been specified, then the results are as follows:
  • No notify happens.
  • XCOM Data Transport
    displays an error message.
    Note: The following parameters must also be set:
  • MAIL_TYPE=SMTP (global file parameter)
  • NOTIFY_NAME=(remote user)
  • NOTIFYR=MAIL
  • RMTNTFYL={ALL|WARN|ERROR}
  • SMTP_SERVER={SMTP server address|name} (global file parameter)
  • XNOTIFYCMD=$XCOM_HOME/cmd/xcomntfy (global file parameter)
To Addresses
This section describes the requirements for to addresses and related parameters for SMTP notifies (local and remote).
Local Notifies
For an SMTP email
local
notify,
XCOM Data Transport
uses the following parameter as the to address:
  • LOCAL_NOTIFY (in the configuration file)
    If this parameter has not been specified, then the results are as follows:
  • No notify happens.
  •  
    XCOM Data Transport
    displays an error message.
    The following parameters must also be set:
  • LCLNTFYL={ALL/WARN/ERROR}
  • MAIL_TYPE=SMTP (global file parameter)
  • NOTIFYL=MAIL
  • SMTP_SERVER={SMTP server address|name} (global file parameter)
  • XNOTIFYCMD=$XCOM_HOME/cmd/xcomntfy (global file parameter)
Remote Notifies
For an SMTP email
remote
notify,
XCOM Data Transport
uses the following parameter as to the address:
  • NOTIFY_NAME (in the configuration file)
    If this parameter has not been specified, then the results are as follows:
  • No notify happens.
  • XCOM Data Transport
    displays an error message.
    The following parameters must also be set:
  • MAIL_TYPE=SMTP (global file parameter)
  • NOTIFYR=MAIL
  • RMTNTFYL={ALL/WARN/ERROR}
  • SMTP_SERVER={SMTP server address|name} (global file parameter)
  • XNOTIFYCMD=$XCOM_HOME/cmd/xcomntfy (global file parameter