#ifndef MAIL_ERROR_H
#define MAIL_ERROR_H
/* Some error strings that should be used everywhere to avoid
permissions checks from revealing mailbox's existence */
/* And just for making error strings consistent: */
/* Message to show to users when critical error occurs */
#define MAIL_ERRSTR_CRITICAL_MSG \
"Internal error occurred. Refer to server log for more information."
#define MAIL_ERRSTR_CRITICAL_MSG_STAMP \
MAIL_ERRSTR_CRITICAL_MSG " [%Y-%m-%d %H:%M:%S]"
enum mail_error {
MAIL_ERROR_NONE = 0,
/* Temporary internal error */
/* Temporary failure because a subsystem is down */
/* It's not possible to do the wanted operation */
/* Invalid parameters (eg. mailbox name not valid) */
/* No permission to do the request */
/* Out of disk quota for user */
/* Item (e.g. mailbox) doesn't exist or it's not visible to us */
/* Item (e.g. mailbox) already exists */
/* Tried to access an expunged message */
/* Operation cannot be done because another session prevents it
(e.g. lock timeout) */
/* Can't do the requested data conversion (e.g. IMAP BINARY's
UNKNOWN-CTE code) */
/* Can't do the requested data conversion because the original data
isn't valid. */
/* Operation ran against some kind of a limit. */
/* Operation couldn't be finished as efficiently as required by
mail.lookup_abort. */
};
/* Convert errno to mail_error and an error string. Returns TRUE if successful,
FALSE if we couldn't handle the errno. */
const char **error_string_r);
/* Build a helpful error message for a failed EACCES syscall. */
/* Build a helpful error message for a failed EACCES syscall that tried to
write to directory (create, rename, etc). */
#endif