Commit 5811da54 authored by sikeda's avatar sikeda
Browse files

[svn] Retrieving recent modifications from sympa-6.1-branch.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@10199 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent bf37fa2a
......@@ -27,6 +27,7 @@ EXTRA_DIST = important_changes.pl \
sympa.spec.in \
sympa.spec \
README.charset
CLEANFILES = previous_sympa_version
install-data-hook: installdir installconfig nextstep importantchanges
......@@ -98,14 +99,12 @@ nextstep:
@echo "#######################################################"
importantchanges:
if [ -f $(DESTDIR)$(modulesdir)/Sympa/Constants.pm ]; then \
previous=`perl -Mlib=$(DESTDIR)$(modulesdir) -MSympa::Constants -e 'print Sympa::Constants::VERSION'`; \
elif [ -f $(DESTDIR)$(bindir)/Version.pm ]; then \
previous=`perl -Mlib=$(DESTDIR)$(bindir) -MVersion -e 'print $$Version::Version'`; \
if test -f $(top_srcdir)/previous_sympa_version; then \
export PREVIOUS=`$(CAT) $(top_srcdir)/previous_sympa_version`; \
fi; \
$(PERL) $(top_srcdir)/important_changes.pl \
--current=$(VERSION) \
--previous=$${previous};
$(PERL) $(top_srcdir)/important_changes.pl \
--current=$(VERSION) \
--previous=$${PREVIOUS};
uninstall-hook:
rm -f $(DESTDIR)$(confdir)/sympa.conf
......
......@@ -486,6 +486,28 @@ else
fi
AC_SUBST(NEWALIASES)
if test -n "$CAT"; then
# user-supplied value
AC_MSG_CHECKING([user-supplied cat command])
if test -f "$CAT"; then
:
else
AC_MSG_RESULT([non-existing])
AC_MSG_ERROR([invalid value $CAT for cat command])
fi
if test -x "$CAT"; then
:
else
AC_MSG_RESULT([non-executable])
AC_MSG_ERROR([invalid value $CAT for cat command])
fi
AC_MSG_RESULT([$CAT])
else
# default value
AC_PATH_PROG([CAT], [cat], [/bin/cat])
fi
AC_SUBST(CAT)
AC_MSG_CHECKING([argument to newaliases command])
NEWALIASES_ARG=
AC_ARG_WITH(
......
......@@ -39,6 +39,14 @@ EXTRA_DIST = Sympa/Constants.pm.in $(nobase_modules_DATA)
CLEANFILES = Sympa/Constants.pm
Sympa/Constants.pm: Sympa/Constants.pm.in Makefile
if [ -f $(DESTDIR)$(modulesdir)/Sympa/Constants.pm ]; then \
PREVIOUS=`$(PERL) -Mlib=$(DESTDIR)$(modulesdir) -MSympa::Constants -e 'print Sympa::Constants::VERSION'`; \
elif [ -f $(DESTDIR)$(bindir)/Version.pm ]; then \
PREVIOUS=`$(PERL) -Mlib=$(DESTDIR)$(bindir) -MVersion -e 'print $$Version::Version'`; \
else \
PREVIOUS=$(VERSION); \
fi; \
echo $${PREVIOUS} > $(top_srcdir)/previous_sympa_version;
[ -d Sympa ] || mkdir Sympa
rm -f $@
$(AM_V_GEN)$(SED) \
......
......@@ -756,6 +756,12 @@ sub verify {
}
$value = \@types;
}elsif ($value =~ /\[msg\-\>(\w+)\]/i) {
return -1 * $negation unless (defined ($context->{'message'}));
my $message_field = $1;
return -1 * $negation unless (defined ($context->{'message'}{$message_field}));
$value = $context->{'message'}{$message_field};
}elsif ($value =~ /\[current_date\]/i) {
my $time = time;
$value =~ s/\[current_date\]/$time/;
......
......@@ -518,7 +518,12 @@ sub create_list{
close INFO;
## Create associated files if a template was given.
for my $file ('message.footer','message.header','message.footer.mime','message.header.mime','info') {
my @files_to_parse;
foreach my $file (split ',',Conf::get_robot_conf($robot,'parsed_family_files')) {
$file =~ s{\s}{}g;
push @files_to_parse,$file;
}
for my $file (@files_to_parse) {
my $template_file = &tools::get_filename('etc',{},$file.".tt2", $robot,$family);
if (defined $template_file) {
my $file_content;
......@@ -672,7 +677,12 @@ sub update_list{
$list->{'admin'}{'family_name'} = $family->{'name'};
## Create associated files if a template was given.
for my $file ('message.footer','message.header','message.footer.mime','message.header.mime','info') {
my @files_to_parse;
foreach my $file (split ',',Conf::get_robot_conf($robot,'parsed_family_files')) {
$file =~ s{\s}{}g;
push @files_to_parse,$file;
}
for my $file (@files_to_parse) {
my $template_file = &tools::get_filename('etc',{},$file.".tt2", $robot,$family);
if (defined $template_file) {
my $file_content;
......
......@@ -1069,6 +1069,14 @@ our @params = (
'vhost' => '1',
},
{
'name' => 'parsed_family_files',
'query' => gettext('comma-separated list of files that will be parsed by Sympa when instantiating a family (no space allowed in file names)'),
'file' => 'sympa.conf',
'default' => 'message.footer,message.header,message.footer.mime,message.header.mime,info',
'vhost' => '1',
},
{ 'title' => gettext('Database related') },
{
......
......@@ -104,7 +104,8 @@ Options:
--log_level=LEVEL : sets Sympa log level
--lowercase : lowercase email addresses in database
--mail : log calls to sendmail
--make_alias_file : create file in /tmp with all aliases (usefull when aliases.tpl is changed)
--make_alias_file [--robot=robot_name,...]
: create file in /tmp with all aliases (usefull when aliases.tpl is changed)
--md5_digest=password : output a MD5 digest of a password (usefull for SOAP client trusted application)
--md5_encode_password : rewrite password in database using md5 fingerprint. YOU CAN'T UNDO unless you save this table first
--modify_list=family_name --robot=robot_name --input_file=/path/to/file.xml
......@@ -432,19 +433,78 @@ if ($main::options{'dump'}) {
print $usage_string;
exit 0;
}elsif ($main::options{'make_alias_file'}) {
my $all_lists = &List::get_lists('*');
unless (open TMP, ">$Conf{'tmpdir'}/sympa_aliases.$$") {
printf STDERR "Unable to create $Conf{'tmpdir'}/sympa_aliases.$$, exiting\n";
exit;
}
printf TMP "#\n#\tAliases for all Sympa lists open (but not for robots)\n#\n";
close TMP;
foreach my $list (@$all_lists) {
system ("$Conf{'alias_manager'} add $list->{'name'} $list->{'domain'} $Conf{'tmpdir'}/sympa_aliases.$$") if ($list->{'admin'}{'status'} eq 'open');
}
printf ("Sympa aliases file is $Conf{'tmpdir'}/sympa_aliases.$$ file made, you probably need to installed it in your SMTP engine\n");
exit 0;
my $robots = $main::options{'robot'} || '*';
my @robots;
if ($robots eq '*') {
@robots = List::get_robots();
} else {
@robots = grep { length $_ } split(/[\s,]+/, $robots);
}
exit 0 unless @robots;
# There may be multiple aliases files. Give each of them suffixed
# name.
my ($basename, %robots_of, %sympa_aliases);
$basename = sprintf '%s/sympa_aliases.%s', $Conf::Conf{'tmpdir'}, $$;
foreach my $robot (@robots) {
my $file = Conf::get_robot_conf($robot, 'sendmail_aliases');
$robots_of{$file} ||= [];
push @{$robots_of{$file}}, $robot;
}
if (1 < scalar(keys %robots_of)) {
my $i = 0;
%sympa_aliases = map {
$i++;
map { $_ => sprintf('%s.%03d', $basename, $i) }
@{$robots_of{$_}}
} sort keys %robots_of;
} else {
%sympa_aliases = map { $_ => $basename } @robots;
}
# Create files.
foreach my $sympa_aliases (values %sympa_aliases) {
my $fh;
unless (open $fh, '>', $sympa_aliases) { # truncate if exists
printf STDERR "Unable to create %s: %s\n", $sympa_aliases, $!;
exit 1;
}
close $fh;
}
# Write files.
foreach my $robot (sort @robots) {
my $all_lists = List::get_lists($robot);
my $alias_manager = Conf::get_robot_conf($robot, 'alias_manager');
my $sympa_aliases = $sympa_aliases{$robot};
my $fh;
unless (open $fh, '>>', $sympa_aliases) { # append
printf STDERR "Unable to create %s: %s\n", $sympa_aliases, $!;
exit 1;
}
printf $fh "#\n#\tAliases for all Sympa lists open on %s\n#\n",
$robot;
close $fh;
foreach my $list (@{$all_lists || []}) {
next unless $list->{'admin'}{'status'} eq 'open';
system($alias_manager, 'add', $list->{'name'},
$list->{'domain'}, $sympa_aliases);
}
}
if (1 < scalar(keys %robots_of)) {
printf
"Sympa aliases files %s.??? were made. You probably need to install them in your SMTP engine.\n",
$basename;
} else {
printf
"Sympa aliases file %s was made. You probably need to install it in your SMTP engine.\n",
$basename;
}
exit 0;
}elsif ($main::options{'version'}) {
print $version_string;
......
......@@ -501,8 +501,10 @@ sub check_cpan {
mandatory => 1,
usage => 'used to parse or build mailboxes in message headers',
},
'Mail::DKIM' => {
required_version => '0.36',
# Mail::DKIM::Signer is included in Mail-DKIM.
# Mail::DKIM::TextWrap is included in Mail-DKIM.
'Mail::DKIM::Verifier' => {
required_version => '0.39',
package_name => 'Mail-DKIM',
usage => 'required in order to use DKIM features (both for signature verification and signature insertion)',
},
......
......@@ -55,7 +55,7 @@ encryption.
--libdir=%{_libdir} \
--sysconfdir=%{_sysconfdir} \
--localstatedir=%{_localstatedir}
make
make DESTDIR=%{buildroot}
%install
rm -rf %{buildroot}
......
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