Handle case where mime_header_checks is not set

https://forum.virtualmin.com/t/double-header-checks/133851/8
This commit is contained in:
Jamie Cameron
2025-06-23 16:52:26 -07:00
parent 70589cf88a
commit 1607a59239
2 changed files with 7 additions and 2 deletions

View File

@ -27,7 +27,8 @@ print &ui_form_end([ [ undef, $text{'opts_save'} ] ]);
# Header map contents
print &ui_hr();
if (&get_real_value("header_checks") eq "") {
my $hc = &get_real_value("mime_header_checks");
if ($hc eq "") {
print $text{'opts_header_checks_no_map'},"<p>\n";
} else {
&generate_map_edit("header_checks", $text{'map_click'}." ".
@ -37,8 +38,11 @@ if (&get_real_value("header_checks") eq "") {
# MIME header map contents
print &ui_hr();
if (&get_real_value("mime_header_checks") eq "") {
my $mhc = &get_real_value("mime_header_checks");
if ($mhc eq "") {
print $text{'opts_mime_header_checks_no_map'},"<p>\n";
} elsif ($mhc eq $hc) {
print $text{'opts_mime_header_checks_same_map'},"<p>\n";
} else {
&generate_map_edit("mime_header_checks", $text{'map_click'}." ".
&hlink($text{'help_map_format'}, "header"), 1,

View File

@ -654,6 +654,7 @@ opts_header_checks=Header checking tables
opts_mime_header_checks=MIME header checking tables
opts_header_checks_no_map=(No header checking map is currently defined. Define a map first, then you can edit it)
opts_mime_header_checks_no_map=(No MIME header checking map is currently defined. Define a map first, then you can edit it)
opts_mime_header_checks_same_map=(MIME header checks are the same as regular header checks. Define a different map first, then you can edit it)
header_name=Regular expression
header_value=Action for matches
header_discard=Discard (with log message..)