Skip to content

Commit

Permalink
Merge pull request #1061 from racke/pr/fix-invalid-aliases-program-me…
Browse files Browse the repository at this point in the history
…ssage by racke & ikedas

Skip execution of aliases_program in newaliases script if value is "none"
  • Loading branch information
ikedas authored Jan 23, 2021
2 parents e719dc4 + 14ed890 commit 3392c83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/Sympa/Config/Schema.pm
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,12 @@ our %pinfo = (
context => [qw(domain site)],
order => 4.04,
group => 'mta',
format => 'makemap|newaliases|postalias|postmap|/.+',
format => 'makemap|newaliases|postalias|postmap|/.+|none',
default => 'newaliases',
gettext_id => 'Program used to update alias database',
gettext_comment =>
'This may be "makemap", "newaliases", "postalias", "postmap" or full path to custom program.',
# Option "none" was added on 6.2.61b
},
aliases_wrapper => {
context => [qw(domain site)],
Expand Down
3 changes: 3 additions & 0 deletions src/sbin/sympa_newaliases.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ if ($aliases_program =~ m{\A/}) {
q{--POSTMAP--}, $aliases_db_type, $aliases_file);

exec q{--POSTMAP--}, "$aliases_db_type:$aliases_file";
} elsif ($aliases_program eq 'none') {
$log->syslog('debug2', 'Skipping execution of aliases_program');
exit 0;
} else {
$log->syslog('err', 'Invalid aliases_program "%s"', $aliases_program);
exit 1;
Expand Down

0 comments on commit 3392c83

Please sign in to comment.