Respect global default destination address if set

This commit is contained in:
Jamie Cameron
2024-10-13 19:20:39 -07:00
parent d1cc0c4790
commit cc0ab1bc8a
3 changed files with 17 additions and 9 deletions

View File

@ -51,9 +51,12 @@ print &ui_table_row($text{'sched_warn'},
[ 2, $text{'sched_warn2'} ] ]), 3);
# Send email to
$defmsg = $gconfig{'webmin_email_to'} ?
&text('sched_email_def', "<tt>$gconfig{'webmin_email_to'}</tt>") :
$text{'sched_none'};
print &ui_table_row($text{'sched_email'},
&ui_opt_textbox("email", $config{'sched_email'}, 30,
$text{'sched_none'}, $text{'sched_email'}), 3);
$defmsg, $text{'sched_email'}), 3);
# From: address
print &ui_table_row($text{'sched_from'},

View File

@ -151,6 +151,7 @@ sched_title=Scheduled Monitoring
sched_header=Scheduled background monitoring options
sched_mode=Scheduled checking enabled?
sched_email=Email status report to
sched_email_def=System default ($1)
sched_pager=Page status report to number
sched_none=Don't send email
sched_pnone=Don't send pages

View File

@ -220,9 +220,12 @@ foreach $serv (@services) {
$email .= $thisemail;
if ($config{'sched_single'} && $email) {
# Force the sending of one email and page per report
&send_status_email($email,
$config{'subject_mode'} ? $subj : &text('monitor_sub', $subj),
$config{'sched_email'});
&send_status_email(
$email,
$config{'subject_mode'} ? $subj :
&text('monitor_sub', $subj),
$config{'sched_email'} ||
$gconfig{'webmin_email_to'});
undef($email);
if ($pager_msg) {
&send_status_pager($pager_msg);
@ -274,11 +277,12 @@ foreach $serv (@services) {
# Send the email and page with all messages, if necessary
if ($ecount && !$config{'sched_single'}) {
&send_status_email($email,
$config{'subject_mode'} ? $text{'monitor_sub2'} :
$ecount == 1 ? &text('monitor_sub', $subj) :
&text('monitor_sub3', $ecount),
$config{'sched_email'});
&send_status_email(
$email,
$config{'subject_mode'} ? $text{'monitor_sub2'} :
$ecount == 1 ? &text('monitor_sub', $subj) :
&text('monitor_sub3', $ecount),
$config{'sched_email'} || $gconfig{'webmin_email_to'});
}
if ($pager_msg && !$config{'sched_single'}) {
&send_status_pager($pager_msg);