|
|
The MAILSTREAM structure is used to reference open mailboxes. Applications may reference the following:
char *mailbox;
Mailbox name.
unsigned short use;
Stream use count. This is incremented.
unsigned short sequence;
Stream sequence. This is incremented each time a stream is reused (that is, mail_open is called to open a different mailbox on this stream).
unsigned int rdonly : 1;
Stream is open read-only.
unsigned int anonymous : 1;
Stream is open with anonymous access.
unsigned int halfopen : 1;
Stream is half-open. It can be reopened or used for functions that do not need an open mailbox such as mail_create but no message data can be fetched.
unsigned int perm_seen : 1;
Seen flag can be set permanently.
unsigned int perm_deleted : 1;
Deleted flag can be set permanently.
unsigned int perm_flagged : 1;
Flagged flag can be set permanently.
unsigned int perm_answered :1;
Answered flag can be set permanently.
unsigned int perm_draft : 1;
Draft flag can be set permanently.
unsigned int kwd_create : 1;
New user flags can be created by referencing them in mail_setflag or mail_clearflag. Note that this can change during a session (for example, if there is a limit on the number of keywords), so check after creating a new flag to see if any more can be created before letting the user try to do so.
unsigned long perm_user_flags;
Corresponding user flags can be set permanently; this is a bit mask which
matches the entries in stream->user_flags[]
.
unsigned long gensym;
Generated unique value; always referenced with stream->gensys++
.
unsigned long nmsgs;
Number of messages in current mailbox.
unsigned long recent;
Number of recent messages in current mailbox.
unsigned long uid_validity;
UID validity value. This is used to verify that recorded UIDs match the UIDs that the stream has. If the mailbox does not have matching UIDs (for example, the UIDs were lost or not recorded) then the UID validity value will be different.
unsigned long uid_last;
Highest currently assigned UID in the current mailbox. A new
UID will be assigned with ++stream->uid_last
.
char *user_flags[USERFLAGS];
Pointers to user flag names in bit order from
stream->perm_user_flags
or elt->user_flags
.
DRIVER *dtb;
Dispatch table for this driver.
void *local;
Pointer to driver local data.
unsigned int lock : 1;
Stream lock flag (an operation is in progress; used as a bug trap to detect recursion back to C client from callback routines).
unsigned int debug : 1;
Debugging information should be logged via mm_dlog.
unsigned int silent : 1;
Do not do main program callbacks on this stream (used when a stream is opened internally).
unsigned int scache : 1;
Short caching. Do not cache information in memory.
unsigned long cachesize; /* size of C client message cache */ union { void **c; /* to get at the cache in general */ MESSAGECACHE **s; /* message cache array */ LONGCACHE **l; /* long cache array */ } cache;The following MAILSTREAM values are for the convenience of drivers that use short caching and want to be able to garbage collect any values that they returned:
unsigned long msgno;
Message number of current message.
ENVELOPE *env;
Pointer to current message envelope.
BODY *body;
Pointer to current message body.
char *text;
Pointer to current text.