[[TranslatedPages]]
[[TOC(sectionindex, heading=ARexx Function List, notitle, depth=1, Documentation/ARexxAPI/)]]
== MAILFILTER
NAME::
MailFilter -- Filter messages in the current folder. (V1.3.3)
TEMPLATE::
VAR/K,STEM/K,ALL/S
FUNCTION::
Filters all the messages in the current folder, or only those
marked as "new".
INPUTS::
`VAR/K` - alternative variable to put the results into instead of RESULT (V2.0)\\
`STEM/K` - base name used for the stems where the returned data will be stored (V2.0)\\
`ALL/S` - filter ALL the messages in the folder, instead of only those marked as "new"\\
RETURNS::
`VAR` - info returned by the query\\
`CHECKED` - total number of messages checked\\
`BOUNCED` - number of messages bounced\\
`FORWARDED` - number of messages forwarded\\
`REPLIED` - number of messages auto-replied\\
`EXECUTED` - number of messages that triggered a command execution\\
`MOVED` - number of messages moved to another folder\\
`DELETED` - number of messages deleted\\
Note that stems are initialized even for empty folders.
WARNING::
Due to a design flaw in YAM, filtering a large amount of mail
where lots of folder indices need to be loaded is potentially
dangerous on Amigas with few memory, as the system might run
out of memory while the filtering is being done, thus leading
to a crash. Use with caution.
NOTES::
Contrary to what happens when using the GUI, the command doesn't
put up any warning when working in a folder other than "Incoming".
EXAMPLE::
{{{#!urbiscript
/* Enable result codes */
OPTIONS RESULTS
/* Filter all the messages in the current folder */
MAILFILTER ALL STEM st.
/* Only continue if RC == 0 */
IF RC ~= 0 THEN EXIT
/* Display results */
SAY 'Checked messages: 'st.checked
SAY 'Bounced: 'st.bounced
SAY 'Auto-forwarded: 'st.forwarded
SAY 'Auto-replied: 'st.replied
SAY 'Commands triggered: 'st.executed
SAY 'Moved: 'st.moved
SAY 'Deleted: 'st.deleted
}}}
BUGS::
SEE ALSO::