Add fields for real name for default destination

This commit is contained in:
Jamie Cameron
2026-08-19 17:29:47 -07:00
parent 0771c6bcd3
commit 508a7e3eab
2 changed files with 10 additions and 2 deletions

View File

@@ -71,8 +71,14 @@ print &ui_table_row($text{'sendmail_from'},
# Default to address for notifications
$to = $gconfig{'webmin_email_to'};
$to_name = $gconfig{'webmin_email_to_name'};
print &ui_table_row($text{'sendmail_toaddr'},
&ui_opt_textbox("to", $to, 40, $text{'sendmail_to_def'}));
&ui_radio_table("to_def", $to ? 0 : 1,
[ [ 1, "", $text{'sendmail_to_def'} ],
[ 0, "", $text{'sendmail_fromaddr'}." ".
&ui_textbox("to", $to, 40)."<br>\n".
$text{'sendmail_name'}." ".
&ui_textbox("to_name", $to_name, 40) ] ]), 3);
# URL for use in emails
$url = $gconfig{'webmin_email_url'};

View File

@@ -70,9 +70,11 @@ if ($in{'to_def'}) {
delete($gconfig{'webmin_email_to'});
}
else {
$in{'to'} =~ /^\S+$/ || &error($text{'sendmail_etoaddr'});
$in{'to'} =~ /^\S+$/ ||
&error($text{'sendmail_etoaddr'});
$gconfig{'webmin_email_to'} = $in{'to'};
}
$gconfig{'webmin_email_to_name'} = $in{'to_name'};
# Save URL for use in email
if ($in{'url_def'}) {