mirror of
https://github.com/webmin/webmin.git
synced 2026-09-17 11:00:42 +01:00
Allow setting of SMTP port
This commit is contained in:
@@ -20,11 +20,14 @@ print &ui_table_row($text{'sendmail_system'},
|
||||
$smtp = $mconfig{'send_mode'};
|
||||
$mode = $smtp eq "" ? 0 :
|
||||
$smtp eq "localhost" || $smtp eq "127.0.0.1" ? 1 : 2;
|
||||
$port = ($mode == 2 ? $mconfig{'smtp_port'} : undef) || 25;
|
||||
print &ui_table_row($text{'sendmail_smtp'},
|
||||
&ui_radio("mode", $mode, [ [ 0, $text{'sendmail_smtp0'}."<br>" ],
|
||||
[ 1, $text{'sendmail_smtp1'}."<br>" ],
|
||||
[ 2, $text{'sendmail_smtp2'} ] ]).
|
||||
" ".&ui_textbox("smtp", $mode == 2 ? $smtp : "", 40));
|
||||
" ".&ui_textbox("smtp", $mode == 2 ? $smtp : "", 40).
|
||||
" ".$text{'sendmail_port'}.
|
||||
" ".&ui_textbox("port", $port, 6));
|
||||
|
||||
# SMTP login and password
|
||||
$user = $mconfig{'smtp_user'};
|
||||
|
||||
@@ -949,6 +949,7 @@ sendmail_desc=This page controls how Webmin sends email, such as from scheduled
|
||||
sendmail_header=Mail sending options
|
||||
sendmail_system=Local mail server
|
||||
sendmail_smtp=Send email using
|
||||
sendmail_port=on port
|
||||
sendmail_smtp0=Local mail server command
|
||||
sendmail_smtp1=Via SMTP to local mail server
|
||||
sendmail_smtp2=Via SMTP to remote mail server
|
||||
@@ -962,6 +963,7 @@ sendmail_fromdef=Default ($1)
|
||||
sendmail_fromaddr=Address
|
||||
sendmail_err=Failed to save mail sending options
|
||||
sendmail_esmtp=Missing or un-resolvable SMTP server hostname
|
||||
sendmail_eport=Missing or non-numeric SMTP port
|
||||
sendmail_elogin=Missing SMTP server login
|
||||
sendmail_esasl=SMTP authentication cannot be enabled unless the <a href=$1>$2</a> Perl module is installed.
|
||||
sendmail_efrom=Missing or incorrectly formatted from address
|
||||
|
||||
@@ -19,6 +19,13 @@ else {
|
||||
&to_ipaddress($in{'smtp'}) || &to_ip6address($in{'smtp'}) ||
|
||||
&error($text{'sendmail_esmtp'});
|
||||
$mconfig{'send_mode'} = $in{'smtp'};
|
||||
$in{'port'} =~ /^\d+$/ || &error($text{'sendmail_eport'});
|
||||
if ($in{'port'} == 25) {
|
||||
delete($mconfig{'smtp_port'});
|
||||
}
|
||||
else {
|
||||
$mconfig{'smtp_port'} = $in{'port'};
|
||||
}
|
||||
}
|
||||
|
||||
# Save login and password
|
||||
|
||||
Reference in New Issue
Block a user