Folder entities

RatOpenFolder options prot [args]
Opens a folder. Currently the only defined protocols are 'std' and 'dbase'. This command returns a folder handle. Options is a list > of extra options (for example {sort date}).

std
requires a mailbox name as argument. Networked mailboxes also require an username and a protocol. The special name 'INBOX' refers to the users incoming mailbox.

dbase the following arguments:
keywords exDate exType a_dbase_search_expression
dis requires the following arguments
name spec user prot
$folder update mode
Updates the mailbox. mode can be either update, checkpoint or sync. If it is update then the function only check for new mail. If it is checkpoint then it writes any unsaved flag-changes etc to disk and if it is sync then the folder is expunged. Returns the number of new messages.
$folder close [force]
Closes the folder. After this the folder handler is deleted. If the force argument is present and true then the folder is closed no matter how many times it has been opened.
$folder setName name
Sets the folder name to name.
$folder info
Returns a list with the following elements: Some folder types may not support the size value. In this case -1 is returned.
$folder list format
Returns a list with one entry per message in the folder The format of the entry is specified in the "format" argument. The "format" argument looks like a string to printf except the only thing that may follow the '%' (except another '%') is an optional integer (may be negative) and one of the following characters:
sSubject of message
nName of sender (or mailaddress if the name is not available)
mMail address of sender
rName of recipient
RMail address of recipient
bApproximate size of message in bytes
BApproximate size of message in bytes (expressed as a mangled number string)
dMessage date (formatted)
DMessage date (in seconds since the epoch)
SMessage status (string of maximum 5 characters)
iCurrent message index in folder
tThreading string
In some cases the message size may not be available. In that case it is replaced by a '?'.
$folder get index
Returns a message handler for the message specified by "index". This is an index into the list of messages as it is returned by the list comnmand.
$folder setFlag index flag value
Sets the specified flag of the message specified by "index" to a value (a boolean value). The flag is one of 'seen', 'deleted', 'flagged' or 'answered'.
$folder getFlag index flag
Gets the specified flag of the message specified by "index". The flag is one of 'seen', 'deleted','flagged' or 'answered'.
$folder flagged flag
Returns a list of messages (thir indexes) that are marked with the given flag. Flag can be one of 'seen', 'deleted','flagged' or 'answered'.
$folder insert message [message ...]
Inserts the messages whose handlers are passed in the message arguments into the folder.
$folder type
Returns the type of the folder (dbase, std or dis).
$folder find message
Returns the index in the folder for the specified message, or -1 if the message is not associated with this folder.
$folder match expId
Returns a list of indexes of messages that matches the given expression (you get the id from RatParseExp).
$folder getSortOrder Returns the current sort order of a folder
$folder setSortOrder order
Sets a new sort order of a folder
$folder netsync
Synchronizes the folder over the network if possible (only disconnected folders support this).
$folder refcount
Returns how many current references there are to this folder.