The G4MSLSTMM command is used to list and retrieve email messages associated with a specific Microsoft Outlook or Office 365 Account

The following files will be populated after each call.

  • G4MSMHPF - This is the Email Header file. For each message retrieved this file will contain the Microsoft ID, Message ID, and a short snippet of the message

  • G4MSMHHPF - This is the Email Header "Header" file. For each message retrieved this file will contain one entry for each header and the header value associated with the email. Headers are things like subject, to, from, etc.

  • G4MSMHLPF - This is the Email Header "Label" file. For each message retrieved this will contain one or more values that represent the labels associated with that particular message.

  • G4MSMMPF - This is the Email Message file. For each message retrieved there will be a record and the label it was retrieved from.

  • G4MSMBPF - This is the EMail Message Body file. For each email that contains a "body" a record will be added here with a link to the stream file that the body is placed in. Normally a record will only be placed in this file when the email message is a plain text email with no attachments, images or other parts.

  • G4MSMPPF - This is the Email Message "Part" file. When messages are retrieved each piece of it, including attachments and embedded images, etc, are known as "Parts". This file will contain one record for each part associated with each message retrieve.

Each time this command is called the records in each of these files for the Microsoft ID that is running the command will be cleared.

List MS EMail Messages (G4MSLSTMM)

Type choices, press Enter.

MS ID . . . . . . . . . . . . . ________________________________________________________________________________

Label ID . . . . . . . . . . . . 'Inbox'

Retrieve New Messages Only . . . *YES *YES, *NO

Retrieve Message Parts . . . . . *YES *YES, *NO

Mark Messages as Read . . . . . *YES *YES, *NO

Move to Folder . . . . . . . . . *NONE

Additional Parameters

Filter . . . . . . . . . . . . . *NONE

Temporary Directory . . . . . . '/tmp'

Maximum Part Size . . . . . . . 0 0-16773104

CCSID . . . . . . . . . . . . . 1208 Number

Debug . . . . . . . . . . . . . *NO *YES, *NO

Debug File . . . . . . . . . . .


F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display

F24=More keys

  • MS ID - Enter the Microsoft ID that you wish to receive email messages for.

  • Label ID - Enter the label ID that you wish to receive messages from. The label ID can be found in the G4MSMLPF file after running the G4MSLSTML command. This can contain the special values of Inbox, Drafts, SentItems or DeletedItems. The value of *ALL may also be used to retrieve emails from every label.

  • Retrieve New Messages Only - Specify *YES to retrieve only new messages.

  • Retrieve Message Parts - Specify *YES to retrieve the parts (attachments, embedded images, etc) of the email.

  • Mark Messages as Read - Specify *YES to mark each message retrieved as read.

  • Filter - Specify your custom filters to select emails. These must meet MS specs and be properly encoded. See https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter for more information:
    receivedDateTime+ge+2021-01-05T17:10:00Z - This will search for messages with a received date and time greater than or equal to
    January 5, 2021 17:10 UCT (11:10am CST)

    contains(subject,'monday') - This will search for messages with the work monday (case insensitive) in the subject of the message.

    receivedDateTime+ge+2021-01-05T17:10:00Z+and+contains(subject,'monday') - Combination of the two examples using "and".

  • Move to Folder - Specify a Label ID to move the email to once processing is complete. The value of *NONE will not move the message.

  • Temporary Directory - Specify the fully qualified IFS path to a directory to hold the files retrieved when downloading Email Messages.

  • Maximum Part Size - Specify the maximum size of each "part" to download. The value of zero will use the default maximum size of 16mb.

  • CCSID - Specify the CCSID to use for processing.

  • Debug - Specify *YES to turn debugging on.

  • Debug File - Specify the fully qualified name of the debug file to use. The default name will be used for each process (ie, body, parts, marking as read, and moving to a new folder).