sp_processmail

(Windows only) Reads, processes, sends, and deletes messages in the SAP ASE message inbox, using the xp_findnextmsg, xp_readmail, xp_sendmail, and xp_deletemail system extended stored procedures (ESPs).

Syntax

sp_processmail [subject] [, originator [, dbuser
	[, dbname [, filetype [, separator]]]]]

Parameters

Examples

Usage

There are additional considerations when using sp_processmail:
  • sp_processmail reads, processes, sends, and deletes messages in the SAP ASE message inbox, using the xp_findnextmsg, xp_readmail, xp_sendmail, and xp_deletemail system ESPs.

  • sp_processmail sends outgoing mail to the originator of the incoming mail message being processed.

  • sp_processmail uses the default parameters when invoking the ESPs, except for the dbuser, dbname, attachname, and separator parameters to xp_sendmail, which can be overridden by the parameters to sp_processmail.

  • sp_processmail processes all messages as SAP ASE queries. It reads messages from the SAP ASE inbox and returns query results to the sender of the message and all its cc’d and bcc’d recipients in an attachment to an SAP ASE message. sp_processmail generates a name for the attached file consisting of “syb” followed by five random digits, followed by the extension specified by the filetype parameter; for example, “syb84840.txt.”

  • sp_processmail deletes messages from the inbox after processing them.

  • The subject and originator parameters specify which messages should be processed. If neither of these parameters is supplied, sp_processmail processes all the unread messages in the SAP ASE message inbox.

  • sp_processmail does not process attachments to incoming mail. The query must be in the body of the incoming message.

See also isql in the Utility Guide.

Permissions

You must have execute permission to run sp_processmail. The permission can be granted to other users by the database owner of sybsystemprocs.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
xp_deletemail
xp_findnextmsg
xp_readmail
xp_sendmail
xp_startmail