Work with SMTP E-mail Messages (WRKSMTPEMM)

The Work with SMTP E-mail Messages (WRKSMTPEMM) command allows working with e-mail messages that are currently being processed by the SMTP server for use with the local SMTP mailbox directory.

Restrictions:

Parameters

Keyword Description Choices Notes
TYPE E-mail type Single values: *ALL, *MIX
Other values (up to 3 repetitions): *LCD, *RLY, *NDL
Optional
LISTBY List e-mail by *ORG, *RCP Optional
SORTBY Sort e-mail by *LISTBY, *SUB, *DMN, *TIME, *IP Optional
QUEUE E-mail queue Single values: *ALL
Other values (up to 8 repetitions): *DLV, *PND, *RTY, *ERR, *FTR, *MSF, *NDL, *WRK
Optional
ADDRESS E-mail address or domain Character value, *ALL Optional
FROMTIME Starting time and date Element list Optional
Element 1: Time Time, *AVAIL
Element 2: Date Date, *BEGIN
TOTIME Ending time and date Element list Optional
Element 1: Time Time, *AVAIL
Element 2: Date Date, *END

E-mail type (TYPE)

Specifies the type of e-mail messages to list.

Single values

*ALL
Lists all e-mail messages regardless of what direction or whether it is non-deliverable.
*MIX
Lists all e-mail messages regardless except those that are non-deliverable.

Other values (up to 3 repetitions)

*LCD
Lists only local deliverable e-mail messages.
*RLY
Lists only relaying out e-mail messages.
*NDL
Lists only non-deliverable e-mail messages.

List e-mail by (LISTBY)

Specifies whether to list e-mail messages by originator or recipient.

*ORG
Lists by originator, recipients can be accessed on the display e-mail message option. When working with e-mail messages by the originator you are working with the entire e-mail message.
*RCP
Lists by recipient. Each recipient of an email message will receive its own list entry. There may be multiples for each email message. When working with an e-mail message by recipient you are only working on that envelope with to that recipient.

Sort e-mail by (SORTBY)

Specifies the primary field to sort the e-mail message list. For duplicates the list will be sorted in this order: time stamp, type, and last queue. If time was selected as primary then the email address will become the first secondary field for sorting.

*LISTBY
Sorts by originator or recipient based on the LISTBY keyword. If the LISTBY keyword is set to *ORG then this will sort by originator e-mail address. If the LISTBY keyword is set to *RCP then the list will be sorted by recipient e-mail address.
*DMN
Sorts e-mail messages by the domain of the originator or recipient. If the LISTBY keyword is set to *ORG then this will sort by the domain of the originator e-mail address. If the LISTBY keyword is set to *RCP then the list will be sorted by the domain of the recipient e-mail address.
*SUB
Sorts by subject. This will be best fit for the current job CCSID. Any characters that cannot be displayed in the current job CCSID will be replaced by an asterisk before it is sorted. Selecting this type of sort will have the subject charset become a secondary sorting field before the time stamp.
*TIME
Sorts by time stamp. If the LISTBY keyword is set to *ORG then the originator e-mail address becomes the secondary sorting field. If the LISTBY keyword is set to *RCP then the recipient e-mail address becomes the secondary sorting field.
*IP
Sorts by incoming IP address. If the LISTBY keyword is set to *RCP then this value for SORTBY is not valid.

List e-mail by (QUEUE)

Specifies the queue status types to list.

Single values

*ALL
Lists all e-mail messages regardless of queue status.

Other values (up to 8 repetitions)

*DLV
Lists all delivered e-mail messages for which the logging time has not expired.
*PND
Lists all pending e-mail messages that has yet to be processed.
*RTY
Lists all e-mail messages to be retried.
*ERR
Lists all e-mail messages that encountered an error that cannot be retried.
*WRK
Lists all e-mail messages currently in use by the SMTP Server or Client.
*MSF
Lists all e-mail messages sent to the Mail Server Framework (MSF) for delivery.
*FTR
Lists all e-mail messages that has matched the anti-spam filtering rules.
*NDL
Lists all e-mail messages that could not be delivered and a non-delivery e-mail message was generated.

E-mail address or domain (ADDRESS)

Specifies the either an e-mail address to list or domain. When this keyword is set only the e-mail addresses or domains specified by the LISTBY keyword will be shown.

*ALL
All e-mail messages will be shown.
email-address
Specifies a valid e-mail address or domain. An e-mail address consists of a mailbox@domain. If the @ symbol is missing then this keyword will be assumed to be a domain. Mailboxes must be able to be converted from JOB CCSID to ISO-8859-1. Domains must be upper or lower case letters, digits, period, hyphen, or underscore (ie A-Z,a-z,.,-,_).

Starting time and date (FROMTIME)

Specifies the date and time of the first email to be used for external representation.

Element 1: Time

*AVAIL
Any email messages that are available for the specified starting date are shown.
time
Specifies a time to list all e-mail messages starting from the specified time. For restrictions on how to enter the time please see the help text for ELEM command TYPE keyword *TIME type.

Element 2: Date

*BEGIN
Lists all e-mail messages from the first e-mail message processed on the system.
date
Specifies a date to list all e-mail messages starting from the specified date. For restrictions on how to enter the date please see the help text for ELEM command TYPE keyword *DATE type.

Ending time and date (TOTIME)

Specifies the date and time of the last e-mail message to be used for external representation.

Element 1: Time

*AVAIL
Any email messages that are available for the specified ending date are shown.
time
Specifies a time to list all e-mail messages ending to the specified time. For restrictions on how to enter the time please see the help text for ELEM command TYPE keyword *TIME type.

Element 2: Date

*END
Lists all e-mail messages to the most current e-mail message processed on the system.
date
Specifies a date to list all e-mail messages ending to the specified date. For restrictions on how to enter the date please see the help text for ELEM command TYPE keyword *DATE type.

Examples

Example 1: Work with All Non-delivered E-mail Messages in the Local SMTP E-mail Directory

WRKSMTPEMM

This command allows you to work with all non-delevered e-mail messages in the directory.

Example 2: Work with All Failed E-mail Messages in the Local SMTP e-mail Directory

WRKSMTPEMM QUEUE(*RTY *ERR)

This command allows you to work with all failed e-mail messages, including those that will be retried.

Example 3: Work with All Relaying out E-mail Messages from a Certain Address

WRKSMTPEMM TYPE(*RLY) ADDRESS(XXXX@YYYY)

This command allows you to work with all relaying out e-mail messages from address XXXX@YYYY.

Example 4: Work with All Relaying out E-mail Messages for a Certain Domain

WRKSMTPEMM LISTBY(*RCP) OPTION(*RLY) ADDRESS(YYYY)

This command allows you to work with all relaying out e-mail messages to domain YYYY.

Error messages

*ESCAPE Messages

TCP506A
Operation &1 can't be finished.
TCP506B
Recipient not changed to &1.
TCP506C
E-mail recipient &1 not removed.
TCP506D
Recipient &1 not added to retry queue.
TCP506E
Recipient &1 anti-spam filtering not overridden.
TCP5070
CHGSMTPA DIRTYPE setting is &1.
TCP5071
Amount of email requested exceeds display limit
TCP8050
*IOSYSCFG authority required to use &1.
TCP9999
Internal system error in program &1.