Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
959d0d72
Commit
959d0d72
authored
Oct 21, 2014
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1083737: Validate the smtpserver parameter
r=dkl a=glob
parent
bad9ac71
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
Common.pm
Bugzilla/Config/Common.pm
+14
-1
MTA.pm
Bugzilla/Config/MTA.pm
+2
-1
No files found.
Bugzilla/Config/Common.pm
View file @
959d0d72
...
...
@@ -23,7 +23,7 @@ use base qw(Exporter);
qw(check_multi check_numeric check_regexp check_url check_group
check_sslbase check_priority check_severity check_platform
check_opsys check_shadowdb check_urlbase check_webdotbase
check_user_verify_class check_ip
check_user_verify_class check_ip
check_smtp_server
check_mail_delivery_method check_notification check_utf8
check_bug_status check_smtp_auth check_theschwartz_available
check_maxattachmentsize check_email check_smtp_ssl
...
...
@@ -325,6 +325,19 @@ sub check_notification {
return
""
;
}
sub
check_smtp_server
{
my
$host
=
shift
;
my
$port
;
if
(
$host
=~
/:/
)
{
(
$host
,
$port
)
=
split
(
/:/
,
$host
,
2
);
unless
(
$port
&&
detaint_natural
(
$port
))
{
return
"Invalid port. It must be an integer (typically 25, 465 or 587)"
;
}
}
return
""
;
}
sub
check_smtp_auth
{
my
$username
=
shift
;
if
(
$username
and
!
Bugzilla
->
feature
(
'smtp_auth'
))
{
...
...
Bugzilla/Config/MTA.pm
View file @
959d0d72
...
...
@@ -49,7 +49,8 @@ sub get_param_list {
{
name
=>
'smtpserver'
,
type
=>
't'
,
default
=>
'localhost'
default
=>
'localhost'
,
checker
=>
\&
check_smtp_server
},
{
name
=>
'smtp_username'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment