mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Support both smtpd_recipient_restrictions and smtpd_relay_restrictions, and fix labelling https://sourceforge.net/p/webadmin/bugs/4930/
This commit is contained in:
@@ -811,7 +811,8 @@ sasl_opts=SMTP security options
|
||||
sasl_noanonymous=Reject anonymous logins
|
||||
sasl_noplaintext=Reject plain-text logins
|
||||
opts_smtpd_delay_reject=Delay clients with failed logins?
|
||||
sasl_recip=SMTP relaying restrictions
|
||||
sasl_recip=SMTP recipient restrictions
|
||||
sasl_relay=SMTP recipient restrictions
|
||||
sasl_permit_mynetworks=Allow connections from same network
|
||||
sasl_permit_sasl_authenticated=Allow authenticated clients
|
||||
sasl_reject_unauth_destination=Reject email to other domains
|
||||
|
||||
@@ -28,7 +28,7 @@ foreach $o ("noanonymous", "noplaintext") {
|
||||
}
|
||||
print &ui_table_row($text{'sasl_opts'}, join("<br>\n", @cbs), 3);
|
||||
|
||||
# SASL-related relay restrictions
|
||||
# SASL-related recipient restrictions
|
||||
%recip = map { $_, 1 }
|
||||
split(/[\s,]+/, &get_current_value("smtpd_recipient_restrictions"));
|
||||
@cbs = ( );
|
||||
@@ -38,6 +38,16 @@ foreach $o (&list_smtpd_restrictions()) {
|
||||
}
|
||||
print &ui_table_row($text{'sasl_recip'}, join("<br>\n", @cbs), 3);
|
||||
|
||||
# SASL-relayed relay restrictions
|
||||
%relay = map { $_, 1 }
|
||||
split(/[\s,]+/, &get_current_value("smtpd_relay_restrictions"));
|
||||
@cbs = ( );
|
||||
foreach $o (&list_smtpd_restrictions()) {
|
||||
push(@cbs, &ui_checkbox("sasl_relay", $o, $text{'sasl_'.$o},
|
||||
$relay{$o}));
|
||||
}
|
||||
print &ui_table_row($text{'sasl_relay'}, join("<br>\n", @cbs), 3);
|
||||
|
||||
# Delay bad logins
|
||||
&option_yesno("smtpd_delay_reject");
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ if (!$in{'login_none'}) {
|
||||
@opts = split(/\0/, $in{'sasl_opts'});
|
||||
&set_current_value("smtpd_sasl_security_options", join(" ", @opts));
|
||||
|
||||
# Save relay options that we care about
|
||||
# Save recipient options that we care about
|
||||
@recip = split(/[\s,]+/, &get_current_value("smtpd_recipient_restrictions"));
|
||||
%newrecip = map { $_, 1 } split(/\0/, $in{'sasl_recip'});
|
||||
foreach $o (&list_smtpd_restrictions()) {
|
||||
@@ -46,6 +46,19 @@ foreach $o (&list_smtpd_restrictions()) {
|
||||
}
|
||||
&set_current_value("smtpd_recipient_restrictions", join(" ", @recip));
|
||||
|
||||
# Save relay options that we care about
|
||||
@relay = split(/[\s,]+/, &get_current_value("smtpd_relay_restrictions"));
|
||||
%newrelay = map { $_, 1 } split(/\0/, $in{'sasl_relay'});
|
||||
foreach $o (&list_smtpd_restrictions()) {
|
||||
if ($newrelay{$o}) {
|
||||
push(@relay, $o) if (&indexof($o, @relay) < 0);
|
||||
}
|
||||
else {
|
||||
@relay = grep { $_ ne $o } @relay;
|
||||
}
|
||||
}
|
||||
&set_current_value("smtpd_relay_restrictions", join(" ", @relay));
|
||||
|
||||
# Save SSL options
|
||||
if ($postfix_version >= 2.3) {
|
||||
&set_current_value("smtpd_tls_security_level",
|
||||
|
||||
Reference in New Issue
Block a user