diff --git a/6.1.22/patches/08_2821_max_list_dispatch.patch b/6.1.22/patches/08_2821_max_list_dispatch.patch new file mode 100644 index 0000000000000000000000000000000000000000..33e208e0e002777f1434b71ff89f41c991d838e3 --- /dev/null +++ b/6.1.22/patches/08_2821_max_list_dispatch.patch @@ -0,0 +1,333 @@ +diff --git a/sympa-6.1.22-src/mail_tt2/message_report.tt2 b/sympa-6.1.22-src/mail_tt2/message_report.tt2 +index b8834cf..99c8a0f 100644 +--- a/sympa-6.1.22-src/mail_tt2/message_report.tt2 ++++ b/sympa-6.1.22-src/mail_tt2/message_report.tt2 +@@ -54,6 +54,9 @@ Note: Because binary files have to be encoded in less-efficient ASCII format bef + [% ELSIF entry == 'list_unknown' -%] + + [%|loc(listname)%]List '%1' does not exist.[%END%] ++[% ELSIF entry == 'max_list_dispatch' -%] ++ ++[%|loc(max_list_dispatch)%]List size has exceded the limit, %1, set by the administrators.[%END%] + [% ELSIF entry == 'dyn_cant_create' -%] + + [%|loc(listname)%]The %1 list could not be created.[%END%] +diff --git a/sympa-6.1.22-src/po-wwsympa/de.po b/sympa-6.1.22-src/po-wwsympa/de.po +index ebd517d..72f987e 100755 +--- a/sympa-6.1.22-src/po-wwsympa/de.po ++++ b/sympa-6.1.22-src/po-wwsympa/de.po +@@ -7557,3 +7557,8 @@ msgstr "" + #~ "Textdatei oder relationalen Datenbank gespeichert werden oder von " + #~ "verschiedenen externen Quellen inkludiert werden (Listen, Klartextdatei, " + #~ "Ergebnis einer Abfrage)." ++ ++#: ../web_tt2/error.tt2 ++msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" ++msgstr "Die Zahl der Abonnenten für diese Liste, "% 1", ist größer als der von den Listenadministratoren festgesetzte Grenze, '% 2'" ++ +diff --git a/sympa-6.1.22-src/po-wwsympa/el.po b/sympa-6.1.22-src/po-wwsympa/el.po +index 5f5c873..dd5a52e 100755 +--- a/sympa-6.1.22-src/po-wwsympa/el.po ++++ b/sympa-6.1.22-src/po-wwsympa/el.po +@@ -5860,3 +5860,8 @@ msgstr "" + #~ msgstr "" + #~ "(Προκαθορισμένη τιμή: παραλαβή ταχυδρομείου,απόδειξη παραλαβής,επισκόπηση," + #~ "κοινή επισκόπηση,περίληψη,χωρίς ταχυδρομείο)" ++ ++#: ../web_tt2/error.tt2 ++msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" ++msgstr "Ο αριθμός των συνδρομητών για αυτήν τη λίστα, '% 1', είναι μεγαλύτερη από το όριο που καθορίζεται από τους διαχειριστές της λίστας '% 2'" ++ +diff --git a/sympa-6.1.22-src/po-wwsympa/en.po b/sympa-6.1.22-src/po-wwsympa/en.po +index b4383f5..484a433 100755 +--- a/sympa-6.1.22-src/po-wwsympa/en.po ++++ b/sympa-6.1.22-src/po-wwsympa/en.po +@@ -7272,6 +7272,10 @@ msgstr "" + "in nomail mode, he or she will again receive individual mail messages from " + "the list." + ++#: ../web_tt2/error.tt2 ++msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" ++msgstr "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" ++ + #~ msgid "subscribers (private);" + #~ msgstr "subscribers (private);" + +diff --git a/sympa-6.1.22-src/po-wwsympa/es.po b/sympa-6.1.22-src/po-wwsympa/es.po +index 2b7c2bf..43e33d2 100755 +--- a/sympa-6.1.22-src/po-wwsympa/es.po ++++ b/sympa-6.1.22-src/po-wwsympa/es.po +@@ -7532,3 +7532,7 @@ msgstr "" + + #~ msgid "value" + #~ msgstr "valor" ++ ++#: ../web_tt2/error.tt2 ++msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" ++msgstr "El número de suscriptores de esta lista, '% 1', es mayor que el límite establecido por los administradores de la lista, '% 2'" +diff --git a/sympa-6.1.22-src/po-wwsympa/fr.po b/sympa-6.1.22-src/po-wwsympa/fr.po +index e65dff1..6ed5e38 100644 +--- a/sympa-6.1.22-src/po-wwsympa/fr.po ++++ b/sympa-6.1.22-src/po-wwsympa/fr.po +@@ -7921,3 +7921,7 @@ msgstr "" + # nlsref 16,91 + #~ msgid "value" + #~ msgstr "valeur" ++ ++#: ../web_tt2/error.tt2 ++msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" ++msgstr "Le nombre d'abonnés à cette liste, '% 1', est supérieure à la limite fixée par les administrateurs de la liste, '% 2'" +diff --git a/sympa-6.1.22-src/po-wwsympa/it.po b/sympa-6.1.22-src/po-wwsympa/it.po +index 3434351..10ae265 100755 +--- a/sympa-6.1.22-src/po-wwsympa/it.po ++++ b/sympa-6.1.22-src/po-wwsympa/it.po +@@ -5891,3 +5891,7 @@ msgstr "" + # nlsref 16,91 + #~ msgid "value" + #~ msgstr "valore" ++ ++#: ../web_tt2/error.tt2 ++msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" ++msgstr "Il numero di abbonati per questa lista, '% 1', è maggiore del limite fissato dagli amministratori della lista, '% 2'" +diff --git a/sympa-6.1.22-src/po-wwsympa/pt.po b/sympa-6.1.22-src/po-wwsympa/pt.po +index 13c8230..8784ff2 100755 +--- a/sympa-6.1.22-src/po-wwsympa/pt.po ++++ b/sympa-6.1.22-src/po-wwsympa/pt.po +@@ -5509,3 +5509,7 @@ msgstr "" + #~ msgstr "" + #~ "(Valor por defeito: modo de recepção mail,notice,digest,digestplain," + #~ "summary,nomail)" ++ ++#: ../web_tt2/error.tt2 ++msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" ++msgstr "O número de assinantes para esta lista, '% 1', é maior do que o limite definido pelos administradores da lista, '% 2'" +diff --git a/sympa-6.1.22-src/po/de.po b/sympa-6.1.22-src/po/de.po +index 209c6f7..f3d84f9 100755 +--- a/sympa-6.1.22-src/po/de.po ++++ b/sympa-6.1.22-src/po/de.po +@@ -5597,6 +5597,11 @@ msgstr "Befehls-Syntaxfehler." + msgid "List '%1' does not exist." + msgstr "Liste '%1' existiert nicht." + ++#. (u_err.max_list_dispatch) ++#: default/mail_tt2/message_report.tt2:59 ++msgid "List size has exceded the limit, %1, set by the administrators." ++msgstr "Größe der Liste hat die Grenze,% 1, die von den Administratoren übertraf." ++ + #. (u_err.listname) + #: ../mail_tt2/command_report.tt2:107 + msgid "%1 mailing list does not provide subscriber preferences." +diff --git a/sympa-6.1.22-src/po/el.po b/sympa-6.1.22-src/po/el.po +index a08f4a6..e89be0b 100755 +--- a/sympa-6.1.22-src/po/el.po ++++ b/sympa-6.1.22-src/po/el.po +@@ -5598,6 +5598,11 @@ msgstr "Λάθος σύνταξη εντολής." + msgid "List '%1' does not exist." + msgstr "Η λίστα '%1' δεν υπάρχει." + ++#. (u_err.max_list_dispatch) ++#: default/mail_tt2/message_report.tt2:59 ++msgid "List size has exceded the limit, %1, set by the administrators." ++msgstr "Μέγεθος της λίστας έχει exceded το όριο, 1%, που καθορίζεται από τους διαχειριστές." ++ + #. (u_err.listname) + #: ../mail_tt2/command_report.tt2:107 + msgid "%1 mailing list does not provide subscriber preferences." +diff --git a/sympa-6.1.22-src/po/en.po b/sympa-6.1.22-src/po/en.po +index 932bfc1..9b0eb9c 100755 +--- a/sympa-6.1.22-src/po/en.po ++++ b/sympa-6.1.22-src/po/en.po +@@ -8940,6 +8940,11 @@ msgstr "Command syntax error." + msgid "List '%1' does not exist." + msgstr "List '%1' does not exist." + ++#. (u_err.max_list_dispatch) ++#: default/mail_tt2/message_report.tt2:59 ++msgid "List size has exceded the limit, %1, set by the administrators." ++msgstr "List size has exceded the limit, %1, set by the administrators." ++ + #. (u_err.listname) + #: default/mail_tt2/command_report.tt2:106 + msgid "%1 mailing list does not provide subscriber preferences." +diff --git a/sympa-6.1.22-src/po/es.po b/sympa-6.1.22-src/po/es.po +index e943bb6..557f0bc 100755 +--- a/sympa-6.1.22-src/po/es.po ++++ b/sympa-6.1.22-src/po/es.po +@@ -5591,6 +5591,11 @@ msgstr "Error de sintaxis." + msgid "List '%1' does not exist." + msgstr "La lista '%1' no existe." + ++#. (u_err.max_list_dispatch) ++#: default/mail_tt2/message_report.tt2:59 ++msgid "List size has exceded the limit, %1, set by the administrators." ++msgstr "Tamaño de la lista ha rebasadas el límite,% 1, fijado por los administradores." ++ + #. (u_err.listname) + #: ../mail_tt2/command_report.tt2:107 + msgid "%1 mailing list does not provide subscriber preferences." +diff --git a/sympa-6.1.22-src/po/fr.po b/sympa-6.1.22-src/po/fr.po +index 693d3c0..e40d819 100755 +--- a/sympa-6.1.22-src/po/fr.po ++++ b/sympa-6.1.22-src/po/fr.po +@@ -5674,6 +5674,11 @@ msgstr "Erreur de syntaxe." + msgid "List '%1' does not exist." + msgstr "La liste '%1' est inconnue." + ++#. (u_err.max_list_dispatch) ++#: default/mail_tt2/message_report.tt2:59 ++msgid "List size has exceded the limit, %1, set by the administrators." ++msgstr "Taille de la liste a exceded la limite, 1%, fixé par les administrateurs." ++ + # nlsref 6,91 + #. (u_err.listname) + #: ../mail_tt2/command_report.tt2:107 +diff --git a/sympa-6.1.22-src/po/it.po b/sympa-6.1.22-src/po/it.po +index 243798d..d0c355f 100755 +--- a/sympa-6.1.22-src/po/it.po ++++ b/sympa-6.1.22-src/po/it.po +@@ -5673,6 +5673,11 @@ msgstr "Errore di sintassi nel comando." + msgid "List '%1' does not exist." + msgstr "La lista '%1' non esiste." + ++#. (u_err.max_list_dispatch) ++#: default/mail_tt2/message_report.tt2:59 ++msgid "List size has exceded the limit, %1, set by the administrators." ++msgstr "Dimensioni List ha exceded il limite,% 1, impostare dagli amministratori." ++ + # nlsref 6,91 + #. (u_err.listname) + #: ../mail_tt2/command_report.tt2:107 +diff --git a/sympa-6.1.22-src/po/pt.po b/sympa-6.1.22-src/po/pt.po +index f84f385..e131b47 100755 +--- a/sympa-6.1.22-src/po/pt.po ++++ b/sympa-6.1.22-src/po/pt.po +@@ -5286,6 +5286,11 @@ msgstr "" + msgid "List '%1' does not exist." + msgstr "" + ++#. (u_err.max_list_dispatch) ++#: default/mail_tt2/message_report.tt2:59 ++msgid "List size has exceded the limit, %1, set by the administrators." ++msgstr "Tamanho da lista tenha ultrapassado o limite,% 1, definido pelos administradores." ++ + #. (u_err.listname) + #: ../mail_tt2/command_report.tt2:107 + msgid "%1 mailing list does not provide subscriber preferences." +diff --git a/sympa-6.1.22-src/src/lib/Commands.pm b/sympa-6.1.22-src/src/lib/Commands.pm +index 173374e..8f00c9a 100644 +--- a/sympa-6.1.22-src/src/lib/Commands.pm ++++ b/sympa-6.1.22-src/src/lib/Commands.pm +@@ -2015,6 +2015,19 @@ sub distribute { + return 'unknown_list'; + } + ++ ## Check to make sure that the list does not get dispatched if it is from a ++ ## moderator and the list size is greater then max_list_dispatch ++ ## We do not check to see if the message is being attempted to get dispatched ++ ## by a non privileged user because their access should be rejected by other ++ ## mechanisims at this point anyway. ++ if ($Conf{'max_list_dispatch'} && ++ ($Conf{'max_list_dispatch'} < $list->get_total()) ++ ) { ++ &do_log('info', 'DISTRIBUTE %s %s from %s refused, list subscriber count (%d) at max (%d)', $which, $key, $sender, $list->get_total(), $Conf{'max_list_dispatch'}); ++ &report::reject_report_msg('user','max_list_dispatch',$sender,{'max_list_dispatch' => $Conf{'max_list_dispatch'}},$robot,'',''); ++ return undef; ++ } ++ + &Language::SetLang($list->{'admin'}{'lang'}); + + #read the moderation queue and purge it +diff --git a/sympa-6.1.22-src/src/lib/confdef.pm b/sympa-6.1.22-src/src/lib/confdef.pm +index 012d717..0dbb4e8 100644 +--- a/sympa-6.1.22-src/src/lib/confdef.pm ++++ b/sympa-6.1.22-src/src/lib/confdef.pm +@@ -1548,6 +1548,22 @@ our @params = ( + 'edit' => '1', + 'file' => 'sympa.conf', + }, ++ { ++ 'name' => 'max_list_dispatch', ++ 'query' => 'The maximum list size that messages can be sent to, aka the maximum number of emails sent per list reciept from moderators', ++ 'default' => 1000000, ++ 'vhost' => '1', ++ 'edit' => '1', ++ 'file' => 'sympa.conf', ++ }, ++ { ++ 'name' => 'max_list_dispatch_from_subscriber', ++ 'query' => 'The maximum list size that messages can be sent to from list subscribers, aka the maximum number of emails sent per list reciept from list subscribers', ++ 'default' => 1000000, ++ 'vhost' => '1', ++ 'edit' => '1', ++ 'file' => 'sympa.conf', ++ }, + + ## Not implemented yet. + ## { +diff --git a/sympa-6.1.22-src/src/sympa.pl.in b/sympa-6.1.22-src/src/sympa.pl.in +index 6c307dd..96f9733 100644 +--- a/sympa-6.1.22-src/src/sympa.pl.in ++++ b/sympa-6.1.22-src/src/sympa.pl.in +@@ -1982,9 +1982,27 @@ sub DoMessage{ + my $auth_method = 'smtp'; + $auth_method = 'dkim' if ($message->{'dkim_pass'}); + $auth_method = 'smime' if ($is_signed->{'body'}) ; +- + $result = $list->check_list_authz('send',$auth_method,$context); + $action = $result->{'action'} if (ref($result) eq 'HASH'); ++ ++ ## Defer messages if the list size is greater then the hard coded limit to ++ ## prevent mail servers sending huge amounts of mail ++ my $total = $list->get_total(); ++ if ( ++ # If there are not more users in the list then the limit for a subscriber ++ ($Conf{'max_list_dispatch_from_subscriber'} && ++ $total > $Conf{'max_list_dispatch_from_subscriber'}) && ++ ++ # Or if the sender is privileged and there are not more then the limit for privileged users ++ !($list->am_i('owner', $sender) || $list->am_i('editor', $sender) && ++ $Conf{'max_list_dispatch'} && ++ $total < $Conf{'max_list_dispatch'}) ++ ) { ++ ++ &do_log('info', 'sympa::DoMessage(): Message diverted to list owner because of constraints placed on list member size (%d) for %s from %s', $Conf{'max_list_dispatch_from_subscriber'}, $listname, $sender); ++ &Log::db_log({'robot' => $robot,'list' => $list->{'name'},'action' => 'DoMessage','parameters' => "$which,$messageid,$robot",'target_email' => '','msg_id' => $messageid,'status' => 'error','error_type' => 'max_list_dispatch','user_email' => $sender,'client' => $ip,'daemon' => $daemon_name}); ++ $action = 'editorkey'; ++ } + + unless (defined $action) { + &do_log('err', 'sympa::DoMessage(): message (%s) ignored because unable to evaluate scenario "send" for list %s',$messageid,$listname); +diff --git a/sympa-6.1.22-src/web_tt2/error.tt2 b/sympa-6.1.22-src/web_tt2/error.tt2 +index 8bede87..65d97b8 100644 +--- a/sympa-6.1.22-src/web_tt2/error.tt2 ++++ b/sympa-6.1.22-src/web_tt2/error.tt2 +@@ -79,6 +79,7 @@ + [% ELSIF u_err.msg == 'listname_needed' %][%|loc%]You need to provide list name[%END%] + [% ELSIF u_err.msg == 'already_moderated' %][%|loc%]Failed to moderate a message; it was probably moderated by another moderator[%END%] + [% ELSIF u_err.msg == 'msg_topic_missing' %][%|loc%]Tagging message is required for this list[%END%] ++ [% ELSIF u_err.msg == 'max_list_dispatch' %][%|loc(u_err.list_size,u_err.max_list_dispatch)%]The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'[%END%] + [% ELSIF u_err.msg == 'empty_archives' %][%|loc%]Archives are empty for this list[%END%] + [% ELSIF u_err.msg == 'didnt_change_anything' %][%|loc%]You did not select an action to perform[%END%] + [% ELSIF u_err.msg == 'no_bounce_user' %][%|loc(u_err.email)%]No bounce for user %1[%END%] +diff --git a/sympa-6.1.22-src/wwsympa/wwsympa.fcgi.in b/sympa-6.1.22-src/wwsympa/wwsympa.fcgi.in +index a31f9ff..5c5af41 100644 +--- a/sympa-6.1.22-src/wwsympa/wwsympa.fcgi.in ++++ b/sympa-6.1.22-src/wwsympa/wwsympa.fcgi.in +@@ -7040,6 +7040,17 @@ sub do_skinsedit { + return undef; + } + ++ # If the moderator is attempting to dispatch a message but the list ++ # excceeds the limit set by the robot admin then do not dispatch and ++ # send the moderator a helpful message ++ if ($Conf{'max_list_dispatch'} && ($Conf{'max_list_dispatch'} < $list->get_total())) { ++ &report::reject_report_web('user', 'max_list_dispatch', {'list_size' => $list->get_total(), 'max_list_dispatch' => $Conf{'max_list_dispatch'}}, $param->{'action'}); ++ &wwslog('info','do_distribute: number of subscribers greater then robot limit'); ++ &web_db_log({'parameters' => $in{'id'}, ++ 'status' => 'error', ++ 'error_type' => 'no_topic'}); ++ return undef; ++ } + + ## messages + foreach my $id (split (/,/, $in{'id'})) { # QUIET DISTRIBUTE diff --git a/sympa-6.1.22-src/mail_tt2/message_report.tt2 b/sympa-6.1.22-src/mail_tt2/message_report.tt2 index b8834cf3ca5c0981106967228ca579f83c7c2046..99c8a0fd4f3abcc125595b7e54023ff1faed57c6 100644 --- a/sympa-6.1.22-src/mail_tt2/message_report.tt2 +++ b/sympa-6.1.22-src/mail_tt2/message_report.tt2 @@ -54,6 +54,9 @@ Note: Because binary files have to be encoded in less-efficient ASCII format bef [% ELSIF entry == 'list_unknown' -%] [%|loc(listname)%]List '%1' does not exist.[%END%] +[% ELSIF entry == 'max_list_dispatch' -%] + +[%|loc(max_list_dispatch)%]List size has exceded the limit, %1, set by the administrators.[%END%] [% ELSIF entry == 'dyn_cant_create' -%] [%|loc(listname)%]The %1 list could not be created.[%END%] diff --git a/sympa-6.1.22-src/po-wwsympa/de.po b/sympa-6.1.22-src/po-wwsympa/de.po index ebd517d242188e4c2b2ff19ff51bef458354b60b..72f987ec6a84108bd1261260883d3a86a05abdf3 100755 --- a/sympa-6.1.22-src/po-wwsympa/de.po +++ b/sympa-6.1.22-src/po-wwsympa/de.po @@ -7557,3 +7557,8 @@ msgstr "" #~ "Textdatei oder relationalen Datenbank gespeichert werden oder von " #~ "verschiedenen externen Quellen inkludiert werden (Listen, Klartextdatei, " #~ "Ergebnis einer Abfrage)." + +#: ../web_tt2/error.tt2 +msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" +msgstr "Die Zahl der Abonnenten für diese Liste, "% 1", ist größer als der von den Listenadministratoren festgesetzte Grenze, '% 2'" + diff --git a/sympa-6.1.22-src/po-wwsympa/el.po b/sympa-6.1.22-src/po-wwsympa/el.po index 5f5c873ca3ca577e1d9293d1f8e50b296f226b7c..dd5a52e4b7bcf305fce20a65f7bd41d4402d6375 100755 --- a/sympa-6.1.22-src/po-wwsympa/el.po +++ b/sympa-6.1.22-src/po-wwsympa/el.po @@ -5860,3 +5860,8 @@ msgstr "" #~ msgstr "" #~ "(Προκαθορισμένη τιμή: παραλαβή ταχυδρομείου,απόδειξη παραλαβής,επισκόπηση," #~ "κοινή επισκόπηση,περίληψη,χωρίς ταχυδρομείο)" + +#: ../web_tt2/error.tt2 +msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" +msgstr "Ο αριθμός των συνδρομητών για αυτήν τη λίστα, '% 1', είναι μεγαλύτερη από το όριο που καθορίζεται από τους διαχειριστές της λίστας '% 2'" + diff --git a/sympa-6.1.22-src/po-wwsympa/en.po b/sympa-6.1.22-src/po-wwsympa/en.po index b4383f5b0311d7e8a0297066a2ba62cc57f9ac25..484a4335340ab42da7c28e583ee21e2b6b68e805 100755 --- a/sympa-6.1.22-src/po-wwsympa/en.po +++ b/sympa-6.1.22-src/po-wwsympa/en.po @@ -7272,6 +7272,10 @@ msgstr "" "in nomail mode, he or she will again receive individual mail messages from " "the list." +#: ../web_tt2/error.tt2 +msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" +msgstr "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" + #~ msgid "subscribers (private);" #~ msgstr "subscribers (private);" diff --git a/sympa-6.1.22-src/po-wwsympa/es.po b/sympa-6.1.22-src/po-wwsympa/es.po index 2b7c2bfe3f9a7c7e98087add8d41cd68e03099d2..43e33d222b096cd3de4849ff12f60e6318208c09 100755 --- a/sympa-6.1.22-src/po-wwsympa/es.po +++ b/sympa-6.1.22-src/po-wwsympa/es.po @@ -7532,3 +7532,7 @@ msgstr "" #~ msgid "value" #~ msgstr "valor" + +#: ../web_tt2/error.tt2 +msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" +msgstr "El número de suscriptores de esta lista, '% 1', es mayor que el límite establecido por los administradores de la lista, '% 2'" diff --git a/sympa-6.1.22-src/po-wwsympa/fr.po b/sympa-6.1.22-src/po-wwsympa/fr.po index e65dff15b9d8407ee727a4f8201e6928db17133f..6ed5e386d752c25f2ce2e2e4a952d1ebd9fb8505 100644 --- a/sympa-6.1.22-src/po-wwsympa/fr.po +++ b/sympa-6.1.22-src/po-wwsympa/fr.po @@ -7921,3 +7921,7 @@ msgstr "" # nlsref 16,91 #~ msgid "value" #~ msgstr "valeur" + +#: ../web_tt2/error.tt2 +msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" +msgstr "Le nombre d'abonnés à cette liste, '% 1', est supérieure à la limite fixée par les administrateurs de la liste, '% 2'" diff --git a/sympa-6.1.22-src/po-wwsympa/it.po b/sympa-6.1.22-src/po-wwsympa/it.po index 343435142da36d5e1aac61d16c1d0b2ae7b66bcd..10ae26574fe5d9b887a918759dbc0230c3839af6 100755 --- a/sympa-6.1.22-src/po-wwsympa/it.po +++ b/sympa-6.1.22-src/po-wwsympa/it.po @@ -5891,3 +5891,7 @@ msgstr "" # nlsref 16,91 #~ msgid "value" #~ msgstr "valore" + +#: ../web_tt2/error.tt2 +msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" +msgstr "Il numero di abbonati per questa lista, '% 1', è maggiore del limite fissato dagli amministratori della lista, '% 2'" diff --git a/sympa-6.1.22-src/po-wwsympa/pt.po b/sympa-6.1.22-src/po-wwsympa/pt.po index 13c8230f5a61df266c168526301244d466941da8..8784ff2eb0b43283ecaed3702ea243bb033434ee 100755 --- a/sympa-6.1.22-src/po-wwsympa/pt.po +++ b/sympa-6.1.22-src/po-wwsympa/pt.po @@ -5509,3 +5509,7 @@ msgstr "" #~ msgstr "" #~ "(Valor por defeito: modo de recepção mail,notice,digest,digestplain," #~ "summary,nomail)" + +#: ../web_tt2/error.tt2 +msgid "The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'" +msgstr "O número de assinantes para esta lista, '% 1', é maior do que o limite definido pelos administradores da lista, '% 2'" diff --git a/sympa-6.1.22-src/po/de.po b/sympa-6.1.22-src/po/de.po index 209c6f74d9e09cc92e7f5282812eb4906cb8376a..f3d84f9b7a63e34e2d2fcbc220bdd81daa6d26c5 100755 --- a/sympa-6.1.22-src/po/de.po +++ b/sympa-6.1.22-src/po/de.po @@ -5597,6 +5597,11 @@ msgstr "Befehls-Syntaxfehler." msgid "List '%1' does not exist." msgstr "Liste '%1' existiert nicht." +#. (u_err.max_list_dispatch) +#: default/mail_tt2/message_report.tt2:59 +msgid "List size has exceded the limit, %1, set by the administrators." +msgstr "Größe der Liste hat die Grenze,% 1, die von den Administratoren übertraf." + #. (u_err.listname) #: ../mail_tt2/command_report.tt2:107 msgid "%1 mailing list does not provide subscriber preferences." diff --git a/sympa-6.1.22-src/po/el.po b/sympa-6.1.22-src/po/el.po index a08f4a6dd51bd99b8b9f3728f6f5e3afaa8b548e..e89be0b51977014b1203911922831ed8cccdec6e 100755 --- a/sympa-6.1.22-src/po/el.po +++ b/sympa-6.1.22-src/po/el.po @@ -5598,6 +5598,11 @@ msgstr "Λάθος σύνταξη εντολής." msgid "List '%1' does not exist." msgstr "Η λίστα '%1' δεν υπάρχει." +#. (u_err.max_list_dispatch) +#: default/mail_tt2/message_report.tt2:59 +msgid "List size has exceded the limit, %1, set by the administrators." +msgstr "Μέγεθος της λίστας έχει exceded το όριο, 1%, που καθορίζεται από τους διαχειριστές." + #. (u_err.listname) #: ../mail_tt2/command_report.tt2:107 msgid "%1 mailing list does not provide subscriber preferences." diff --git a/sympa-6.1.22-src/po/en.po b/sympa-6.1.22-src/po/en.po index 932bfc1f0d72f7df275406dd815000c993e3cce6..9b0eb9c622796a9bf243e32448002b433d0c55f3 100755 --- a/sympa-6.1.22-src/po/en.po +++ b/sympa-6.1.22-src/po/en.po @@ -8940,6 +8940,11 @@ msgstr "Command syntax error." msgid "List '%1' does not exist." msgstr "List '%1' does not exist." +#. (u_err.max_list_dispatch) +#: default/mail_tt2/message_report.tt2:59 +msgid "List size has exceded the limit, %1, set by the administrators." +msgstr "List size has exceded the limit, %1, set by the administrators." + #. (u_err.listname) #: default/mail_tt2/command_report.tt2:106 msgid "%1 mailing list does not provide subscriber preferences." diff --git a/sympa-6.1.22-src/po/es.po b/sympa-6.1.22-src/po/es.po index e943bb66a2d60e2dddb914a3571b0ed06eaab09d..557f0bc77afa44b052f28e9d2fd1b5b7b1b68d78 100755 --- a/sympa-6.1.22-src/po/es.po +++ b/sympa-6.1.22-src/po/es.po @@ -5591,6 +5591,11 @@ msgstr "Error de sintaxis." msgid "List '%1' does not exist." msgstr "La lista '%1' no existe." +#. (u_err.max_list_dispatch) +#: default/mail_tt2/message_report.tt2:59 +msgid "List size has exceded the limit, %1, set by the administrators." +msgstr "Tamaño de la lista ha rebasadas el límite,% 1, fijado por los administradores." + #. (u_err.listname) #: ../mail_tt2/command_report.tt2:107 msgid "%1 mailing list does not provide subscriber preferences." diff --git a/sympa-6.1.22-src/po/fr.po b/sympa-6.1.22-src/po/fr.po index 693d3c05ea08699e7639db5058da0e7b1cdcbbc3..e40d819c17dd9555a023db7b577b0195dc9afb96 100755 --- a/sympa-6.1.22-src/po/fr.po +++ b/sympa-6.1.22-src/po/fr.po @@ -5674,6 +5674,11 @@ msgstr "Erreur de syntaxe." msgid "List '%1' does not exist." msgstr "La liste '%1' est inconnue." +#. (u_err.max_list_dispatch) +#: default/mail_tt2/message_report.tt2:59 +msgid "List size has exceded the limit, %1, set by the administrators." +msgstr "Taille de la liste a exceded la limite, 1%, fixé par les administrateurs." + # nlsref 6,91 #. (u_err.listname) #: ../mail_tt2/command_report.tt2:107 diff --git a/sympa-6.1.22-src/po/it.po b/sympa-6.1.22-src/po/it.po index 243798d0a0946c4c1d2f70c8b177b71bfbe84f5a..d0c355f79ee5dc90480b586b42d364010e533f21 100755 --- a/sympa-6.1.22-src/po/it.po +++ b/sympa-6.1.22-src/po/it.po @@ -5673,6 +5673,11 @@ msgstr "Errore di sintassi nel comando." msgid "List '%1' does not exist." msgstr "La lista '%1' non esiste." +#. (u_err.max_list_dispatch) +#: default/mail_tt2/message_report.tt2:59 +msgid "List size has exceded the limit, %1, set by the administrators." +msgstr "Dimensioni List ha exceded il limite,% 1, impostare dagli amministratori." + # nlsref 6,91 #. (u_err.listname) #: ../mail_tt2/command_report.tt2:107 diff --git a/sympa-6.1.22-src/po/pt.po b/sympa-6.1.22-src/po/pt.po index f84f3851c7543d714590f62ec22de7e27dd76e15..e131b47f1d4083e0c8017a77627808de2e2bed78 100755 --- a/sympa-6.1.22-src/po/pt.po +++ b/sympa-6.1.22-src/po/pt.po @@ -5286,6 +5286,11 @@ msgstr "" msgid "List '%1' does not exist." msgstr "" +#. (u_err.max_list_dispatch) +#: default/mail_tt2/message_report.tt2:59 +msgid "List size has exceded the limit, %1, set by the administrators." +msgstr "Tamanho da lista tenha ultrapassado o limite,% 1, definido pelos administradores." + #. (u_err.listname) #: ../mail_tt2/command_report.tt2:107 msgid "%1 mailing list does not provide subscriber preferences." diff --git a/sympa-6.1.22-src/src/lib/Commands.pm b/sympa-6.1.22-src/src/lib/Commands.pm index 173374ea6403764ebaa42c70cd876d239c6d869f..8f00c9acb3ecdb1b547eb303fef96fa2ac6c7974 100644 --- a/sympa-6.1.22-src/src/lib/Commands.pm +++ b/sympa-6.1.22-src/src/lib/Commands.pm @@ -2015,6 +2015,19 @@ sub distribute { return 'unknown_list'; } + ## Check to make sure that the list does not get dispatched if it is from a + ## moderator and the list size is greater then max_list_dispatch + ## We do not check to see if the message is being attempted to get dispatched + ## by a non privileged user because their access should be rejected by other + ## mechanisims at this point anyway. + if ($Conf{'max_list_dispatch'} && + ($Conf{'max_list_dispatch'} < $list->get_total()) + ) { + &do_log('info', 'DISTRIBUTE %s %s from %s refused, list subscriber count (%d) at max (%d)', $which, $key, $sender, $list->get_total(), $Conf{'max_list_dispatch'}); + &report::reject_report_msg('user','max_list_dispatch',$sender,{'max_list_dispatch' => $Conf{'max_list_dispatch'}},$robot,'',''); + return undef; + } + &Language::SetLang($list->{'admin'}{'lang'}); #read the moderation queue and purge it diff --git a/sympa-6.1.22-src/src/lib/confdef.pm b/sympa-6.1.22-src/src/lib/confdef.pm index 012d71754527361329f89b373dc78852900411f5..0dbb4e877d223719815e09631b08f319d5b54e62 100644 --- a/sympa-6.1.22-src/src/lib/confdef.pm +++ b/sympa-6.1.22-src/src/lib/confdef.pm @@ -1548,6 +1548,22 @@ our @params = ( 'edit' => '1', 'file' => 'sympa.conf', }, + { + 'name' => 'max_list_dispatch', + 'query' => 'The maximum list size that messages can be sent to, aka the maximum number of emails sent per list reciept from moderators', + 'default' => 1000000, + 'vhost' => '1', + 'edit' => '1', + 'file' => 'sympa.conf', + }, + { + 'name' => 'max_list_dispatch_from_subscriber', + 'query' => 'The maximum list size that messages can be sent to from list subscribers, aka the maximum number of emails sent per list reciept from list subscribers', + 'default' => 1000000, + 'vhost' => '1', + 'edit' => '1', + 'file' => 'sympa.conf', + }, ## Not implemented yet. ## { diff --git a/sympa-6.1.22-src/src/sympa.pl.in b/sympa-6.1.22-src/src/sympa.pl.in index 6c307dda41717a69878cde7945a91e09409c75df..96f9733ee7f7da914fb8fca9a0269a9e9ec93745 100644 --- a/sympa-6.1.22-src/src/sympa.pl.in +++ b/sympa-6.1.22-src/src/sympa.pl.in @@ -1982,9 +1982,27 @@ sub DoMessage{ my $auth_method = 'smtp'; $auth_method = 'dkim' if ($message->{'dkim_pass'}); $auth_method = 'smime' if ($is_signed->{'body'}) ; - $result = $list->check_list_authz('send',$auth_method,$context); $action = $result->{'action'} if (ref($result) eq 'HASH'); + + ## Defer messages if the list size is greater then the hard coded limit to + ## prevent mail servers sending huge amounts of mail + my $total = $list->get_total(); + if ( + # If there are not more users in the list then the limit for a subscriber + ($Conf{'max_list_dispatch_from_subscriber'} && + $total > $Conf{'max_list_dispatch_from_subscriber'}) && + + # Or if the sender is privileged and there are not more then the limit for privileged users + !($list->am_i('owner', $sender) || $list->am_i('editor', $sender) && + $Conf{'max_list_dispatch'} && + $total < $Conf{'max_list_dispatch'}) + ) { + + &do_log('info', 'sympa::DoMessage(): Message diverted to list owner because of constraints placed on list member size (%d) for %s from %s', $Conf{'max_list_dispatch_from_subscriber'}, $listname, $sender); + &Log::db_log({'robot' => $robot,'list' => $list->{'name'},'action' => 'DoMessage','parameters' => "$which,$messageid,$robot",'target_email' => '','msg_id' => $messageid,'status' => 'error','error_type' => 'max_list_dispatch','user_email' => $sender,'client' => $ip,'daemon' => $daemon_name}); + $action = 'editorkey'; + } unless (defined $action) { &do_log('err', 'sympa::DoMessage(): message (%s) ignored because unable to evaluate scenario "send" for list %s',$messageid,$listname); diff --git a/sympa-6.1.22-src/web_tt2/error.tt2 b/sympa-6.1.22-src/web_tt2/error.tt2 index 8bede87294fd739e97e01d50ddb3697ab84f1aac..65d97b8c787e1dbf05322a4ea89fed7567b59e5f 100644 --- a/sympa-6.1.22-src/web_tt2/error.tt2 +++ b/sympa-6.1.22-src/web_tt2/error.tt2 @@ -79,6 +79,7 @@ [% ELSIF u_err.msg == 'listname_needed' %][%|loc%]You need to provide list name[%END%] [% ELSIF u_err.msg == 'already_moderated' %][%|loc%]Failed to moderate a message; it was probably moderated by another moderator[%END%] [% ELSIF u_err.msg == 'msg_topic_missing' %][%|loc%]Tagging message is required for this list[%END%] + [% ELSIF u_err.msg == 'max_list_dispatch' %][%|loc(u_err.list_size,u_err.max_list_dispatch)%]The number of subscribers for this list, '%1', is greater then the limit set by the list administrators, '%2'[%END%] [% ELSIF u_err.msg == 'empty_archives' %][%|loc%]Archives are empty for this list[%END%] [% ELSIF u_err.msg == 'didnt_change_anything' %][%|loc%]You did not select an action to perform[%END%] [% ELSIF u_err.msg == 'no_bounce_user' %][%|loc(u_err.email)%]No bounce for user %1[%END%] diff --git a/sympa-6.1.22-src/wwsympa/wwsympa.fcgi.in b/sympa-6.1.22-src/wwsympa/wwsympa.fcgi.in index a31f9ffb6457a94ed117b2e7028f4a17bdd5adfe..5c5af41a7d8422116ca82ea138c1ebbc815930fa 100644 --- a/sympa-6.1.22-src/wwsympa/wwsympa.fcgi.in +++ b/sympa-6.1.22-src/wwsympa/wwsympa.fcgi.in @@ -7040,6 +7040,17 @@ sub do_skinsedit { return undef; } + # If the moderator is attempting to dispatch a message but the list + # excceeds the limit set by the robot admin then do not dispatch and + # send the moderator a helpful message + if ($Conf{'max_list_dispatch'} && ($Conf{'max_list_dispatch'} < $list->get_total())) { + &report::reject_report_web('user', 'max_list_dispatch', {'list_size' => $list->get_total(), 'max_list_dispatch' => $Conf{'max_list_dispatch'}}, $param->{'action'}); + &wwslog('info','do_distribute: number of subscribers greater then robot limit'); + &web_db_log({'parameters' => $in{'id'}, + 'status' => 'error', + 'error_type' => 'no_topic'}); + return undef; + } ## messages foreach my $id (split (/,/, $in{'id'})) { # QUIET DISTRIBUTE