You can use an SMTP exit to inspect and filter unwanted mail (spam)
sent through SMTPPROC.
The SMTP component contains the SMTPPROC application which is the
mail to mail interface used on the Internet. This component is responsible
for routing mail between the sender and receiver. A user exit can
be used to reject mail (spam) based on criteria determined by the
user. This exit examines the data sent by the remote SMTP client
application and determines what action to take based on the contents
of that mail item or mail command.
This exit can be replaced dynamically without stopping the SMTPPROC
program. The procedure for doing this follows:
- Issue a "SMSG smtpprocname STOPEXIT" TSO command.
The TSO userid must be in the authorized list for SMTPPROC to issue
this command. This will cause SMTP to issue the termination call
to the exit and then set a flag so that the exit will not be called
anymore. Processing of mail will continue as if there is no exit.
- Remove the old exit using the SETPROG EXIT operator command or
by updating SYS1.PARMLIB(PROGxx) and issuing the refresh console command.
An example of updating SYS1.PARMLIB follows:
- In SYS1.PARMLIB(PROGxx) have this line:
EXIT DELETE EXITNAME(EZBTCPIPSMTPEXIT) MODNAME(OLDEXIT) FORCE(YES)
- At the MVS™ console issue SET PROG=xx.
- Add the new exit using the SETPROG EXIT operator command or by
updating SYS1.PARMLIB(PROGxx). An example of updating SYS1.PARMLIB
follows:
- In SYS1.PARMLIB(PROGxx) have this line:
EXIT ADD EXITNAME(EZBTCPIPSMTPEXIT) MODNAME(NEWEXIT)
- At the MVS console issue SET PROG=xx.
- Issue a "SMSG smtpprocname STARTEXIT" TSO command.
This will cause SMTP to issue the initialization call to the exit.
A flag is then set so the exit will be called from then on for new
mail connections. Processing of new mail will continue with the exit
being called. The first smtp command to be seen by a reinstated exit
will be HELO. The exit will not be called in the middle of a currently
processing exchange.