Skip to content

Documentation ARexxAPI MAILINFO

Jens Maus edited this page Feb 13, 2017 · 1 revision

MAILINFO

NAME:: MailInfo -- Return information about a message. (V2.0)

TEMPLATE:: VAR/K,STEM/K,INDEX/N

FUNCTION:: Returns information about a message in the list, or the current message if none is specified.

INPUTS:: VAR/K - alternative variable to put the results into instead of RESULT\ STEM/K - base name used for the stems where the returned data will be stored\ INDEX/N - position of the message you want info about, the message at the top of the list occupying position 0; if no index is specified, the current message will be used\

RETURNS:: VAR - info returned by the query\ <STEM>INDEX - position of the message in the list; the message at the top occupies position 0\ <STEM>STATUS - status of the message; possible values are: - N - new - O - read - U - unread - R - replied - F - forwarded - S - sent - W - pending - H - hold - E - error sending <STEM>FROM - sender of the message; specifically, the first sender noted in the "From:" header\ <STEM>TO - recipient of the message; actually, the first recipient noted in the "To:" header\ <STEM>REPLYTO - return address of the message; this will be either the first recipient in the "Reply-To:" header, or the first sender in the "From:" header if no "Reply-To:" header exists\ <STEM>CC - first entry in the CC: field, if any\ <STEM>BCC - first entry in the BCC: field, if any\ <STEM>RESENTTO - first entry in the ResentTo: field, if any\ <STEM>SUBJECT - subject of the message (contents of the "Subject:" header)\ <STEM>FILENAME - filename where the message is stored, including path\ <STEM>SIZE - size of the message, in bytes\ <STEM>DATE - date of the message, in "MM-DD-YY HH:MM:SS" format\ <STEM>FLAGS - a 9 byte string in "MARCS-77M" format: {{{ MARCS-77M ||||| ||| ||||| ||--------- 'M'arked flag (V2.4) ||||| |---------- volatile flag (see SETFLAG) ||||| ----------- permanent flag (see SETFLAG) ||||------------- PGP 'S'igned |||-------------- PGP en'C'rypted ||--------------- status 'R'eport |---------------- contains 'A'ttachments ----------------- 'M'ultiple recipients }}} <STEM>MSGID - compressed hexadecimal 32 bit representation of the "Message-ID:" header contents, e.g. BBC62595 (V2.1)\ <STEM>FROMALL - all entries from the From: field, the first entry will be the same as for FROM\ <STEM>TOALL - all entries from the To: field, the first entry will be the same as for TO\ <STEM>REPLYTOALL - all entries from the ReplyTo: field, the first entry will be the same as for REPLYTO\ <STEM>CCALL - all entries from the CC: field, the first entry will be the same as for CC\ <STEM>BCCALL - all entries from the BCC: field, the first entry will be the same as for BCC\ <STEM>RESENTTOALL - all entries from the ResentTo: field, the first entry will be the same as for RESENTTO\

 `RC` is set to 10 if INDEX is out of the range of messages available in
 the folder.

NOTES:: Starting with V2.4, <STEM>MSGID returns an hexadecimal value.\ Starting with V2.6, the "ALL" variables will return all addresses/names from the corresponding header field.

EXAMPLE:: {{{#!arexx /* Enable result codes */ OPTIONS RESULTS

 /* Get info about the current message */
 MAILINFO STEM st.

 /* Only continue if RC == 0 */
 IF RC ~= 0 THEN EXIT

 /* Display results */
 SAY 'Message:    'st.index
 status = st.status
 SELECT
    WHEN status = 'N' THEN status = 'New'
    WHEN status = 'O' THEN status = 'Read'
    WHEN status = 'U' THEN status = 'Unread'
    WHEN status = 'R' THEN status = 'Replied'
    WHEN status = 'F' THEN status = 'Forwarded'
    WHEN status = 'S' THEN status = 'Sent'
    WHEN status = 'W' THEN status = 'Pending'
    WHEN status = 'H' THEN status = 'Hold'
    OTHERWISE status = 'Error sending'
 END
 SAY 'Status:     'status
 SAY 'From:       'st.from
 SAY 'To:         'st.to
 DO i = 0 TO info.TOALL.COUNT-1
    SAY 'To:         'st.TOALL.i
 END
 SAY 'Reply-To:   'st.replyto
 SAY 'Subject:    'st.subject
 SAY 'Filename:   'st.filename
 SAY 'Size:       'st.size
 SAY 'Date:       'st.date
 SAY 'Flags:      'st.flags
 SAY 'Message-ID: 'st.msgid
 }}}

BUGS:: In V2.3p1, <STEM>FILENAME omitted the folder name part if an INDEX was specified. Fixed in V2.4.

SEE ALSO:: SETFLAG

Home

Getting Started

Troubleshooting

Advanced use of YAM

Cookbooks

Development

Clone this wiki locally