From 7dc675fedb5b2631a8bafd0fb691eac485eff0af Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 4 Nov 2014 13:38:46 +0800 Subject: Bug 1092037: backport bug 1062739 to bmo (add the ability for administrators to limit the number of emails sent to a user per minute and hour) --- Bugzilla/Constants.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Bugzilla/Constants.pm') diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 37e995b81..6e0a9c7d3 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -208,6 +208,12 @@ use Memoize; AUDIT_CREATE AUDIT_REMOVE + + EMAIL_LIMIT_PER_MINUTE + EMAIL_LIMIT_PER_HOUR + EMAIL_LIMIT_EXCEPTION + + JOB_QUEUE_VIEW_MAX_JOBS ); @Bugzilla::Constants::EXPORT_OK = qw(contenttypes); @@ -632,6 +638,18 @@ use constant PRIVILEGES_REQUIRED_EMPOWERED => 3; use constant AUDIT_CREATE => '__create__'; use constant AUDIT_REMOVE => '__remove__'; +# The maximum number of emails per minute and hour a recipient can receive. +# Email will be queued/backlogged to avoid exceeeding these limits. +# Setting a limit to 0 will disable this feature. +use constant EMAIL_LIMIT_PER_MINUTE => 1000; +use constant EMAIL_LIMIT_PER_HOUR => 2500; +# Don't change this exception message. +use constant EMAIL_LIMIT_EXCEPTION => "email_limit_exceeded\n"; + +# The maximum number of jobs to show when viewing the job queue +# (view_job_queue.cgi). +use constant JOB_QUEUE_VIEW_MAX_JOBS => 2500; + sub bz_locations { # Force memoize() to re-compute data per project, to avoid # sharing the same data across different installations. -- cgit v1.2.3-24-g4f1b