Commit 72bf0603 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

[bug] Previously, the third parameter fed to external program was the value of...

[bug] Previously, the third parameter fed to external program was the value of ``host`` parameter of the list, not mail domain: If ``host`` parameter was not the same as domain name, external program could fail.
Fixed by feeding mail domain instead of ``host`` value. And added [% list.host %] template variable to use ``host`` value in template.
Note that ``host`` parameter may be deprecated in the future (See issue #43).
parent 388b71d8
......@@ -40,13 +40,9 @@ sub add {
my $self = shift;
my $list = shift;
#FIXME: 'host' parameter is passed to the program: No 'domain'
# parameter to determine robot.
my $program = $self->{program};
system($program, 'add', $list->{'name'},
$list->{'admin'}{'host'},
($self->{file} ? ($self->{file}) : ())
);
system($program, 'add', $list->{'name'}, $list->{'domain'},
($self->{file} ? ($self->{file}) : ()));
if ($CHILD_ERROR & 127) {
$log->syslog('err', '%s was terminated by signal %d',
$program, $CHILD_ERROR & 127);
......@@ -66,13 +62,9 @@ sub del {
my $self = shift;
my $list = shift;
#FIXME: 'host' parameter is passed to the program: No 'domain'
# parameter to determine robot.
my $program = $self->{program};
system($program, 'del', $list->{'name'},
$list->{'admin'}{'host'},
($self->{file} ? ($self->{file}) : ())
);
system($program, 'del', $list->{'name'}, $list->{'domain'},
($self->{file} ? ($self->{file}) : ()));
if ($CHILD_ERROR & 127) {
$log->syslog('err', '%s was terminated by signal %d',
$program, $CHILD_ERROR & 127);
......@@ -180,7 +172,7 @@ See L<Sympa::Aliases::CheckSMTP>.
Invokes program with command line arguments:
/path/to/program add | del listname hostname [ file ]
/path/to/program add | del listname domain [ file ]
If processing succeed, program should exit with status 0.
Otherwise it may exit with non-zero status (see also L</"Constants">).
......
......@@ -53,6 +53,7 @@ sub _aliases {
'date' => $language->gettext_strftime('%d %b %Y', localtime time),
'list' => {
'domain' => $domain,
'host' => $list->{'admin'}{'host'},
'name' => $listname,
},
'robot' => $domain,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment