Skip to content

Commit b26217d

Browse files
author
Till Brehm
committed
Merge branch 'master' into 'master'
Mlmmj web interface implementation I've tried to implement an ISPConfig interface for Mlmmj There are only some params implemented for now I've tried to create a user friendly interface and not a simple GUI for all Mlmmj TUNABLES! See merge request !439
2 parents 296754d + 6054635 commit b26217d

17 files changed

+615
-144
lines changed

install/lib/installer_base.lib.php

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function add_database_server_record() {
314314
$tpl_ini_array['web']['php_ini_path_cgi'] = $conf['apache']['php_ini_path_cgi'];
315315
$tpl_ini_array['mail']['pop3_imap_daemon'] = ($conf['dovecot']['installed'] == true)?'dovecot':'courier';
316316
$tpl_ini_array['mail']['mail_filter_syntax'] = ($conf['dovecot']['installed'] == true)?'sieve':'maildrop';
317-
$tpl_ini_array['mail']['mailinglist'] = ($conf['mlmmj']['installed'] == true)?'mlmmj':'mailman';
317+
$tpl_ini_array['mail']['mailinglist_manager'] = ($conf['mlmmj']['installed'] == true)?'mlmmj':'mailman';
318318
$tpl_ini_array['dns']['bind_user'] = $conf['bind']['bind_user'];
319319
$tpl_ini_array['dns']['bind_group'] = $conf['bind']['bind_group'];
320320
$tpl_ini_array['dns']['bind_zonefiles_dir'] = $conf['bind']['bind_zonefiles_dir'];
@@ -877,7 +877,8 @@ public function configure_mlmmj() {
877877
copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~mlmmj');
878878
$content .= "\n# mlmmj mailing lists\n";
879879
$content .= "mlmmj unix - n n - - pipe\n";
880-
$content .= " flags=ORhu user=mlmmj argv=/usr/local/bin/mlmmj-receive -F -L /var/spool/mlmmj/\$nexthop\n\n";
880+
$content .= " flags=ORhu user=mlmmj argv=/usr/bin/mlmmj-receive -F -L /var/";
881+
$content .= $mlConfig['spool_dir']."/\$nexthop\n\n";
881882
wf($conf['postfix']['config_dir'].'/master.cf', $content);
882883
}
883884

@@ -889,31 +890,9 @@ public function configure_mlmmj() {
889890
touch("$configDir/transport");
890891
exec("nohup /usr/sbin/postmap $configDir/transport >/dev/null 2>&1");
891892

892-
// ALTER TABLE `mail_mailinglist` ADD `closedlist` enum('n','y') NOT NULL DEFAULT 'y'
893-
// ALTER TABLE `mail_mailinglist` ADD `closedlistsub` enum('n','y') NOT NULL DEFAULT 'y'
894-
// ALTER TABLE `mail_mailinglist` ADD `moderated` enum('n','y') NOT NULL DEFAULT 'n'
895-
// ALTER TABLE `mail_mailinglist` ADD `tocc` enum('n','y') NOT NULL DEFAULT 'n'
896-
// ALTER TABLE `mail_mailinglist` ADD `subonlypost` enum('n','y') NOT NULL DEFAULT 'n'
897-
// ALTER TABLE `mail_mailinglist` ADD `modonlypost` enum('n','y') NOT NULL DEFAULT 'n'
898-
// ALTER TABLE `mail_mailinglist` ADD `modnonsubposts` enum('n','y') NOT NULL DEFAULT 'n'
899-
// ALTER TABLE `mail_mailinglist` ADD `addtohdr` enum('n','y') NOT NULL DEFAULT 'n'
900-
// ALTER TABLE `mail_mailinglist` ADD `notifysub` enum('n','y') NOT NULL DEFAULT 'n'
901-
// ALTER TABLE `mail_mailinglist` ADD `notifymod` enum('n','y') NOT NULL DEFAULT 'n'
902-
// ALTER TABLE `mail_mailinglist` ADD `noarchive` enum('n','y') NOT NULL DEFAULT 'n'
903-
// ALTER TABLE `mail_mailinglist` ADD `nosubconfirm` enum('n','y') NOT NULL DEFAULT 'n'
904-
// ALTER TABLE `mail_mailinglist` ADD `noget` enum('n','y') NOT NULL DEFAULT 'n'
905-
// ALTER TABLE `mail_mailinglist` ADD `notoccdenymails` enum('n','y') NOT NULL DEFAULT 'n'
906-
// ALTER TABLE `mail_mailinglist` ADD `noaccessdenymails` enum('n','y') NOT NULL DEFAULT 'n'
907-
// ALTER TABLE `mail_mailinglist` ADD `nosubonlydenymails` enum('n','y') NOT NULL DEFAULT 'n'
908-
// ALTER TABLE `mail_mailinglist` ADD `nomodonlydenymails` enum('n','y') NOT NULL DEFAULT 'n'
909-
// ALTER TABLE `mail_mailinglist` ADD `nosubmodmails` enum('n','y') NOT NULL DEFAULT 'n'
910-
// ALTER TABLE `mail_mailinglist` ADD `nodigesttext` enum('n','y') NOT NULL DEFAULT 'n'
911-
// ALTER TABLE `mail_mailinglist` ADD `nodigestsub` enum('n','y') NOT NULL DEFAULT 'n'
912-
// ALTER TABLE `mail_mailinglist` ADD `nonomailsub` enum('n','y') NOT NULL DEFAULT 'n'
913-
// ALTER TABLE `mail_mailinglist` ADD `nomaxmailsizedenymails` enum('n','y') NOT NULL DEFAULT 'n'
914-
// ALTER TABLE `mail_mailinglist` ADD `nolistsubsemail` enum('n','y') NOT NULL DEFAULT 'n'
915-
// ALTER TABLE `mail_mailinglist` ADD `ifmodsendonlymodmoderate` enum('n','y') NOT NULL DEFAULT 'n'
916-
// ALTER TABLE `mail_mailinglist` ADD `notmetoo` enum('n','y') NOT NULL DEFAULT 'n'
893+
//* Create/update cron entry
894+
$cronEntry = '0 */2 * * * find /var'.$mlConfig['spool_dir'].'/ -mindepth 1 -maxdepth 1 -type d -exec /usr/bin/mlmmj-maintd -F -d {} \;';
895+
file_put_contents('/etc/cron.d/mlmmj', $cronEntry);
917896
}
918897

919898
public function get_postfix_service($service, $type) {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ALTER TABLE `mail_mailinglist` ADD `list_type` enum('open','closed') NOT NULL DEFAULT 'open';
2+
ALTER TABLE `mail_mailinglist` ADD `subject_prefix` varchar(50) NOT NULL DEFAULT '';
3+
ALTER TABLE `mail_mailinglist` ADD `admins` mediumtext;
4+
ALTER TABLE `mail_mailinglist` ADD `digestinterval` int(11) NOT NULL DEFAULT '7';
5+
ALTER TABLE `mail_mailinglist` ADD `digestmaxmails` int(11) NOT NULL DEFAULT '50';
6+
ALTER TABLE `mail_mailinglist` ADD `archive` enum('n','y') NOT NULL DEFAULT 'n';
7+
ALTER TABLE `mail_mailinglist` ADD `digesttext` ENUM('n','y') NOT NULL DEFAULT 'n';
8+
ALTER TABLE `mail_mailinglist` ADD `digestsub` ENUM('n','y') NOT NULL DEFAULT 'n';
9+
ALTER TABLE `mail_mailinglist` ADD `mail_footer` mediumtext;
10+
ALTER TABLE `mail_mailinglist` ADD `subscribe_policy` enum('disabled','confirm','approval','both','none') NOT NULL DEFAULT 'confirm';
11+
ALTER TABLE `mail_mailinglist` ADD `posting_policy` enum('closed','moderated','free') NOT NULL DEFAULT 'free';

install/sql/ispconfig3.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,19 @@ CREATE TABLE `mail_mailinglist` (
877877
`server_id` int(11) unsigned NOT NULL default '0',
878878
`domain` varchar(255) NOT NULL DEFAULT '',
879879
`listname` varchar(255) NOT NULL DEFAULT '',
880+
`list_type` enum('open','closed') NOT NULL DEFAULT 'open',
880881
`email` varchar(255) NOT NULL DEFAULT '',
881882
`password` varchar(255) NOT NULL DEFAULT '',
883+
`subject_prefix` varchar(50) NOT NULL DEFAULT '',
884+
`admins` mediumtext,
885+
`digestinterval` int(11) NOT NULL DEFAULT '7',
886+
`digestmaxmails` int(11) NOT NULL DEFAULT '50',
887+
`archive` enum('n','y') NOT NULL DEFAULT 'n',
888+
`digesttext` enum('n','y') NOT NULL DEFAULT 'n',
889+
`digestsub` enum('n','y') NOT NULL DEFAULT 'n',
890+
`mail_footer` mediumtext,
891+
`subscribe_policy` enum('disabled','confirm','approval','both','none') NOT NULL DEFAULT 'confirm',
892+
`posting_policy` enum('closed','moderated','free') NOT NULL DEFAULT 'free',
882893
PRIMARY KEY (`mailinglist_id`)
883894
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
884895

install/tpl/server.ini.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ overquota_notify_client=y
5454
overquota_notify_freq=7
5555
overquota_notify_onok=n
5656
sendmail_path=/usr/sbin/sendmail
57-
mailinglist=mlmmj
57+
mailinglist_manager=mlmmj
5858

5959
[getmail]
6060
getmail_config_dir=/etc/getmail

interface/web/admin/form/server_config.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@
636636
'default' => 'n',
637637
'value' => array(0 => 'n', 1 => 'y')
638638
),
639-
'mailinglist' => array(
639+
'mailinglist_manager' => array(
640640
'datatype' => 'VARCHAR',
641641
'formtype' => 'SELECT',
642642
'default' => '20',

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,6 @@ $wb['xmpp_port_pastebin_txt'] = 'Pastebin';
289289
$wb['xmpp_port_bosh_txt'] = 'BOSH';
290290
$wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
291291
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
292+
293+
$wb["mailinglist_manager_txt"] = 'Mailinglist Manager'
292294
?>

interface/web/admin/lib/lang/it_server_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,6 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
281281
$wb['disable_bind_log_txt'] = 'Disable bind9 messages for Loglevel WARN';
282282
$wb['apps_vhost_enabled_txt'] = 'Apps-vhost enabled';
283283
$wb['backup_time_txt'] = 'Backup time';
284+
285+
$wb["mailinglist_manager_txt"] = 'Gestore delle Liste'
284286
?>

interface/web/admin/templates/server_config_mail_edit.htm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ <h1><tmpl_var name="list_head_txt"></h1>
118118
</div>
119119
</div>
120120
<div class="form-group">
121-
<label class="col-sm-3 control-label">{tmpl_var name='mailinglist_txt'}</label>
122-
<div class="col-sm-9"><select name="mailinglist" id="mailinglist" class="form-control">
123-
{tmpl_var name='mailinglist'}
121+
<label class="col-sm-3 control-label">{tmpl_var name='mailinglist_manager_txt'}</label>
122+
<div class="col-sm-9"><select name="mailinglist_manager" id="mailinglist_manager" class="form-control">
123+
{tmpl_var name='mailinglist_manager'}
124124
</select></div>
125125
</div>
126126

interface/web/mail/form/mail_mailinglist.tform.php

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
3939
*/
4040

41+
$app->uses('getconf');
42+
$mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager'];
43+
4144
$form["title"] = "Mailing List";
4245
$form["description"] = "";
4346
$form["name"] = "mail_mailinglist";
@@ -151,4 +154,149 @@
151154
//#################################
152155
)
153156
);
157+
158+
if($mlManager == 'mlmmj') {
159+
$form["tabs"]['options'] = array (
160+
'title' => "Options",
161+
'width' => 100,
162+
'template' => "templates/mail_mailinglist_options.htm",
163+
'fields' => array (
164+
//#################################
165+
// Begin Datatable fields
166+
//#################################
167+
'admins' => array (
168+
'datatype' => 'TEXT',
169+
'formtype' => 'TEXTAREA',
170+
'cols' => '30',
171+
'rows' => '5'
172+
),
173+
'subject_prefix' => array (
174+
'datatype' => 'VARCHAR',
175+
'formtype' => 'TEXT',
176+
'default' => '',
177+
'value' => '',
178+
'width' => '30',
179+
'maxlength' => '255',
180+
),
181+
'mail_footer' => array (
182+
'datatype' => 'TEXT',
183+
'formtype' => 'TEXTAREA',
184+
'cols' => '30',
185+
'rows' => '5'
186+
),
187+
'archive' => array (
188+
'datatype' => 'VARCHAR',
189+
'formtype' => 'CHECKBOX',
190+
'default' => 'n',
191+
'value' => array(0 => 'n', 1 => 'y')
192+
),
193+
)
194+
);
195+
196+
$form["tabs"]['membership'] = array (
197+
'title' => "Membership",
198+
'width' => 100,
199+
'template' => "templates/mail_mailinglist_membership.htm",
200+
'fields' => array (
201+
//#################################
202+
// Begin Datatable fields
203+
//#################################
204+
// 'membership' => array (
205+
// 'datatype' => 'TEXT',
206+
// 'formtype' => 'TEXTAREA',
207+
// 'cols' => '30',
208+
// 'rows' => '5'
209+
// ),
210+
)
211+
);
212+
213+
214+
$form["tabs"]['privacy'] = array (
215+
'title' => "Privacy",
216+
'width' => 100,
217+
'template' => "templates/mail_mailinglist_privacy.htm",
218+
'fields' => array (
219+
//#################################
220+
// Begin Datatable fields
221+
//#################################
222+
'list_type' => array (
223+
'datatype' => 'VARCHAR',
224+
'formtype' => 'RADIO',
225+
'regex' => '',
226+
'errmsg' => '',
227+
'default' => 'user',
228+
'value' => array ('open' => 'Open', 'closed' => 'Closed'),
229+
'separator' => '',
230+
'width' => '30',
231+
'maxlength' => '255',
232+
'rows' => '',
233+
'cols' => ''
234+
),
235+
'subscribe_policy' => array (
236+
'datatype' => 'VARCHAR',
237+
'formtype' => 'SELECT',
238+
'default' => 'confirm',
239+
'value' => array(
240+
'disabled' => 'sub_disabled_txt',
241+
'confirm' => 'sub_confirm_txt',
242+
'approval' => 'sub_approval_txt',
243+
'both' => 'sub_both_txt',
244+
'none' => 'sub_none_txt'),
245+
),
246+
'posting_policy' => array (
247+
'datatype' => 'VARCHAR',
248+
'formtype' => 'SELECT',
249+
'default' => 'confirm',
250+
'value' => array(
251+
'closed' => 'post_closed_txt',
252+
'moderated' => 'post_moderated_txt',
253+
'free' => 'post_free_txt'),
254+
),
255+
)
256+
);
257+
258+
$form["tabs"]['digest'] = array (
259+
'title' => "Digest",
260+
'width' => 100,
261+
'template' => "templates/mail_mailinglist_digest.htm",
262+
'fields' => array (
263+
//#################################
264+
// Begin Datatable fields
265+
//#################################
266+
'digesttext' => array (
267+
'datatype' => 'VARCHAR',
268+
'formtype' => 'CHECKBOX',
269+
'default' => 'n',
270+
'value' => array(0 => 'n', 1 => 'y')
271+
),
272+
'digestsub' => array (
273+
'datatype' => 'VARCHAR',
274+
'formtype' => 'CHECKBOX',
275+
'default' => 'n',
276+
'value' => array(0 => 'n', 1 => 'y')
277+
),
278+
'digestinterval' => array (
279+
'datatype' => 'VARCHAR',
280+
'formtype' => 'TEXT',
281+
'default' => '7',
282+
'validators' => array(0 => array('type' => 'ISINT'),
283+
array('type'=>'RANGE', 'range'=>'1:60')
284+
),
285+
'value' => '',
286+
'width' => '15'
287+
),
288+
'digestmaxmails' => array (
289+
'datatype' => 'VARCHAR',
290+
'formtype' => 'TEXT',
291+
'default' => '50',
292+
'validators' => array(0 => array('type' => 'ISINT'),
293+
array('type'=>'RANGE', 'range'=>'10:100')
294+
),
295+
'value' => '',
296+
'width' => '15'
297+
),
298+
)
299+
);
300+
301+
}
154302
?>

interface/web/mail/lib/lang/en_mail_mailinglist.lng

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,74 @@
11
<?php
2+
$wb['heading_general_txt'] = 'General';
3+
4+
/** MLMMJ **/
5+
$wb['heading_subscription_txt'] = 'Subscription';
6+
$wb['heading_removal_txt'] = 'Removal';
7+
$wb['admins_txt'] = 'Admin\'s email';
8+
$wb['admins_desc_txt'] = 'The additional email addresses that get mails to list name+admin@listdomain.ltd';
9+
10+
$wb['subscribers_txt'] = 'Membership';
11+
$wb['subscribers_desc_txt'] = 'The email addresses subscribed to the list';
12+
13+
$wb['prefix_txt'] = 'Subject prefix';
14+
$wb['prefix_desc_txt'] = 'This will alter the Subject: line, and add a prefix if it\'s not present elsewhere';
15+
16+
$wb['mail_footer_txt'] = 'Footer text';
17+
$wb['mail_footer_desc_txt'] = 'This content is appended to mail sent to the list';
18+
19+
$wb['subscribe_policy_txt'] = 'Subscribe policy';
20+
$wb['sub_disabled_txt'] = 'Disabled';
21+
$wb['sub_confirm_txt'] = 'Confirm';
22+
$wb['sub_approval_txt'] = 'Require approval';
23+
$wb['sub_both_txt'] = 'Confirm and approve';
24+
$wb['sub_none_txt'] = 'Limitless';
25+
26+
$wb['posting_policy_txt'] = 'posting policy';
27+
$wb['post_free_txt'] = 'Free';
28+
$wb['post_closed_txt'] = 'Closed';
29+
$wb['post_moderated_txt'] = 'Moderated';
30+
31+
$wb['list_type_txt'] = 'List type';
32+
$wb['type_open_txt'] = 'Open';
33+
$wb['type_closed_txt'] = 'Closed';
34+
35+
$wb['digestinterval_txt'] = 'Interval';
36+
$wb['digestinterval_desc_txt'] = 'Specifies how many days will pass before the next digest is sent. Defaults is 7 days';
37+
$wb['digestmaxmails_txt'] = 'Max mails';
38+
$wb['digestmaxmails_desc_txt'] = 'Specifies how many mails can accumulate before digest sending is triggered. Defaults to 50 mails, meaning that if 50 mails arrive to the list before digestinterval have passed, the digest is delivered';
39+
$wb['_txt'] = '';
40+
41+
$wb['closedlist_txt'] = 'Closed list';
42+
$wb['closedlistsub_txt'] = 'Closed for subscription';
43+
$wb['moderated_txt'] = 'Moderated list';
44+
$wb['tocc_txt'] = 'To/Cc optional';
45+
$wb['subonlypost_txt'] = 'Closed posting';
46+
$wb['subonlypost_desc_txt'] = 'Only people who are subscribed to the list, are allowed to post to it';
47+
48+
$wb['modonlypost_txt'] = 'modonlypost';
49+
$wb['modnonsubposts_txt'] = 'modnonsubposts';
50+
$wb['addtohdr_txt'] = 'addtohdr';
51+
$wb['notifysub_txt'] = 'notifysub';
52+
$wb['notifymod_txt'] = 'notifymod';
53+
$wb['archive_txt'] = 'Archive';
54+
$wb['archive_desc_txt'] = 'If checked, the mail will be saved in the archive and not simply deleted';
55+
56+
57+
$wb['nosubconfirm_txt'] = 'nosubconfirm';
58+
$wb['noget_txt'] = 'noget';
59+
$wb['notoccdenymails_txt'] = 'notoccdenymails';
60+
$wb['noaccessdenymails_txt'] = 'noaccessdenymails';
61+
$wb['nosubonlydenymails_txt'] = 'nosubonlydenymails';
62+
$wb['nomodonlydenymails_txt'] = 'nomodonlydenymails';
63+
$wb['nosubmodmails_txt'] = 'nosubmodmails';
64+
$wb['digestsub_txt'] = 'Enable';
65+
$wb['digesttext_txt'] = 'Thread summary';
66+
$wb['nonomailsub_txt'] = 'nonomailsub';
67+
$wb['nomaxmailsizedenymails_txt'] = 'nomaxmailsizedenymails';
68+
$wb['nolistsubsemail_txt'] = 'nolistsubsemail';
69+
$wb['ifmodsendonlymodmoderate_txt'] = 'ifmodsendonlymodmoderate';
70+
$wb['notmetoo_txt'] = 'notmetoo';
71+
272
$wb["mailinglist_txt"] = 'Mailing list';
373
$wb["limit_mailmailinglist_txt"] = 'Limit reached';
474
$wb["domain_error_empty"] = 'Domain is empty.';
@@ -17,6 +87,6 @@ $wb['generate_password_txt'] = 'Generate Password';
1787
$wb['repeat_password_txt'] = 'Repeat Password';
1888
$wb['password_mismatch_txt'] = 'The passwords do not match.';
1989
$wb['password_match_txt'] = 'The passwords do match.';
20-
$wb["listname_error_unique"] = 'There is already a mailinlist with name on the server. Please choose a different listname.';
90+
$wb["listname_error_unique"] = 'There is already a mailinglist with name on the server. Please choose a different listname.';
2191
$wb["email_error_isemail"] = 'Email address is invalid.';
2292
?>

0 commit comments

Comments
 (0)