Commit 569a5b3c authored by david.verdin's avatar david.verdin
Browse files

[svn] Retrieving latest bug fixes from the Sympa 6.0 stabilization branch.


git-svn-id: https://subversion.renater.fr/sympa/trunk@6025 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 4ab4bc68
......@@ -41,14 +41,6 @@ installdir:
chown $(USER) $(DESTDIR)$$dir || /bin/true; \
chgrp $(GROUP) $(DESTDIR)$$dir || /bin/true; \
done
@echo "Creating non-writable directories"
@for dir in create_list_templates mail_tt2 web_tt2 scenari \
task_models general_task_models; do \
if [ ! -d $(DESTDIR)$(sysconfdir)/sympa/$$dir ] ; then \
echo "Creating $(DESTDIR)$(sysconfdir)/sympa/$$dir"; \
install -d -m 755 $(DESTDIR)$(sysconfdir)/sympa/$$dir; \
fi \
done
installconfig:
@echo "Installing basic configuration ..."
......@@ -63,7 +55,7 @@ installconfig:
--create wwsympa.conf \
--target $(DESTDIR)$(confdir)/wwsympa.conf \
|| /bin/true; \
fi
fi; \
if [ ! -f $(DESTDIR)$(sysconfdir)/sympa/data_structure.version ]; then \
cd $(DESTDIR)$(sysconfdir)/sympa; \
echo "# automatically created file" >> data_structure.version; \
......
......@@ -48,7 +48,8 @@ if test -f /etc/sympa.conf; then
lockdir=$localstatedir/lock/subsys
modulesdir=$prefix/bin
scriptdir=$prefix/bin
defaultdir=$datadir/sympa/default
datadir=$prefix/default
defaultdir=$datadir
mailtemplatedir=$defaultdir/mail_tt2
webtemplatedir=$defaultdir/web_tt2
execcgidir=$prefix/bin
......
......@@ -158,6 +158,7 @@ my $fh = 'fh0000000000'; ## File handle for the stream.
my $messagekey; # the key of the current message in the message_table
my $messageasstring_init; # the current message as a string
my $messageasstring; # the transformed message.
my $last_check_date = 0;
my $timeout = $Conf::Conf{'bulk_wait_to_fork'};
my $last_check_date = time();
......@@ -250,7 +251,6 @@ while (!$end) {
my $return_path = $rcpt;
$return_path =~ s/\@/\=\=a\=\=/;
$return_path = "$Conf::Conf{'bounce_email_prefix'}+$return_path\=\=$bulk->{'listname'}\@$bulk->{'robot'}"; # xxxxxxxxxxxxx verp cassé si pas de listename (message de sympa)
#____ Test if use merge ______
if (1==1) { #-------- it will be : if ($bulk->{'merge'}) { ------------#
......
......@@ -1237,55 +1237,55 @@ sub purge_orphan_bounces {
my($task, $context) = @_;
do_log('info','purge_orphan_bounces()');
## Hash {'listname' => 'bounced address' => 1}
my %bounced_users;
my $all_lists;
unless ($all_lists = &List::get_lists('*')) {
&do_log('notice','No list available');
return 1;
}
foreach my $list (@$all_lists) {
my $listname = $list->{'name'};
## first time: loading DB entries into %bounced_users
for (my $user_ref = $list->get_first_bouncing_user(); $user_ref; $user_ref = $list->get_next_bouncing_user()){
my $user_id = $user_ref->{'email'};
$bounced_users{$listname}{$user_id} = 1;
}
## first time: loading DB entries into %bounced_users
for (my $user_ref = $list->get_first_bouncing_user(); $user_ref; $user_ref = $list->get_next_bouncing_user()){
my $user_id = $user_ref->{'email'};
$bounced_users{$listname}{$user_id} = 1;
}
my $bounce_dir = $list->get_bounce_dir();
unless (-d $bounce_dir) {
&do_log('notice', 'No bouncing subscribers in list %s', $listname);
next;
}
## then reading Bounce directory & compare with %bounced_users
unless (opendir(BOUNCE,$bounce_dir)) {
&do_log('err','Error while opening bounce directory %s',$bounce_dir);
return undef;
}
## Finally removing orphan files
foreach my $bounce (readdir(BOUNCE)) {
if ($bounce =~ /\@/){
unless (defined($bounced_users{$listname}{$bounce})) {
&do_log('info','removing orphan Bounce for user %s in list %s',$bounce,$listname);
unless (unlink($bounce_dir.'/'.$bounce)) {
&do_log('err','Error while removing file %s/%s', $bounce_dir, $bounce);
}
}
}
}
unless (-d $bounce_dir) {
&do_log('notice', 'No bouncing subscribers in list %s', $listname);
next;
}
## then reading Bounce directory & compare with %bounced_users
unless (opendir(BOUNCE,$bounce_dir)) {
&do_log('err','Error while opening bounce directory %s',$bounce_dir);
return undef;
}
## Finally removing orphan files
foreach my $bounce (readdir(BOUNCE)) {
if ($bounce =~ /\@/){
unless (defined($bounced_users{$listname}{$bounce})) {
&do_log('info','removing orphan Bounce for user %s in list %s',$bounce,$listname);
unless (unlink($bounce_dir.'/'.$bounce)) {
&do_log('err','Error while removing file %s/%s', $bounce_dir, $bounce);
}
}
}
}
closedir BOUNCE;
}
}
}
return 1;
}
sub expire_bounce {
......@@ -1534,35 +1534,35 @@ sub purge_orphan_bounces {
## Subroutine for bouncers evaluation:
# give a score for each bouncing user
sub eval_bouncers {
#################
my ($task, $context) = @_;
my $all_lists = &List::get_lists('*');
foreach my $list (@$all_lists) {
my $listname = $list->{'name'};
my $list_traffic = {};
&do_log('info','eval_bouncers(%s)',$listname);
## Analizing file Msg-count and fill %$list_traffic
unless (open(COUNT,$list->{'dir'}.'/msg_count')){
&do_log('debug','** Could not open msg_count FILE for list %s',$listname);
next;
}
while (<COUNT>) {
if ( /^(\w+)\s+(\d+)/) {
my ($a, $b) = ($1, $2);
$list_traffic->{$a} = $b;
}
}
sub eval_bouncers {
#################
my ($task, $context) = @_;
my $all_lists = &List::get_lists('*');
foreach my $list (@$all_lists) {
my $listname = $list->{'name'};
my $list_traffic = {};
&do_log('info','eval_bouncers(%s)',$listname);
## Analizing file Msg-count and fill %$list_traffic
unless (open(COUNT,$list->{'dir'}.'/msg_count')){
&do_log('debug','** Could not open msg_count FILE for list %s',$listname);
next;
}
while (<COUNT>) {
if ( /^(\w+)\s+(\d+)/) {
my ($a, $b) = ($1, $2);
$list_traffic->{$a} = $b;
}
}
close(COUNT);
#for each bouncing user
for (my $user_ref = $list->get_first_bouncing_user(); $user_ref; $user_ref = $list->get_next_bouncing_user()){
my $score = &get_score($user_ref,$list_traffic) || 0;
## copying score into DataBase
unless ($list->update_user($user_ref->{'email'},{'score' => $score }) ) {
&do_log('err','Task eval_bouncers :Error while updating DB for user %s',$user_ref->{'email'});
......@@ -1570,8 +1570,9 @@ sub purge_orphan_bounces {
}
}
}
return 1;
}
sub none {
1;
......
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