Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7147:740a17139b67 HEAD
Added quota_exceeded_message setting.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 11 Jan 2008 07:07:09 +0200 |
parents | ca223be145b5 |
children | 5e3188213724 |
files | src/plugins/quota/quota-private.h src/plugins/quota/quota-storage.c src/plugins/quota/quota.c |
diffstat | 3 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/quota/quota-private.h Fri Jan 11 05:49:34 2008 +0200 +++ b/src/plugins/quota/quota-private.h Fri Jan 11 07:07:09 2008 +0200 @@ -15,6 +15,7 @@ int (*test_alloc)(struct quota_transaction_context *ctx, uoff_t size, bool *too_large_r); + const char *quota_exceeded_msg; unsigned int debug:1; };
--- a/src/plugins/quota/quota-storage.c Fri Jan 11 05:49:34 2008 +0200 +++ b/src/plugins/quota/quota-storage.c Fri Jan 11 07:07:09 2008 +0200 @@ -150,7 +150,7 @@ return 0; else if (ret == 0) { mail_storage_set_error(t->box->storage, MAIL_ERROR_NOSPACE, - "Quota exceeded"); + qt->quota->quota_exceeded_msg); return -1; } else { mail_storage_set_critical(t->box->storage, @@ -214,7 +214,8 @@ ret = quota_test_alloc(qt, st->st_size, &too_large); if (ret == 0) { mail_storage_set_error(t->box->storage, - MAIL_ERROR_NOSPACE, "Quota exceeded"); + MAIL_ERROR_NOSPACE, + qt->quota->quota_exceeded_msg); return -1; } else if (ret < 0) { mail_storage_set_critical(t->box->storage,
--- a/src/plugins/quota/quota.c Fri Jan 11 05:49:34 2008 +0200 +++ b/src/plugins/quota/quota.c Fri Jan 11 07:07:09 2008 +0200 @@ -11,6 +11,7 @@ #include <stdlib.h> #include <sys/wait.h> +#define DEFAULT_QUOTA_EXCEEDED_MSG "Quota exceeded" #define RULE_NAME_ALL_MAILBOXES "*" struct quota_root_iter { @@ -46,6 +47,9 @@ quota = i_new(struct quota, 1); quota->test_alloc = quota_default_test_alloc; quota->debug = getenv("DEBUG") != NULL; + quota->quota_exceeded_msg = getenv("QUOTA_EXCEEDED_MESSAGE"); + if (quota->quota_exceeded_msg == NULL) + quota->quota_exceeded_msg = DEFAULT_QUOTA_EXCEEDED_MSG; i_array_init("a->roots, 4); i_array_init("a->storages, 8);