Respect global to address if set

This commit is contained in:
Jamie Cameron
2024-10-13 19:36:37 -07:00
parent cc0ab1bc8a
commit 5992c7ba51
2 changed files with 5 additions and 3 deletions

View File

@ -210,7 +210,8 @@ print &ui_table_row($text{'index_sched'},
# Send email to
print &ui_table_row($text{'index_email'},
&ui_textbox("email", $config{'sched_email'}, 40));
&ui_textbox("email", $config{'sched_email'} ||
$gconfig{'webmin_email_to'}, 40));
# Install or just notify?
print &ui_table_row($text{'index_action'},

View File

@ -56,12 +56,13 @@ if ($tellcount) {
}
# Email the admin
if ($config{'sched_email'} && $body) {
$emailto = $config{'sched_email'} || $gconfig{'webmin_email_to'};
if ($emailto && $body) {
&foreign_require("mailboxes", "mailboxes-lib.pl");
my $from = &mailboxes::get_from_address();
my $mail = { 'headers' =>
[ [ 'From', $from ],
[ 'To', $config{'sched_email'} ],
[ 'To', $emailto ],
[ 'Subject', "Package updates on ".
&get_system_hostname() ] ],
'attach' =>