mail-storage.h revision e1dff8512ee6f4e09b13a2abc46936f3250279ea
/* Don't use fsync() or fdatasync() */ /* Mailbox must not be modified even if asked */ /* Any extra time consuming operations shouldn't be performed (eg. when opening mailbox just for STATUS). */ /* Don't reset MAIL_RECENT flags when syncing */ /* Don't create index files for the mailbox */ /* Keep mailbox exclusively locked all the time while it's open */ /* Maximum size for sort program (each one separately + END) */ /* Set has_nuls / has_no_nuls fields */ /* Hide changes done in this transaction from next view sync */ /* External transaction. Should be used for copying and appends, /* Always assign UIDs to messages when saving/copying. Normally this is done only if the mailbox is synced, or if dest_mail parameter was non-NULL to mailbox_save_init() or mailbox_copy() */ /* Make sure we sync all external changes done to mailbox */ /* Make sure we write all our internal changes into the mailbox */ /* If it's not too much trouble, check if there are some changes */ /* Don't sync expunges from our view */ /* If mailbox is currently inconsistent, fix it instead of failing. */ unsigned int has_nuls:
1;
/* message data is known to contain NULs */ unsigned int has_no_nuls:
1;
/* -''- known to not contain NULs */ /* register all mail storages */ /* Register mail storage class with given name - all methods that are NULL are set to default methods */ /* Returns flags and lock_method based on environment settings. */ /* Create a new instance of registered mail storage class with given storage-specific data. If driver is NULL, it's tried to be autodetected from data. If data is NULL, it uses the first storage that exists. The storage is put into ns->storage. */ /* Set storage callback functions to use. */ /* name is allowed to contain multiple new hierarchy levels. If directory is TRUE, the mailbox should be created so that it can contain children. The mailbox itself doesn't have to be created as long as it shows in LIST. */ /* Returns the error message of last occurred error. */ /* Returns path to the given mailbox, or NULL if mailbox doesn't exist in filesystem. is_file_r is set to TRUE if returned path points to a file, and FALSE if it points to a directory. If name is "", the root storage directory is returned. */ /* Returns path to the control directory of the mailbox, or NULL if mailbox doesn't exist in filesystem. */ /* Returns path to the index directory of the mailbox, or NULL if using in-memory indexes or mailbox doesn't exist. */ /* Open a mailbox. If input stream is given, mailbox is opened read-only using it as a backend. If storage doesn't support stream backends and its tried to be used, NULL is returned. Note that append and copy may open the selected mailbox again with possibly different readonly-state. */ /* Close the box. Returns -1 if some cleanup errors occurred, but the mailbox was closed anyway. */ /* Returns storage of given mailbox */ /* Returns name of given mailbox */ /* Returns TRUE if mailbox is read-only. */ /* Returns TRUE if mailbox currently supports adding keywords. */ /* Gets the mailbox status information. */ /* Synchronize the mailbox. */ /* One-step mailbox synchronization. Use this if you don't care about /* Call given callback function when something changes in the mailbox. */ /* Return the number of active transactions for the mailbox. */ /* Build mail_keywords from NULL-terminated keywords list. Returns 0 if successful, -1 if there are invalid keywords (error is set). */ /* Like mailbox_keywords_create(), except ignore invalid keywords. */ /* Convert uid range to sequence range. */ /* Initialize header lookup for given headers. */ /* Initialize new search request. charset specifies the character set used in the search argument strings. If sort_program is non-NULL, the messages are returned in the requested order, otherwise from first to last. */ /* Deinitialize search request. */ /* Search the next message. Returns 1 if found, 0 if not, -1 if failure. */ /* Like mailbox_search_next(), but don't spend too much time searching. Returns 1 if found, -1 if failure or 0 with tryagain_r=FALSE if finished, and TRUE if more results will by calling the function again. */ /* Save a mail into mailbox. timezone_offset specifies the timezone in minutes in which received_date was originally given with. To use current time, set received_date to (time_t)-1. If dest_mail is set, the saved message can be accessed using it. Note that setting it may require mailbox syncing, so don't set it unless you need it. Also you shouldn't try to access it before mailbox_save_finish() is The given input stream is never read in these functions, only the data inside it is used. So you should call i_stream_read() yourself and then call mailbox_save_continue() whenever more data is read. /* Copy given message. If dest_mail is non-NULL, the copied message can be accessed using it. Note that setting it non-NULL may require mailbox syncing, so don't give give it unless you need it. */ /* Returns TRUE if mailbox is now in inconsistent state, meaning that the message IDs etc. may have changed - only way to recover this would be to fully close the mailbox and reopen it. With IMAP connection this would mean a forced disconnection since we can't /* Returns TRUE if successful, FALSE if message doesn't exist. mail_*() functions shouldn't be called if FALSE is returned. */ /* Returns message's flags */ /* Returns message's keywords */ /* Returns message's MIME parts */ /* Get the Date-header of the mail. Timezone is in minutes. date=0 if it wasn't found or it was invalid. */ /* Get the time when the mail was received (IMAP INTERNALDATE). */ /* Get the time when the mail was saved into this mailbox. This time may not always be entirely reliable. */ /* Get the space used by the mail as seen by the reader. Linefeeds are always counted as being CR+LF. */ /* Get the space used by the mail in disk. */ /* Get value for single header field, or NULL if header wasn't found. Returns 1 if header was found, 0 if not, -1 if error. */ /* Like mail_get_first_header(), but decode MIME encoded words to UTF-8 */ /* Return a NULL-terminated list of values for each found field. */ /* Like mail_get_headers(), but decode MIME encoded words to UTF-8 */ /* Returns stream containing specified headers. */ /* Returns input stream pointing to beginning of message header. hdr_size and body_size are updated unless they're NULL. */ /* Get any of the "special" fields. */ /* Update message flags. */ /* Update message keywords. */ /* Expunge this message. Sequence numbers don't change until commit. */