diff --git a/.github/workflows/submit-pr-for-release-notes.yml b/.github/workflows/submit-pr-for-release-notes.yml index 0a0633c29..6d96a614b 100644 --- a/.github/workflows/submit-pr-for-release-notes.yml +++ b/.github/workflows/submit-pr-for-release-notes.yml @@ -5,7 +5,7 @@ on: env: GH_PR_BODY: 'This pull request is a workplace for editing release notes `NEWS.md`.' - GH_PR_LABEL: on going,ignore-for-release + GH_PR_LABEL: ready,ignore-for-release GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: diff --git a/.github/workflows/submit-pr-for-translation.yml b/.github/workflows/submit-pr-for-translation.yml index d816783fe..22ba7a498 100644 --- a/.github/workflows/submit-pr-for-translation.yml +++ b/.github/workflows/submit-pr-for-translation.yml @@ -8,7 +8,7 @@ on: env: GH_PR_TITLE: Update translation GH_PR_BODY: This pull request was automatically submitted. - GH_PR_LABEL: translation,on going,ignore-for-release + GH_PR_LABEL: translation,ready,ignore-for-release GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: diff --git a/cpanfile b/cpanfile index 3062244eb..b1ddd0b3e 100644 --- a/cpanfile +++ b/cpanfile @@ -147,6 +147,9 @@ requires 'Text::LineFold', '>= 2018.012'; # Used to get time with sub-second precision requires 'Time::HiRes', '>= 1.29'; +# Used to get Unix time from local time +requires 'Time::Local', '>= 1.23'; + # Used to create URI containing non URI-canonical characters. # Note: '3.28' is the version included in URI-1.35. requires 'URI::Escape', '>= 3.28'; diff --git a/default/mail_tt2/report.tt2 b/default/mail_tt2/report.tt2 index c8055e848..c89550b44 100644 --- a/default/mail_tt2/report.tt2 +++ b/default/mail_tt2/report.tt2 @@ -266,9 +266,6 @@ [%~ ELSIF report_entry == 'auth_msg_failed' ~%] [%|loc(report_param.key)%]Unable to access the message authenticated with key %1[%END%] -[%~ ELSIF report_entry == 'no_identified_user' ~%] - [%|loc%]Failed to get your email address from the authentication service.[%END%] - [%~ ELSIF report_entry == 'db_error' ~%] [%|loc%]Database error.[%END%] @@ -334,7 +331,13 @@ [%~ END %] [%~ ELSIF report_entry == 'add_performed' ~%] -[%|loc(report_param.total)%]%1 subscribers added[%END%] + [% IF report_param.role == 'owner' ~%] + [%|loc(report_param.total)%]%1 owners added[%END%] + [%~ ELSIF report_param.role == 'editor' ~%] + [%|loc(report_param.total)%]%1 moderators added[%END%] + [%~ ELSE ~%] + [%|loc(report_param.total)%]%1 subscribers added[%END%] + [%~ END %] [%~ ELSIF report_entry == 'updated_info' ~%] [%|loc(report_param.email,report_param.listname)%]Information regarding user %1 has been updated for list %2.[%END%] @@ -955,6 +958,9 @@ Warning: this message may already have been sent by one of the list's moderators [%~ ELSIF report_entry == 'cannot_get_privilege' ~%] [%|loc()%]You are not allowed to get the privilege of this user.[%END%] +[%~ ELSIF report_entry == 'no_identified_user' ~%] + [%|loc%]Failed to get your email address from the authentication service.[%END%] + [%~ END ~%] [%~ END ~%] diff --git a/default/scenari/send.publickey b/default/scenari/send.publickey index d20667417..cb92118c8 100644 --- a/default/scenari/send.publickey +++ b/default/scenari/send.publickey @@ -1,4 +1,4 @@ -title.gettext anyone no authentication if DKIM signature is OK +title.gettext need authentication true() smtp -> request_auth true() md5,smime -> do_it diff --git a/default/web_tt2/nav.tt2 b/default/web_tt2/nav.tt2 index ccdb516e7..0562373ce 100644 --- a/default/web_tt2/nav.tt2 +++ b/default/web_tt2/nav.tt2 @@ -87,10 +87,6 @@
  • [%|loc%]Archives[%END%]
  • - [% IF subaction == 'logs' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %] -
  • - [%|loc%]System log[%END%] -
  • [% IF subaction == 'templates' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
  • [%|loc%]Templates[%END%] @@ -133,6 +129,18 @@ [%|loc%]Families[%END%]
  • [% END %] + + [% IF subaction == 'stats' %] + [% SET class = 'active' %] + [% ELSE %] + [% SET class = '' %] + [% END %] +
  • + + [%|loc%]Statistics[%END%] + +
  • + [% IF subaction == 'translation' %] [% SET class = 'active' %] [% ELSE %] diff --git a/default/web_tt2/serveradmin.tt2 b/default/web_tt2/serveradmin.tt2 index 360902b40..e12039b67 100644 --- a/default/web_tt2/serveradmin.tt2 +++ b/default/web_tt2/serveradmin.tt2 @@ -160,28 +160,6 @@ [% END %] -[% IF subaction == 'logs' %] -

    [%|loc%]System log[%END%]

    -

    [%|loc%]Sympa log level[%END%]

    -

    [%|loc%]Set debug level for logs written to disk. This setting is temporary, applying only for the lifetime of the fastcgi session hosting this interface.[%END%]

    -
    -
    - [%|loc%]Log level:[%END%] - - - - - - - - - - - -
    -
    -[% END %] - [% IF subaction == 'templates' %]

    [%|loc%]Templates[%END%]

    @@ -277,6 +255,15 @@ [% close_table %] [% END %] + +[% IF subaction == 'stats' ~%] +

    [%|loc(domain)%]Virtual domain %1 statistics[%END%]

    +

    [%|loc%]This page displays overall information regarding the activity on this virtual domain.[%END%]

    +
    + [% PROCESS stats.tt2 %] +
    +[%~ END %] + [% IF subaction == 'translation' %]

    [%|loc%]Translating Sympa[%END%]

    [%|loc%]Sympa is designed to allow easy internationalization of its user interface (service email messages and web interface). All translations for a language are gathered into a single PO file that can be manipulated by the standard GNU gettext tools.[%END%]

    @@ -288,12 +275,4 @@

    [%|loc%]You can submit a problem or request a new feature: [%END%]https://github.com/sympa-community/sympa/issues/new/choose

    [% END %] - -[% IF subaction == 'logs' %] - [% IF loop_count %] -

    - [%|loc(process_id,loop_count,start_time)%]This FastCGI process (%1) has served %2 pages since %3.[%END%] -

    - [% END %] -[% END %] diff --git a/default/web_tt2/stats.tt2 b/default/web_tt2/stats.tt2 index 1fbbd2a36..d2db5496a 100644 --- a/default/web_tt2/stats.tt2 +++ b/default/web_tt2/stats.tt2 @@ -1,12 +1,14 @@ -

    [%|loc(listname)%]List %1 statistics[%END%]

    +[% IF listconf ~%] +

    [%|loc(listname)%]List %1 statistics[%END%]

    -

    [%|loc%]This page displays overall information regarding the list activity[%END%]

    +

    [%|loc%]This page displays overall information regarding the list activity[%END%]

    [%|loc(shared_size)%]Shared document directory size: %1 kB[%END%]
    [%|loc(arc_size)%]Web archives size: %1 kB[%END%]

    +[%~ END %] [% FOREACH stat_id IN [ 'send_mail', 'add_or_subscribe', 'signoff', 'del', 'auto_del' ] ~%] [% SET o = stats.$stat_id ~%] @@ -37,6 +39,9 @@ } }, yaxis: { + [% IF o.max_value && o.max_value < 10 ~%] + ticks: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + [% END ~%] tickOptions: { angle: 0, formatString: '%d' diff --git a/doc/auth.conf.pod b/doc/auth.conf.pod index dcaae10f3..351fa69a4 100644 --- a/doc/auth.conf.pod +++ b/doc/auth.conf.pod @@ -439,8 +439,8 @@ paragraph may also be used for C. Note that Sympa will act as a CAS client to validate CAS tickets. During this exchange, Sympa will check the CAS server X.509 certificate. Therefore you should ensure that the certificate authority of the CAS server is known by -Sympa ; this should be configured through the L -or L F configuration parameters. +Sympa ; this should be configured through the L +or L|sympa_config(5)/capath> F configuration parameter. =over diff --git a/doc/charset.conf.pod b/doc/charset.conf.pod index fc9c95444..a3c9903ec 100644 --- a/doc/charset.conf.pod +++ b/doc/charset.conf.pod @@ -17,8 +17,9 @@ directory: # cp $DEFAULTDIR/charset.conf $SYSCONFDIR/charset.conf -And set the C parameter value in -L|sympa.conf(5)> to C. +And set the +L|sympa_config(5)/legacy_character_support_feature> +parameter value in F to C. =head2 Note @@ -42,7 +43,7 @@ Configuration file. =head1 SEE ALSO -L. +L. =head1 HISTORY diff --git a/doc/ldap_alias_manager.conf.pod b/doc/ldap_alias_manager.conf.pod index e20004c25..7f782a495 100644 --- a/doc/ldap_alias_manager.conf.pod +++ b/doc/ldap_alias_manager.conf.pod @@ -9,7 +9,7 @@ ldap_alias_manager.conf - Configuration of LDAP alias management F is used by the L; it allows one to manage mail aliases in an LDAP directory. To make sympa use the ldap_alias_manager.pl script, you should edit the -'alias_manager' L parameter. +L|sympa_config(5)/alias_manager> F parameter. Format of F is as following: diff --git a/doc/nrcpt_by_domain.conf.pod b/doc/nrcpt_by_domain.conf.pod index e7f502619..c010e183b 100644 --- a/doc/nrcpt_by_domain.conf.pod +++ b/doc/nrcpt_by_domain.conf.pod @@ -28,7 +28,7 @@ Configuration file. =head1 SEE ALSO L, -L. +L. =head1 HISTORY diff --git a/doc/sympa_config.podpl b/doc/sympa_config.podpl index cfa7edcdd..283148c74 100644 --- a/doc/sympa_config.podpl +++ b/doc/sympa_config.podpl @@ -154,7 +154,7 @@ sub _render_paragraph { #$parameters .= "=over\n\n" x (scalar @$pnames); if ($pii->{obsolete}) { - _render_obsolete($pii); + _render_obsolete($pii, $ppi); } elsif ($pii->{occurrence} =~ /n$/ and ref $pii->{format} eq 'ARRAY') { _render_set($pii, $ppi); @@ -213,14 +213,17 @@ sub _render_scalar { sub _render_obsolete { my $pii = shift; + my $ppi = shift; return unless $pii->{obsolete}; if ($pii->{obsolete} eq '1') { $parameters .= "Deprecated.\n\n"; } else { - $parameters .= sprintf "See L|/%s>.\n\n", - $pii->{obsolete}, $pii->{obsolete}; + my @parag = @$ppi; + pop @parag; + my $param = join '.', @parag, $pii->{obsolete}; + $parameters .= sprintf "See L|/%s>.\n\n", $param, $param; } $parameters .= "=over\n\n"; _context($pii); diff --git a/doc/sympa_scenario.pod b/doc/sympa_scenario.pod index dfaea5763..79aa06aa6 100644 --- a/doc/sympa_scenario.pod +++ b/doc/sympa_scenario.pod @@ -219,10 +219,6 @@ If it is not given, 'C' will be set. Default method. No actual authentication, and if any, sender of the message is used. -=item C - -Authenticated by DKIM signature. - =item C Authenticated by web authentication (password), @@ -235,6 +231,10 @@ or TLS client certificate. =back +Note: +The C authentication method for scenarios was obsoleted +on Sympa 6.2.71b.1. Now it is a synonym of C method. + =head3 Actions An action consists of an action name and optional modifiers. diff --git a/src/cgi/wwsympa.fcgi.in b/src/cgi/wwsympa.fcgi.in index c5d2e0279..f8c8f3c7c 100644 --- a/src/cgi/wwsympa.fcgi.in +++ b/src/cgi/wwsympa.fcgi.in @@ -225,7 +225,6 @@ our %comm = ( 'arc_download' => 'do_arc_download', 'arc_delete' => 'do_arc_delete', 'serveradmin' => 'do_serveradmin', - 'set_loglevel' => 'do_set_loglevel', 'set_dumpvars' => 'do_set_dumpvars', 'show_sessions' => 'do_show_sessions', 'unset_dumpvars' => 'do_unset_dumpvars', @@ -708,7 +707,6 @@ our %required_privileges = ( 'search_user' => ['listmaster'], 'serveradmin' => ['listmaster'], 'set_dumpvars' => ['listmaster'], - 'set_loglevel' => ['listmaster'], 'set_pending_list_request' => ['listmaster'], 'set_session_email' => ['listmaster'], 'show_sessions' => ['listmaster'], @@ -804,7 +802,6 @@ my %action_type = ( 'show_exclude' => 'admin', 'rebuildarc' => 'serveradmin', 'set_session_email' => 'serveradmin', - 'set_loglevel' => 'serveradmin', 'editfile' => 'serveradmin', #FIXME: admin? 'unset_dumpvars' => 'serveradmin', 'set_dumpvars' => 'serveradmin', @@ -1049,11 +1046,7 @@ $log->syslog('info', 'WWSympa started, process %d', $PID); #XXXbinmode STDIN, ":utf8"; # Main loop. -my $loop_count = 0; -my $start_time = time; while ($query = Sympa::WWW::FastCGI->new) { - $loop_count++; - undef $param; undef $list; undef $robot; @@ -2758,12 +2751,6 @@ sub check_param_in { sub check_param_out { wwslog('debug2', ''); - $param->{'loop_count'} = $loop_count; - $param->{'start_time'} = - $language->gettext_strftime("%d %b %Y at %H:%M:%S", - localtime $start_time); - $param->{'process_id'} = $PID; - # listmaster has owner and editor privileges for the list. $param->{'is_listmaster'} = Sympa::is_listmaster($robot, $param->{'user'}{'email'}) ? 1 : undef; @@ -3623,7 +3610,7 @@ sub do_sso_login { } unless ($email) { - add_stash('intern', 'no_identified_user'); + add_stash('user', 'no_identified_user'); wwslog( 'err', 'User could not be identified, no %s HTTP header set', @@ -5977,6 +5964,9 @@ sub do_serveradmin { ## Checking families and other virtual hosts. get_server_details(); + if ($in{'subaction'} eq 'stats') { + _get_stats(); + } ## Server files foreach my $f ( @@ -6043,12 +6033,8 @@ sub do_edit_config { } ## Change log_level for the current session -sub do_set_loglevel { - wwslog('info', ''); - - $session->{'log_level'} = $in{'log_level'}; - return 'serveradmin'; -} +# Deprecated. +#sub do_set_loglevel; ## activate dump var feature sub do_set_dumpvars { @@ -15125,6 +15111,12 @@ sub do_stats { $param->{'arc_size'} = int((Sympa::Archive->new(context => $list)->get_size + 512) / 1024); + return _get_stats(); +} + +sub _get_stats { + my $that = (ref $list eq 'Sympa::List') ? $list : $robot; + my $stats = { send_mail => {title => $language->gettext("Mail sending")}, add_or_subscribe => @@ -15139,7 +15131,7 @@ sub do_stats { }; foreach my $operation (keys %$stats) { - my $data = $log->aggregate_daily_data($list, $operation); + my $data = $log->aggregate_daily_data($that, $operation); if (%{$data || {}}) { $stats->{$operation}{'stats_values'} = '[' . join( ',', @@ -15150,6 +15142,8 @@ sub do_stats { sprintf "['%s',%d]", $formatted_date, $data->{$_} } sort keys %$data ) . ']'; + $stats->{$operation}{'max_value'} = + [sort { $b <=> $a } values %$data]->[0]; } } $param->{'stats'} = $stats; diff --git a/src/lib/Sympa.pm b/src/lib/Sympa.pm index 6990b22cc..4032f66d6 100644 --- a/src/lib/Sympa.pm +++ b/src/lib/Sympa.pm @@ -303,6 +303,7 @@ my %diag_messages = ( # Other or undefined media error # [Sympa] message contains commands '5.6.0' => 'Message contains a line that can be interpreted as a command', + # Media not supported # [Sympa] no command found in message '5.6.1' => 'No command found in message', diff --git a/src/lib/Sympa/CLI/upgrade/incoming.pm b/src/lib/Sympa/CLI/upgrade/incoming.pm index fc89886b7..450b49b75 100644 --- a/src/lib/Sympa/CLI/upgrade/incoming.pm +++ b/src/lib/Sympa/CLI/upgrade/incoming.pm @@ -178,7 +178,8 @@ Following site configuration parameters in F<--CONFIG--> are referred. =head1 SEE ALSO -L, L. +L, +L. =head1 HISTORY diff --git a/src/lib/Sympa/CLI/upgrade/outgoing.pm b/src/lib/Sympa/CLI/upgrade/outgoing.pm index d5644a917..fd99e5608 100644 --- a/src/lib/Sympa/CLI/upgrade/outgoing.pm +++ b/src/lib/Sympa/CLI/upgrade/outgoing.pm @@ -275,7 +275,7 @@ robot configuration parameters in C are referred. =head1 SEE ALSO -L, +L, L, L. diff --git a/src/lib/Sympa/ConfDef.pm b/src/lib/Sympa/ConfDef.pm index fb3425f8c..1116bf66e 100644 --- a/src/lib/Sympa/ConfDef.pm +++ b/src/lib/Sympa/ConfDef.pm @@ -152,7 +152,7 @@ See L for details about the content. =head1 SEE ALSO -L, L. +L. =head1 HISTORY diff --git a/src/lib/Sympa/Config/Schema.pm b/src/lib/Sympa/Config/Schema.pm index 7d224fd14..845eb1175 100644 --- a/src/lib/Sympa/Config/Schema.pm +++ b/src/lib/Sympa/Config/Schema.pm @@ -3821,11 +3821,9 @@ our %pinfo = ( context => [qw(list site)], order => 60.12, group => 'data_source', - gettext_id => "Inclusions timeout", + gettext_id => "TTL of user data", gettext_comment => 'Sympa caches user data extracted using the include parameter. Their TTL (time-to-live) within Sympa can be controlled using this parameter. The default value is 3600', - #gettext_comment => - # 'Default timeout between two scheduled synchronizations of list members with data sources.', gettext_unit => 'seconds', format => '\d+', default => '3600', @@ -3838,12 +3836,13 @@ our %pinfo = ( }, distribution_ttl => { + # Note: Unless defined, value of ttl parameter is used. context => [qw(list site)], order => 60.13, group => 'data_source', - gettext_id => "Inclusions timeout for message distribution", + gettext_id => "TTL of user data for message distribution", gettext_comment => - "This parameter defines the delay since the last synchronization after which the user's list will be updated before performing either of following actions:\n* Reviewing list members\n* Message distribution", + 'This parameter defines the delay since the last synchronization after which the user data will be updated before performing message distribution', gettext_unit => 'seconds', format => '\d+', length => 6 @@ -6496,11 +6495,11 @@ __END__ =head1 NAME -Sympa::ListDef - Definition of list configuration parameters +Sympa::Config::Schema - Definition of configuration parameters =head1 DESCRIPTION -This module keeps definition of configuration parameters for each list. +This module keeps definition of configuration parameters. =head2 Global variable @@ -6516,10 +6515,10 @@ TBD. =item %pinfo -This hash COMPLETELY defines ALL list parameters. -It is then used to load, save, view, edit list config files. +This hash COMPLETELY defines ALL parameters. +It is then used to load, save, view, edit config files. -List parameters format accepts the following keywords : +A parameter definition accepts the following keywords: =over @@ -6745,12 +6744,10 @@ TBD. =head1 SEE ALSO -L, +L, L, L. -L, L. - =head1 HISTORY L was separated from L module on Sympa 6.2. diff --git a/src/lib/Sympa/DataSource/File.pm b/src/lib/Sympa/DataSource/File.pm index 42127336f..6037cd5c0 100644 --- a/src/lib/Sympa/DataSource/File.pm +++ b/src/lib/Sympa/DataSource/File.pm @@ -103,7 +103,7 @@ __END__ =head1 NAME -Sympa::DataSource::file - Data source based on local file +Sympa::DataSource::File - Data source based on local file =head1 DESCRIPTION diff --git a/src/lib/Sympa/List.pm b/src/lib/Sympa/List.pm index e862d5b3b..1cae9e15b 100644 --- a/src/lib/Sympa/List.pm +++ b/src/lib/Sympa/List.pm @@ -3363,7 +3363,8 @@ sub add_list_admin { $self->_cache_publish_expiry('admin_user') if $total; - push @$stash_ref, ['notice', 'add_performed', {total => $total}] + push @$stash_ref, + ['notice', 'add_performed', {total => $total, role => $role}] if $total; return $total; } diff --git a/src/lib/Sympa/ListDef.pm b/src/lib/Sympa/ListDef.pm index 239f9a189..40b973c1b 100644 --- a/src/lib/Sympa/ListDef.pm +++ b/src/lib/Sympa/ListDef.pm @@ -113,7 +113,7 @@ TBD. =head1 SEE ALSO -L, +L, L, L. diff --git a/src/lib/Sympa/ListOpt.pm b/src/lib/Sympa/ListOpt.pm index 6018bbe90..cf1466817 100644 --- a/src/lib/Sympa/ListOpt.pm +++ b/src/lib/Sympa/ListOpt.pm @@ -79,11 +79,11 @@ our %list_option = ( 'remove_bouncers' => {'gettext_id' => 'remove bouncing users'}, 'notify_bouncers' => {'gettext_id' => 'send notify to bouncing users'}, - # pictures_feature, dkim_feature, merge_feature, + # pictures_feature, dkim_feature, personalization_feature, # inclusion_notification_feature, tracking.delivery_status_notification, # tracking.message_disposition_notification 'on' => {'gettext_id' => 'enabled'}, - # pictures_feature, dkim_feature, merge_feature, + # pictures_feature, dkim_feature, personalization_feature, # inclusion_notification_feature, tracking.delivery_status_notification, # tracking.message_disposition_notification, update_db_field_types 'off' => {'gettext_id' => 'disabled'}, @@ -196,7 +196,7 @@ our %list_option = ( 'smime_authenticated_messages' => {'gettext_id' => 'authenticated by S/MIME signature'}, 'dkim_authenticated_messages' => - {'gettext_id' => 'authenticated by DKIM signature'}, + {'gettext_id' => 'with successfully verified DKIM signature'}, 'editor_validated_messages' => {'gettext_id' => 'approved by moderator'}, 'any' => {'gettext_id' => 'any messages'}, diff --git a/src/lib/Sympa/Log.pm b/src/lib/Sympa/Log.pm index 0c53d421e..664340ebf 100644 --- a/src/lib/Sympa/Log.pm +++ b/src/lib/Sympa/Log.pm @@ -625,11 +625,11 @@ sub aggregate_stat { unless (@res) { return 0; } - my $date_deb = $res[0] - ($res[0] % 3600); + my $date_deb = $res[0] - ($res[0] % 900); - # Hour to hour + # By each 15 minutes (some time zones have this time difference). my @slots; - for (my $i = $date_deb; $i <= $date_end; $i = $i + 3600) { + for (my $i = $date_deb; $i <= $date_end; $i += 900) { push @slots, $i; } @@ -759,7 +759,7 @@ sub _aggregate_data { sub aggregate_daily_data { my $self = shift; $self->syslog('debug2', '(%s, %s)', @_); - my $list = shift; + my $that = shift; my $operation = shift; my $sdm; @@ -769,42 +769,77 @@ sub aggregate_daily_data { return; } - my $result; + my $result = {}; + + my $cond; + my @vars; + if (ref $that eq 'Sympa::List') { + $cond = q{robot_counter = ? AND list_counter = ?}; + @vars = ($that->{'domain'}, $that->{'name'}); + } else { + $cond = q{robot_counter = ?}; + @vars = ($that); + } my $sth; - my $row; + unless ( $sth = $sdm->do_prepared_query( - q{SELECT beginning_date_counter AS "date", - count_counter AS "count" - FROM stat_counter_table - WHERE data_counter = ? AND - robot_counter = ? AND list_counter = ?}, + sprintf( + q{SELECT beginning_date_counter AS "date", + count_counter AS "count" + FROM stat_counter_table + WHERE data_counter = ? AND %s}, $cond + ), $operation, - $list->{'domain'}, $list->{'name'} + @vars ) ) { $self->syslog('err', 'Unable to get stat data %s for list %s', - $operation, $list); + $operation, $that); return; } - while ($row = $sth->fetchrow_hashref('NAME_lc')) { - my $midnight = Sympa::Tools::Time::get_midnight_time($row->{'date'}); - $result->{$midnight} = 0 unless defined $result->{$midnight}; - $result->{$midnight} += $row->{'count'}; + while (my $row = $sth->fetchrow_hashref('NAME_lc')) { + _add_count($result, $row->{date}, $row->{count}); } $sth->finish; - my @dates = sort { $a <=> $b } keys %$result; - return {} unless @dates; - - for (my $date = $dates[0]; $date < $dates[-1]; $date += 86400) { - my $midnight = Sympa::Tools::Time::get_midnight_time($date); - $result->{$midnight} = 0 unless defined $result->{$midnight}; + if (%{$result || {}}) { + # Fill in zeroes for missing days. + unless ( + $sth = $sdm->do_prepared_query( + sprintf( + q{SELECT MIN(beginning_date_counter), + MAX(beginning_date_counter) + FROM stat_counter_table + WHERE %s}, $cond + ), + @vars + ) + ) { + $self->syslog('err', 'Unable to get stat data %s for list %s', + $operation, $that); + return; + } + my ($min, $max) = $sth->fetchrow_array; + for (my $d = $min; $d <= $max; $d += 900) { + _add_count($result, $d, 0); + } + $sth->finish; } + return $result; } +sub _add_count { + my $result = shift; + my $date = shift; + my $count = shift; + + my $midnight = Sympa::Tools::Time::get_midnight_time($date); + $result->{$midnight} //= 0; + $result->{$midnight} += $count; +} 1; __END__ diff --git a/src/lib/Sympa/Spindle/ToList.pm b/src/lib/Sympa/Spindle/ToList.pm index 96ab2ce9d..17186bf45 100644 --- a/src/lib/Sympa/Spindle/ToList.pm +++ b/src/lib/Sympa/Spindle/ToList.pm @@ -452,10 +452,10 @@ Transforms message by each reception mode. =item * Enables DMARC protection (according to -L|list_config(5)/dmarc_protection> +L|sympa_config(5)/dmarc_protection> list configuration parameter), message personalization (according to -L|list_config(5)/merge_feature> +L|sympa_config(5)/personalization_feature> list configuration parameter) and/or re-encryption by S/MIME (if original message was encrypted). @@ -468,7 +468,7 @@ Alters envelope sender of the message to IC<-owner> address. Then stores message into outgoing spool (see L) with classified packets of recipients. -This cass updates statistics information of the list (with digest delivery, +This class updates statistics information of the list (with digest delivery, L will update it). diff --git a/src/lib/Sympa/Spindle/TransformIncoming.pm b/src/lib/Sympa/Spindle/TransformIncoming.pm index 61b14e4e4..daa2091d5 100644 --- a/src/lib/Sympa/Spindle/TransformIncoming.pm +++ b/src/lib/Sympa/Spindle/TransformIncoming.pm @@ -266,13 +266,13 @@ Adds C header field, if any message topics =item * Anonymizes message, -if L|list_config(5)/anonymous_sender> list configuration +if L|sympa_config(5)/anonymous_sender> list configuration parameter is enabled. =item * Adds custom subject tag to C field, if -L|list_config(5)/custom_subject> list configuration +L|sympa_config(5)/custom_subject> list configuration parameter is available. =item * @@ -282,7 +282,7 @@ Enables message tracking (see L) if necessary. =item * Removes header fields specified by -L|list_config(5)/remove_headers>. +L|sympa_config(5)/remove_headers>. =back diff --git a/src/lib/Sympa/Spindle/TransformOutgoing.pm b/src/lib/Sympa/Spindle/TransformOutgoing.pm index 54e087a7f..86723badc 100644 --- a/src/lib/Sympa/Spindle/TransformOutgoing.pm +++ b/src/lib/Sympa/Spindle/TransformOutgoing.pm @@ -186,7 +186,7 @@ if available. =item * Adds / modifies C header field, -if L|list_config(5)/reply_to_header> list option is +if L|sympa_config(5)/reply_to_header> list option is enabled. =item * @@ -212,21 +212,21 @@ Adds / overwrites following header fields: =item * Adds header fields specified by -L|list_config(5)/custom_header> list configuration parameter, +L|sympa_config(5)/custom_header> list configuration parameter, if any. =item * Adds RFC 2919 C field, RFC 2369 fields (according to -L|list_config(5)/rfc2369_header_fields> list +L|sympa_config(5)/rfc2369_header_fields> list configuration option) and RFC 5064 C field (if archiving is enabled). =item * Removes header fields specified by -L|list_config(5)/remove_outgoing_headers> +L|sympa_config(5)/remove_outgoing_headers> list configuration parameter, if any. =back diff --git a/src/lib/Sympa/Tools/Time.pm b/src/lib/Sympa/Tools/Time.pm index a9a36904c..25696ee15 100644 --- a/src/lib/Sympa/Tools/Time.pm +++ b/src/lib/Sympa/Tools/Time.pm @@ -8,8 +8,8 @@ # Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites # Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER -# Copyright 2018 The Sympa Community. See the AUTHORS.md file at the -# top-level directory of this distribution and at +# Copyright 2018, 2023 The Sympa Community. See the +# AUTHORS.md file at the top-level directory of this distribution and at # . # # This program is free software; you can redistribute it and/or modify @@ -41,9 +41,9 @@ use constant has_gettimeofday => defined eval { Time::HiRes::gettimeofday() }; # Note: This is used only once. sub get_midnight_time { - my $epoch = $_[0]; - my @date = localtime($epoch); - return $epoch - $date[0] - $date[1] * 60 - $date[2] * 3600; + my $epoch = shift; + my @date = localtime $epoch; + return Time::Local::timelocal(0, 0, 0, @date[3 .. 5]); } sub epoch_conv { diff --git a/src/sbin/archived.pl.in b/src/sbin/archived.pl.in index ecb23f43d..9f57e302c 100644 --- a/src/sbin/archived.pl.in +++ b/src/sbin/archived.pl.in @@ -344,7 +344,7 @@ See L. =head1 SEE ALSO -L, L, L, L. +L, L, L, L. L. diff --git a/src/sbin/bounced.pl.in b/src/sbin/bounced.pl.in index ba674cc73..5abb92264 100644 --- a/src/sbin/bounced.pl.in +++ b/src/sbin/bounced.pl.in @@ -332,7 +332,7 @@ See L. =head1 SEE ALSO -L, L, L, L. +L, L, L, L. L. diff --git a/src/sbin/bulk.pl.in b/src/sbin/bulk.pl.in index bc8d78965..ecfb53e2c 100644 --- a/src/sbin/bulk.pl.in +++ b/src/sbin/bulk.pl.in @@ -244,7 +244,8 @@ of F. =head1 SEE ALSO -L, L. +L, +L. L. diff --git a/src/sbin/sympa_automatic.pl.in b/src/sbin/sympa_automatic.pl.in index b714e095f..b0ba9d181 100644 --- a/src/sbin/sympa_automatic.pl.in +++ b/src/sbin/sympa_automatic.pl.in @@ -382,7 +382,8 @@ of F. =head1 SEE ALSO -L, L. +L, +L. L. diff --git a/src/sbin/sympa_msg.pl.in b/src/sbin/sympa_msg.pl.in index f1d040f59..8164767eb 100644 --- a/src/sbin/sympa_msg.pl.in +++ b/src/sbin/sympa_msg.pl.in @@ -511,7 +511,8 @@ of F. =head1 SEE ALSO -L, L. +L, +L. L, L, L, L, L. diff --git a/support/sync_translation.sh b/support/sync_translation.sh index ded6788de..a2c4a398e 100755 --- a/support/sync_translation.sh +++ b/support/sync_translation.sh @@ -58,9 +58,8 @@ test -w "$TRANS_DIRECTORY" # Confirm that remote repository has been cloned using the Deploy Key. # Confirm that any branches in remote origin may be fetched. -git config --get remote.origin.url git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' -git fetch --quiet --depth 50 +git fetch --depth 50 |& cat # Export recent translations under TRANS_DIRECTORY. # "pootle sync_stores" is the command to export them. @@ -210,7 +209,7 @@ else do_push="yes" fi if [ "$do_push" = "yes" ]; then - git push -f origin "$SYMPA_PUSH_BRANCH" + git push -f origin "$SYMPA_PUSH_BRANCH" |& cat else echo 'Nothing to push.' fi