# HG changeset patch # User Timo Sirainen # Date 1200028029 -7200 # Node ID 740a17139b67f691b7609c80210e39b546ea4a50 # Parent ca223be145b5665d99ded240a1ea569db0cd5fc9 Added quota_exceeded_message setting. diff -r ca223be145b5 -r 740a17139b67 src/plugins/quota/quota-private.h --- 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; }; diff -r ca223be145b5 -r 740a17139b67 src/plugins/quota/quota-storage.c --- 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, diff -r ca223be145b5 -r 740a17139b67 src/plugins/quota/quota.c --- 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 #include +#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);