Skip to content

Commit

Permalink
Fix multiple -r insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Jan 6, 2020
1 parent c0d1116 commit f0fd119
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/SASL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ sub actions {
$self->logsystem("touch $cf");
}
my $smtpdconf = read_file_lines($cf) or die "Failed to open $cf!";
my $idx = indexof("", @$smtpdconf);
my $idx = indexof("", @$smtpdconf);
if ($idx < 0) {
push(@$smtpdconf, "pwcheck_method: saslauthd");
push(@$smtpdconf, "mech_list: plain login");
Expand All @@ -136,7 +136,7 @@ sub actions {
if ($l =~ /^\s*FLAGS=\s*$/) {
$l = "FLAGS=\"-r\"";
}
elsif ($l =~ /^\s*FLAGS="(.*)"$/) {
elsif ($l =~ /^\s*FLAGS="(.*)"$/ && $l !~ /-r/) {
$l = "FLAGS=\"$1 -r\"";
}
}
Expand Down

0 comments on commit f0fd119

Please sign in to comment.