diff --git a/backup-config/backup.pl b/backup-config/backup.pl index f6016efc7..587bdc166 100755 --- a/backup-config/backup.pl +++ b/backup-config/backup.pl @@ -5,7 +5,7 @@ use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; -our (%text, %config, $no_acl_check); +our (%text, %config, $no_acl_check, %gconfig); $no_acl_check++; require './backup-config-lib.pl'; &foreign_require("mailboxes", "mailboxes-lib.pl"); @@ -76,11 +76,10 @@ if (($err || $backup->{'emode'} == 0) && $backup->{'email'}) { $postmsg; $subject = &text('email_sok', $host); } - &mailboxes::send_text_mail($config{'from_addr'} || - &mailboxes::get_from_address(), - $backup->{'email'}, - undef, - $subject, - $msg); + &mailboxes::send_text_mail( + $config{'from_addr'} || &mailboxes::get_from_address(), + $backup->{'email'} eq '*' ? $gconfig{'webmin_email_to'} + : $backup->{'email'}, + undef, $subject, $msg); } diff --git a/backup-config/edit.cgi b/backup-config/edit.cgi index a36b111f0..b19330894 100755 --- a/backup-config/edit.cgi +++ b/backup-config/edit.cgi @@ -10,10 +10,11 @@ our (%in, %text, %gconfig); &ReadParse(); my $backup; +my $wet = $gconfig{'webmin_email_to'}; if ($in{'new'}) { &ui_print_header(undef, $text{'edit_title1'}, ""); $backup = { 'emode' => 0, - 'email' => $gconfig{'webmin_email_to'}, + 'email' => $wet ? '*' : undef, 'sched' => 1, 'configfile' => 1, 'nofiles' => 0, @@ -74,7 +75,10 @@ print &ui_hidden_table_start($text{'edit_header3'}, "width=100%", 2, # Show email address print &ui_table_row($text{'edit_email'}, - &ui_textbox("email", $backup->{'email'}, 40)); + $wet ? &ui_opt_textbox("email", + $backup->{'email'} eq '*' ? undef : $backup->{'email'}, + 40, &text('edit_email_def', "$wet")) + : &ui_textbox("email", $backup->{'email'}, 40)); # Show email mode print &ui_table_row($text{'edit_emode'}, diff --git a/backup-config/lang/en b/backup-config/lang/en index acf31d2b6..4fcdcb334 100644 --- a/backup-config/lang/en +++ b/backup-config/lang/en @@ -27,6 +27,7 @@ edit_header=Scheduled backup options edit_header2=Pre and post backup commands edit_header3=Backup schedule edit_email=Email result to address +edit_email_def=Webmin default ($1) edit_emode=When to send email edit_emode0=Always edit_emode1=Only when an error occurs diff --git a/backup-config/save.cgi b/backup-config/save.cgi index 8ec1e9cef..99fed51ac 100755 --- a/backup-config/save.cgi +++ b/backup-config/save.cgi @@ -36,7 +36,7 @@ else { $backup->{'dest'} = &parse_backup_destination("dest", \%in); &cron::parse_times_input($backup, \%in); $backup->{'emode'} = $in{'emode'}; - $backup->{'email'} = $in{'email'}; + $backup->{'email'} = $in{'email_def'} ? '*' : $in{'email'}; $backup->{'pre'} = $in{'pre'}; $backup->{'post'} = $in{'post'}; $backup->{'sched'} = $in{'sched'};