4.2 List Exit Points
The following list exit points are available.
4.2.1 ADD/SUBSCRIBE Exit Points
Name: SUB_FILTER
Parameters: One; originator's e-mail address
Return code: 0=Accept, 1=Reject
Description: This exit point gives you a chance to reject a subscription request by returning a nonzero value. This adds to rather than replaces the "Filter=" keyword.
Name: SUB_FAIL
Parameters: One; originator's e-mail address
Return code: Ignored/reserved - always return 0
Description: This exit point is called whenever a subscription is rejected (in particular, it is called if you return 1 from SUB_FILTER). You may send additional messages to the user, log the event, and so on.
Name: SUB_REQ
Parameters: One; originator's e-mail address
Return code: Ignored/reserved - always return 0
Description: The user's request for subscription is being forwarded to the list owners. You may send additional messages to the user, log the event, and so on. To implement custom subscription/rejection, use the SUB_FILTER exit with "Subscription= Open". When SUB_REQ is called, it is too late to let the user through.
Name: SUB_NEW, ADD_NEW
Parameters: One; originator's e-mail address
Return code: Ignored/reserved - always return 0
Description: This exit point notifies you that the user has been successfully subscribed to the list (SUB_NEW is for the SUBSCRIBE command, ADD_NEW corresponds to the ADD command). You can send additional messages, log the event, and so on.
4.2.2 DELETE/SIGNOFF/CHANGE Entry Points
Name: CHG_REQ
z/VM Parameters: Three; originator's e-mail address '15'x target subscriber's e-mail address '15'x new e-mail address
Non-z/VM Parameters: Three; originator's e-mail address '20'x target subscriber's e-mail address '20'x new e-mail address
Return code: 0=Accept, 1=Reject
Description: This exit point is called for the CHANGE command when issued by a list subscriber. It is NOT called for CHANGE commands originating from the list owner or node administrator on behalf of a subscriber. This exit point allows you to reject the operation. If you return the value 1, LISTSERV rejects the operation.
Name: DEL_FILTER
z/VM Parameters: One or two; target e-mail address '15'x originator's address
Non-z/VM Parameters: One or two; target e-mail address '20'x originator's address
Return code: 0=Accept, 1=Reject, 2=Interrupt processing of command
Description: This exit point is called for all SIGNOFF commands, and for DELETE commands issued by a registered Node Administrator. It is NOT called for DELETE commands originating from the list owner. If you return the value 1, LISTSERV does not delete the target e-mail address but continues to look for more addresses matching the pattern provided, and the exit will be called again as appropriate. If you return the value 2, LISTSERV simply interrupts the processing of the SIGNOFF command and terminates the command with no further message (i.e., you have to send your own explanation back to the command originator). If the request is rejected, you should check for the presence of the second parameter and send an explanatory message to that address, or to the target address if only one parameter was specified.
Name: DEL_SIGNOFF
Parameters: One; originator's e-mail address
Return code: 0=Continue, 1=Do not notify owner
Description: This exit point is called for the SIGNOFF command only, when a user has been successfully removed from the list. The farewell message, if any, has already been sent. You may issue additional messages, log the event, and so on. A return value of 1 directs LISTSERV not to mail the "SIGNOFF1" form to the list owners.
Name: DEL_DELETE
z/VM Parameters: Two; target e-mail address '15'x originator's address
Non-z/VM Parameters: Two; target e-mail address '20'x originator's address
Return code: 0=Continue, 1=Do not notify owner
Description: This exit point is called for the DELETE command only, after a user has been removed from the list. You may issue additional messages, log the event, and so on. A return value of 1 directs LISTSERV not to mail the "DELETE1" form to the list owners.
4.2.3 Other Exit Points
Name: SET_REQ
z/VM Parameters: Three; originator's address '15'x list of options to be altered '15'x target e-mail address
Non-z/VM Parameters: Three; originator's address '20'x list of options to be altered '20'x target e-mail address
Return code: 0=Accept, 1=Reject, 2=Alter
Description: This exit point is called for all SET commands that do not originate from the list owner. The first parameter (originator's address) is the address you should use to send replies or informational messages to the command originator.
The second parameter (list of options to be altered) is a blank-separated list of command options, in their canonical spelling. If topics have been specified, they are listed last, after the word 'TOPICS:', with the spelling provided by the user. Bear in mind that topic change requests are not necessarily a list of the new topics to be enabled, and may contain complex '+' or '-' directives.
Finally, the third parameter (target e-mail address) is the address as it appears in the list, and is provided for the sake of completeness; in most cases you will not need to examine it. If you return the value 1, the command is rejected and no option is modified. A return value of 2 indicates that the list of options and/or topics should be altered before the changes are performed. The exit string must contain a replacement for the second input parameter, in the same format. LISTSERV will assume that any options or topics specified in this fashion are syntactically correct; while incorrect values will not cause any problem and will be properly rejected as invalid options, the error message(s) returned to the user may not be as helpful as they ordinarily would.
Name: POST_FILTER
Parameters: One; e-mail address of the poster.
Return code: 0=Accept, 1=Reject
Description: This exit point is called for messages posted to a list. It can be used to compare the e-mail address of the poster to a list of users who should (or should not) be allowed to post. It can further be used to scan the body of the e-mail message, i.e., to accept or reject the message based on its content.
The exit places the message to be checked in the file $D/listserv.cmsut1 (where $D is the value assigned with .SD D in system.cfg or CORPORAT SYSVARS, D= in go.sys, or D\ in system_config.dat, depending on your OS platform; in any case, by default this is LISTSERV's TMP directory or minidisk).
A return value of 0 indicates that LISTSERV should continue processing the posting, while a return value of 1 indicates that LISTSERV should reject the posting.
Note: Your exit program MAY NOT edit or alter the listserv.cmsut1 file as LISTSERV has already loaded it preparatory to processing it. The exit point ONLY allows you to accept or reject the message. |
4.2.4 General Remarks
Important: List exits may not make any change to the LIST file, because the command processor may have changes of its own to make to the file, or may have kept the file open for further processing. Under z/VM only, If you really have to change the file, use CP MSG * CMS EXEC to schedule a new call to the exit after command processing completes. |
The template processor can be called from list exits. The syntax is:
Call LSVTMAIL recipients,template_name,listname,keywords
where keywords = 'KWD1 value of first keyword'||'15'x'KWD2 second keyword'||...