summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config/Common.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Config/Common.pm')
-rw-r--r--Bugzilla/Config/Common.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 95866b032..6924761f3 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -34,6 +34,7 @@ package Bugzilla::Config::Common;
use strict;
+use Email::Address;
use Socket;
use Bugzilla::Util;
@@ -50,7 +51,7 @@ use base qw(Exporter);
check_user_verify_class
check_mail_delivery_method check_notification check_utf8
check_bug_status check_smtp_auth check_theschwartz_available
- check_maxattachmentsize
+ check_maxattachmentsize check_email
);
# Checking functions for the various values
@@ -94,6 +95,14 @@ sub check_regexp {
return $@;
}
+sub check_email {
+ my ($value) = @_;
+ if ($value !~ $Email::Address::mailbox) {
+ return "must be a valid email address.";
+ }
+ return "";
+}
+
sub check_sslbase {
my $url = shift;
if ($url ne '') {