Skip to content

Commit 40c2c9c

Browse files
committed
The report "Your message ... has been forwarded to the moderator(s)" may be sent as DSN
1 parent b17e3bb commit 40c2c9c

File tree

5 files changed

+25
-34
lines changed

5 files changed

+25
-34
lines changed

default/mail_tt2/delivery_status_notification.tt2

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[%# delivery_status_notification.tt2 ~%]
22
Content-Type: multipart/report; report-type=delivery-status;
33
boundary="[% boundary %]"
4-
[% IF action == "delivered" -%]
4+
[% IF action == "delivered" && status != '2.3.0' -%]
55
Subject: [%"Message was successfully delivered"|loc|qencode%]
6+
[% ELSIF status == '2.3.0' || status == '4.3.0' -%]
7+
Subject: [%"Message distribution: Forwarded"|loc|qencode%]
68
[% ELSIF status == '4.2.1' -%]
79
Subject: [%"List could not be created"|loc|qencode%]
810
[% ELSIF status == '4.2.4' -%]
@@ -37,11 +39,14 @@ Content-Disposition: inline
3739
Content-Description: Notification
3840

3941
[%|loc%]This is an automatic response sent by Sympa Mailing Lists Manager.[%END%]
40-
[% IF action == "delivered" -%]
42+
[% IF action == "delivered" && status != '2.3.0' -%]
4143
[%|loc%]Message was successfully delivered to following address:[%END%]
4244

4345
[% recipient %]
4446

47+
[% ELSIF status == '2.3.0' || status == '4.3.0' -%]
48+
[%|loc(listname)%]Your message to the list '%1' has been forwarded to the moderator(s)[%END%]
49+
4550
[% ELSE -%]
4651
[%|loc(recipient)%]Impossible to distribute your message for list '%1' for the following reason:[%END%]
4752

@@ -144,7 +149,9 @@ Diagnostic-Code: X-Sympa; [% diagnostic_code %]
144149

145150
--[% boundary %]
146151
[%# Attach only header part of potentially unsafe contents. ~%]
147-
[% IF status == '5.1.1' || status == '5.1.2'
152+
[%# 2.3.0 and 4.3.0 are successful stata and don't need copy of content. ~%]
153+
[% IF status == '2.3.0' || status == '4.3.0'
154+
|| status == '5.1.1' || status == '5.1.2'
148155
|| status == '5.2.3' || status == '5.7.0' -%]
149156
Content-Type: text/rfc822-headers
150157
Content-Disposition: inline

default/mail_tt2/message_report.tt2

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
~%]
66
Subject: [%"Message distribution"|loc|qencode%]
77

8-
[% IF entry == 'moderating_message' -%]
9-
[%|loc(list.name)%]Your message to the list '%1' has been forwarded to the moderator(s)[%END%]
10-
[% ELSIF entry == 'message_distributed' -%]
8+
[% IF entry == 'message_distributed' -%]
119
[%|loc(key,list.name)%]Message %1 for list '%2' has been distributed.[%END%]
1210
[% ELSIF entry == 'message_rejected' -%]
1311
[%|loc(key,list.name)%]Message %1 for list '%2' has been rejected.[%END%]

src/lib/Sympa.pm

+8-1
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,14 @@ my %diag_messages = (
251251
'default' => 'Other undefined Status',
252252
# success
253253
'2.1.5' => 'Destination address valid',
254+
# forwarded to moderators
255+
'2.3.0' => 'Other or undefined mail system status',
254256
# no available family, dynamic list creation failed, etc.
255257
'4.2.1' => 'Mailbox disabled, not accepting messages',
256258
# no subscribers in dynamic list
257259
'4.2.4' => 'Mailing list expansion problem',
260+
# held for moderation
261+
'4.3.0' => 'Other or undefined mail system status',
258262
# unknown list address
259263
'5.1.1' => 'Bad destination mailbox address',
260264
# unknown robot
@@ -335,7 +339,10 @@ sub send_dsn {
335339
# Diagnostic message.
336340
$diag ||= $diag_messages{$status} || $diag_messages{'default'};
337341
# Delivery result, "failed" or "delivered".
338-
my $action = (index($status, '2') == 0) ? 'delivered' : 'failed';
342+
my $action =
343+
($status eq '4.3.0') ? 'delayed'
344+
: (index($status, '2') == 0) ? 'delivered'
345+
: 'failed';
339346

340347
# Attach original (not decrypted) content.
341348
my $msg_string = $message->as_string(original => 1);

src/lib/Sympa/Spindle/ToEditor.pm

+3-13
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,9 @@ sub _twist {
8989
);
9090

9191
# Do not report to the sender if the message was tagged as a spam.
92-
unless ($self->{quiet} or $message->{'spam_status'} eq 'spam') {
93-
# Ensure 1 second elapsed since last message.
94-
Sympa::send_file(
95-
$list,
96-
'message_report',
97-
$sender,
98-
{ type => 'success', # Compat. <=6.2.12.
99-
entry => 'moderating_message',
100-
auto_submitted => 'auto-replied'
101-
},
102-
date => time + 1
103-
);
104-
}
92+
Sympa::send_dsn($list, $message, {}, '2.3.0')
93+
unless $self->{quiet}
94+
or $message->{'spam_status'} eq 'spam';
10595
return 1;
10696
}
10797

src/lib/Sympa/Spindle/ToModeration.pm

+3-14
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,9 @@ sub _twist {
9595
Time::HiRes::time() - $self->{start_time}
9696
);
9797

98-
# Do not report to the sender if the message was tagged as a spam.
99-
unless ($self->{quiet} or $message->{'spam_status'} eq 'spam') {
100-
# Ensure 1 second elapsed since last message.
101-
Sympa::send_file(
102-
$list,
103-
'message_report',
104-
$sender,
105-
{ type => 'success', # Comapt. <=6.2.12.
106-
entry => 'moderating_message',
107-
auto_submitted => 'auto-replied'
108-
},
109-
date => time + 1
110-
);
111-
}
98+
Sympa::send_dsn($list, $message, {}, '4.3.0')
99+
unless $self->{quiet}
100+
or $message->{'spam_status'} eq 'spam';
112101
return 1;
113102
}
114103

0 commit comments

Comments
 (0)