Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
472a09ba
Unverified
Commit
472a09ba
authored
Feb 02, 2021
by
IKEDA Soji
Committed by
GitHub
Feb 02, 2021
Browse files
Merge pull request #1084 from ikedas/make_alias_template by ikedas
Fix and speed up make_alias_file Sympa command (#1046)
parents
13af5d06
de50a625
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Aliases.pm
View file @
472a09ba
...
...
@@ -211,6 +211,11 @@ Use a subclass C<Sympa::Aliases::I<name>> to manage aliases.
For invalid types returns C<undef>.
Note:
For compatibility to the earlier versions of Sympa,
if a string C<SBINDIR/alias_manager.pl> was given as $type,
L<Sympa::Aliases::Template> subclass will be used.
Optional C<I<key> =E<gt> I<value>> pairs are included in the instance as
hash entries.
...
...
src/sbin/sympa.pl.in
View file @
472a09ba
...
...
@@ -40,6 +40,7 @@ use Pod::Usage;
use
POSIX
qw()
;
use
Sympa
;
use
Sympa::
Aliases
;
use
Conf
;
use
Sympa::
Constants
;
use
Sympa::
DatabaseManager
;
...
...
@@ -435,6 +436,8 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
foreach
my
$robot
(
@robots
)
{
my
$file
=
Conf::
get_robot_conf
(
$robot
,
'
sendmail_aliases
');
next
if
$file
eq
'
none
';
$robots_of
{
$file
}
||=
[]
;
push
@
{
$robots_of
{
$file
}},
$robot
;
}
...
...
@@ -460,10 +463,14 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
# Write files.
foreach
my
$robot
(
sort
@robots
)
{
my
$all_lists
=
Sympa::List::
get_lists
(
$robot
);
my
$alias_manager
=
Conf::
get_robot_conf
(
$robot
,
'
alias_manager
');
my
$sympa_aliases
=
$sympa_aliases
{
$robot
};
my
$aliases
=
Sympa::
Aliases
->
new
(
$alias_manager
,
file
=>
$sympa_aliases
);
next
unless
$aliases
and
$aliases
->
isa
('
Sympa::Aliases::Template
');
my
$fh
;
unless
(
open
$fh
,
'
>>
',
$sympa_aliases
)
{
# append
printf
STDERR
"
Unable to create %s: %s
\n
",
$sympa_aliases
,
$ERRNO
;
...
...
@@ -472,11 +479,12 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
printf
$fh
"
#
\n
#
\t
Aliases for all Sympa lists open on %s
\n
#
\n
",
$robot
;
close
$fh
;
my
$all_lists
=
Sympa::List::
get_lists
(
$robot
);
foreach
my
$list
(
@
{
$all_lists
||
[]
})
{
next
unless
$list
->
{'
admin
'}{'
status
'}
eq
'
open
';
system
(
$alias_manager
,
'
add
',
$list
->
{'
name
'},
$list
->
{'
domain
'},
$sympa_aliases
);
$aliases
->
add
(
$list
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment