Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate implicit sync_include in Sympa::List constructor #955

Merged
merged 7 commits into from
Jul 10, 2020
1 change: 1 addition & 0 deletions default/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ nobase_default_DATA = \
mail_tt2/request_auth.tt2 \
mail_tt2/report.tt2 \
mail_tt2/review.tt2 \
mail_tt2/shared_moderate.tt2 \
mail_tt2/send_auth.tt2 \
mail_tt2/sendpasswd.tt2 \
mail_tt2/sendssopasswd.tt2 \
Expand Down
11 changes: 6 additions & 5 deletions default/mail_tt2/delivery_status_notification.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Subject: [%"List unknown"|loc|qencode%]
Subject: [%"List unknown"|loc|qencode%]
[% ELSIF status == '5.2.3' -%]
Subject: [%"Too large message"|loc|qencode%]
[% ELSIF status == '5.3.0' -%]
[% ELSIF status == '5.2.4' || status == '5.3.0' -%]
Subject: [%"Message distribution: Internal server error"|loc|qencode%]
[% ELSIF status == '5.3.5' -%]
Subject: [%"Message distribution: User error"|loc|qencode%]
Expand Down Expand Up @@ -59,12 +59,13 @@ Content-Description: Notification

Note: Because binary files have to be encoded in less-efficient ASCII format before being sent over email, the final size of an attachment is often significantly larger that the original file.[%END%]

[% ELSIF status == '5.3.0' -%]
[% IF entry == 'forward' -%]
[% ELSIF status == '5.2.4' -%]
[%|loc(list.name,function)%]Impossible to forward your message to '%1-%2' because of an internal server error.[%END%]
[% ELSE -%]

[%|loc(list.name,domain)%]For further information, please contact %1-request@%2[%END -%]

[% ELSIF status == '5.3.0' -%]
[%|loc(list.name)%]Impossible to distribute your message for list '%1' because of an internal server error.[%END%]
[% END -%]

[%|loc(list.name,domain)%]For further information, please contact %1-request@%2[%END -%]

Expand Down
25 changes: 6 additions & 19 deletions default/mail_tt2/listeditor_notification.tt2
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
[%# listeditor_notification.tt2 ~%]
To: [% to %]
[%# As of 6.2.57b, this template will no longer be used. It is left for
compatibility. ~%]
[% IF type == 'shared_moderated' -%]
Subject: [%"Shared document to be approved for %1"|loc(list.name)|qencode%]

[% IF many_files -%]
[%|loc(list.name,filename,who)%]There are new shared documents in list %1:
%2
from %3

To moderate these documents: [%END%]
[% PROCESS shared_moderate.tt2 %]
[%- ELSE -%]
[%|loc(list.name,filename,who)%]There is a new shared document in list %1:
%2
from %3

To moderate this document: [%END%]
[%- END %]
[% 'docindex' | url_abs([list.name]) %]

[% ELSE -%]
From: [% fromlist %]
To: [%"Moderator"|loc|mailbox("${list.name}-editor@${domain}",list.name)%]
Subject: [%"Moderators List %1 / %2"|loc(list.name,type)|qencode%]

[% param0 %]
[% END %]
[%- END %]
11 changes: 11 additions & 0 deletions default/mail_tt2/shared_moderate.tt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[%# shared_moderate.tt2 ~%]
From: [% fromlist %]
To: [%"Moderator"|loc|mailbox("${list.name}-editor@${domain}",list.name)%]
Subject: [%"Shared document to be approved for %1"|loc(list.name)|qencode%]

[%|loc(list.name,filename,who)%]There is a new shared document in list %1:
%2
from %3

To moderate this document: [%END%]
[% 'docindex' | url_abs([list.name]) %]
28 changes: 22 additions & 6 deletions src/cgi/wwsympa.fcgi.in
Original file line number Diff line number Diff line change
Expand Up @@ -10631,8 +10631,7 @@ sub do_edit_list {
}

## Reload config to clean some empty entries in $list->{'admin'}
$list = Sympa::List->new($list->{'name'}, $robot,
{'reload_config' => 1, 'force_sync_admin' => 1});
$list = Sympa::List->new($list->{'name'}, $robot, {reload_config => 1});

unless (defined $list) {
Sympa::WWW::Report::reject_report_web('intern', 'list_reload', {},
Expand Down Expand Up @@ -13308,10 +13307,27 @@ sub do_d_create_child {
if ($access{may}{edit} == 0.5 and $type ne 'directory') {
unless ($child and $child->{moderate}) {
# Moderated at first time
$list->send_notify_to_editor(
'shared_moderated',
{ 'filename' => join('/', @{$new_child->{paths}}),
'who' => $param->{'user'}{'email'}
my @rcpt = $list->get_admins_email('receptive_editor');
@rcpt = $list->get_admins_email('actual_editor') unless @rcpt;
unless (@rcpt) {
# Since shared document has already been marked moderated,
# notification to editors should not fail. Fallback to
# listmasters.
$log->syslog(
'notice',
'No editor and owner defined at all in list %s; notification is sent to listmasters',
$list
);
@rcpt = Sympa::get_listmasters_email($list);
}

Sympa::send_file(
$list,
'shared_moderate',
\@rcpt,
{ auto_submitted => 'auto-generated',
filename => join('/', @{$new_child->{paths}}),
who => $param->{'user'}{'email'},
}
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/Sympa.pm
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ my %diag_messages = (
'5.1.2' => 'Bad destination system address',
# too large
'5.2.3' => 'Message length exceeds administrative limit',
# no owners defined in list at all, no listmasters defined at all
'5.2.4' => 'Mailing list expansion problem',
# could not store message into spool or mailer
'5.3.0' => 'Other or undefined mail system status',
# misconfigured family list
Expand Down
Loading