|
|
long mail_ping(MAILSTREAM *stream);
This function pings the stream to see if it is still active. It may discover new mail; this is the preferred method for a periodic new mail check as well as a keep alive for servers which have an inactivity timeout. It returns T if the stream is still alive, NIL otherwise.
If new mail is found, the application's mm_exists function is called with the newly-determined number of messages in the mailbox.
void mail_check(MAILSTREAM *stream);
This function causes a mailstore-defined checkpoint of the mailbox. This may include such things as a writeback to disk, a check for flag changes in a shared mailbox, and so on. It is not a check for new mail; mail_ping performs this function (as potentially does any other function). The status of the check is passed to the application via the mm_log facility.
void mail_expunge (MAILSTREAM *stream);
This function causes an expunge (permanent removal of messages which are marked as deleted) of the mailbox. The application's mm_expunged function is called for each message that has been expunged. The application's mm_exists function is called at the start and end of the expunge to ensure synchronization. The status of the expunge is passed to the application via the mm_log facility.
Note that the decrementing of msgno's for subsequent messages happens immediately; for example, if three consecutive messages starting at msgno 5 are expunged, mm_expunged will be called three times with a msgno of 5.
long mail_copy(MAILSTREAM *stream, char *sequence, char *mailbox);long mail_move(MAILSTREAM *stream, char *sequence, char *mailbox);
long mail_copy_full(MAILSTREAM *stream, char *sequence, char *mailbox, long options);
These functions cause the messages in the specified sequence to be copied to the specified mailbox. T is returned if the copy is successful. mail_move is equivalent to setting CP_MOVE in the options.
If there is any problem in copying, a message will be passed to the application via the mm_log facility and the function returns NIL. No copying is actually done in this case.
Note that the mailbox must be on the same host as the stream and is a mailbox of the type of the source mailbox only.
The flags for mail_search_full are a bit mask with one or more of the following:
long mail_append(MAILSTREAM *stream, char *mailbox, STRING *message);long mail_append_full(MAILSTREAM *stream, char *mailbox, char *flags, char *date, STRING *message);
These functions write the message in the string structure to the destination mailbox, along with the flags and date if specified. This is useful in those cases where you cannot use mail_copy, for example, when copying from one server to another; you can always fetch the message and then mail_append it to the destination. It may also be useful for maintaining an outbox of your outgoing mail.
void mail_gc(MAILSTREAM *stream, long gcflags);
This function garbage collects (purges) the cache of entries of a specific type. Some drivers do not allow purging of particular cache types, and an attempt to do so is ignored.
The flags for mail_gc are a bit mask with one or more of the following: