mail-error.h revision 306b3f41b05da642d87e7ca7a1496efce9f5902f
#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 */
#define MAIL_ERRSTR_MAILBOX_NOT_FOUND "Mailbox doesn't exist: %s"
#define MAIL_ERRSTR_NO_PERMISSION "Permission denied"
/* And just for making error strings consistent: */
#define MAIL_ERRSTR_NO_SPACE "Not enough disk space"
#define MAIL_ERRSTR_LOCK_TIMEOUT "Timeout while waiting for lock"
/* 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]"
#define T_MAIL_ERR_MAILBOX_NOT_FOUND(name) \
enum mail_error {
MAIL_ERROR_NONE = 0,
/* Temporary internal error */
/* 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 space or quota */
/* 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) */
};
/* 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