From 16b9461a9e0de63faa63c7ab85208e820c0a2ec0 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Wed, 14 Nov 2018 12:22:26 +0100 Subject: [PATCH] - removed mlmmj mailinglist manager --- install/dist/conf/centos70.conf.php | 4 - install/dist/conf/centos72.conf.php | 4 - install/dist/conf/debian40.conf.php | 4 - install/dist/conf/debian60.conf.php | 4 - install/dist/conf/debian90.conf.php | 4 - install/dist/conf/debiantesting.conf.php | 4 - install/dist/conf/fedora9.conf.php | 4 - install/dist/conf/gentoo.conf.php | 4 - install/dist/conf/opensuse112.conf.php | 4 - install/dist/conf/ubuntu1604.conf.php | 4 - install/install.php | 8 +- install/lib/installer_base.lib.php | 87 +--- install/tpl/mlmmj.conf.master | 5 - install/tpl/server.ini.master | 2 +- install/update.php | 6 - .../web/admin/form/server_config.tform.php | 2 +- .../web/mail/form/mail_mailinglist.tform.php | 132 ------ interface/web/mail/lib/module.conf.php | 5 - .../web/mail/list/mail_ml_membership.list.php | 93 ---- interface/web/mail/mail_mailinglist_edit.php | 7 - interface/web/mail/mail_ml_membership_del.php | 63 --- .../web/mail/mail_ml_membership_edit.php | 104 ----- .../web/mail/mail_ml_membership_list.php | 40 -- .../templates/mail_mailinglist_digest.htm | 48 --- .../templates/mail_mailinglist_options.htm | 38 -- .../templates/mail_mailinglist_privacy.htm | 44 -- server/plugins-available/mlmmj_plugin.inc.php | 406 ------------------ 27 files changed, 4 insertions(+), 1126 deletions(-) delete mode 100644 install/tpl/mlmmj.conf.master delete mode 100644 interface/web/mail/list/mail_ml_membership.list.php delete mode 100644 interface/web/mail/mail_ml_membership_del.php delete mode 100755 interface/web/mail/mail_ml_membership_edit.php delete mode 100644 interface/web/mail/mail_ml_membership_list.php delete mode 100644 interface/web/mail/templates/mail_mailinglist_digest.htm delete mode 100644 interface/web/mail/templates/mail_mailinglist_options.htm delete mode 100644 interface/web/mail/templates/mail_mailinglist_privacy.htm delete mode 100644 server/plugins-available/mlmmj_plugin.inc.php diff --git a/install/dist/conf/centos70.conf.php b/install/dist/conf/centos70.conf.php index baebbfb7a9..8c9b1117f7 100644 --- a/install/dist/conf/centos70.conf.php +++ b/install/dist/conf/centos70.conf.php @@ -118,10 +118,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/dist/conf/centos72.conf.php b/install/dist/conf/centos72.conf.php index 70d4c122fd..71fa7aad9e 100644 --- a/install/dist/conf/centos72.conf.php +++ b/install/dist/conf/centos72.conf.php @@ -118,10 +118,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/dist/conf/debian40.conf.php b/install/dist/conf/debian40.conf.php index a3170b786a..40db346fc7 100644 --- a/install/dist/conf/debian40.conf.php +++ b/install/dist/conf/debian40.conf.php @@ -120,10 +120,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/dist/conf/debian60.conf.php b/install/dist/conf/debian60.conf.php index 4f95c60e99..d8146ea8c6 100644 --- a/install/dist/conf/debian60.conf.php +++ b/install/dist/conf/debian60.conf.php @@ -120,10 +120,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/dist/conf/debian90.conf.php b/install/dist/conf/debian90.conf.php index db741ed8a1..f8955f9fd4 100644 --- a/install/dist/conf/debian90.conf.php +++ b/install/dist/conf/debian90.conf.php @@ -120,10 +120,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/dist/conf/debiantesting.conf.php b/install/dist/conf/debiantesting.conf.php index 27d1369e36..a7b5cb66b7 100644 --- a/install/dist/conf/debiantesting.conf.php +++ b/install/dist/conf/debiantesting.conf.php @@ -120,10 +120,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/dist/conf/fedora9.conf.php b/install/dist/conf/fedora9.conf.php index 9df56faf8a..350cc0690a 100644 --- a/install/dist/conf/fedora9.conf.php +++ b/install/dist/conf/fedora9.conf.php @@ -118,10 +118,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/dist/conf/gentoo.conf.php b/install/dist/conf/gentoo.conf.php index 7a76c13a9e..d57323ffdc 100644 --- a/install/dist/conf/gentoo.conf.php +++ b/install/dist/conf/gentoo.conf.php @@ -128,10 +128,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['user'] = 'getmail'; diff --git a/install/dist/conf/opensuse112.conf.php b/install/dist/conf/opensuse112.conf.php index 5759faad01..136b8672d2 100644 --- a/install/dist/conf/opensuse112.conf.php +++ b/install/dist/conf/opensuse112.conf.php @@ -118,10 +118,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/dist/conf/ubuntu1604.conf.php b/install/dist/conf/ubuntu1604.conf.php index c18a7c2bf9..264227bab1 100644 --- a/install/dist/conf/ubuntu1604.conf.php +++ b/install/dist/conf/ubuntu1604.conf.php @@ -120,10 +120,6 @@ $conf['mailman']['installed'] = false; // will be detected automatically during $conf['mailman']['config_dir'] = '/etc/mailman'; $conf['mailman']['init_script'] = 'mailman'; -//* mlmmj -$conf['mlmmj']['installed'] = false; // will be detected automatically during installation -$conf['mlmmj']['config_dir'] = '/etc/mlmmj'; - //* Getmail $conf['getmail']['installed'] = false; // will be detected automatically during installation $conf['getmail']['config_dir'] = '/etc/getmail'; diff --git a/install/install.php b/install/install.php index 251de72ad8..a7bcfb3a5d 100644 --- a/install/install.php +++ b/install/install.php @@ -346,13 +346,7 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Configure Mail $inst->configure_mailman(); } - //* Configure mlmmj - if($conf['mlmmj']['installed'] == true) { - swriteln('Configuring Mlmmj'); - $inst->configure_mlmmj(/*install*/); - } - - //* Check for Dovecot and Courier + //* Check for Dovecot if(!$conf['dovecot']['installed']) { $conf['dovecot']['installed'] = $inst->force_configure_app('Dovecot', ($install_mode == 'expert')); } diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index c9e8391dc2..a0690493fe 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -157,7 +157,6 @@ class installer_base { if(is_installed('postfix')) $conf['postfix']['installed'] = true; if(is_installed('postgrey')) $conf['postgrey']['installed'] = true; if(is_installed('mailman') || is_installed('mmsitepass')) $conf['mailman']['installed'] = true; - if(is_installed('mlmmj') || is_installed('mlmmj-make-ml')) $conf['mlmmj']['installed'] = true; if(is_installed('apache') || is_installed('apache2') || is_installed('httpd') || is_installed('httpd2')) $conf['apache']['installed'] = true; if(is_installed('getmail')) $conf['getmail']['installed'] = true; if(is_installed('dovecot')) $conf['dovecot']['installed'] = true; @@ -319,7 +318,7 @@ class installer_base { $tpl_ini_array['web']['group'] = $conf['apache']['group']; $tpl_ini_array['web']['php_ini_path_apache'] = $conf['apache']['php_ini_path_apache']; $tpl_ini_array['web']['php_ini_path_cgi'] = $conf['apache']['php_ini_path_cgi']; - $tpl_ini_array['mail']['mailinglist_manager'] = ($conf['mlmmj']['installed'] == true)?'mlmmj':'mailman'; + $tpl_ini_array['mail']['mailinglist_manager'] = 'mailman'; $tpl_ini_array['dns']['bind_user'] = $conf['bind']['bind_user']; $tpl_ini_array['dns']['bind_group'] = $conf['bind']['bind_group']; $tpl_ini_array['dns']['bind_zonefiles_dir'] = $conf['bind']['bind_zonefiles_dir']; @@ -831,90 +830,6 @@ class installer_base { exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman'); } - public function configure_mlmmj() { - global $conf; - - $configDir = $conf['mlmmj']['config_dir']; - @mkdir($configDir, 0755, true); - - $configFile = 'mlmmj.conf'; - - //* Backup exiting file - if(is_file("$configDir/$configFile")) { - copy("$configDir/$configFile", "$configDir/$configFile~"); - } - - // load files - if(is_file($conf['ispconfig_install_dir']."/server/conf-custom/install/$configFile.master")) { - copy($conf['ispconfig_install_dir']."/server/conf-custom/install/$configFile.master", "$configDir/$configFile"); - } else { - copy("tpl/$configFile.master", "$configDir/$configFile"); - } - - $mlConfig = @parse_ini_file("$configDir/$configFile"); - // Force PHP7 to use # to mark comments - if(PHP_MAJOR_VERSION >= 7) - $mlConfig = array_filter($mlConfig, function($v){return(substr($v,0,1)!=='#');}, ARRAY_FILTER_USE_KEY); - - $command = 'useradd --system mlmmj --home '.$mlConfig['spool_dir'].' --shell /usr/false'; - if(!is_user('mlmmj')) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - @mkdir($mlConfig['spool_dir'], 0755, true); - chown($mlConfig['spool_dir'], 'mlmmj'); - chgrp($mlConfig['spool_dir'], 'mlmmj'); - - // Make a backup copy of master.cf and main.cf files - copy($conf['postfix']['config_dir'].'/main.cf', $conf['postfix']['config_dir'].'/main.cf~mlmmj'); - - //* Update postfix main.cf - $content = rf($conf['postfix']['config_dir'].'/main.cf'); - - if(!preg_match("/^alias_maps = .*hash:\/etc\/mlmmj\/aliases.*/m", $content)) { - $content = preg_replace("/^alias_maps = (.*)/m", "$0, hash:$configDir/aliases", $content); - } - - if(!preg_match("/^alias_database = .*hash:\/etc\/mlmmj\/aliases.*/m", $content)) { - $content = preg_replace("/^alias_database = (.*)/m", "$0, hash:$configDir/aliases", $content); - } - - if(!preg_match("/^virtual_alias_maps = .*hash:\/etc\/mlmmj\/virtual.*/m", $content)) { - $content = preg_replace("/^virtual_alias_maps = (.*)/m", "$0, hash:$configDir/virtual", $content); - } - - if(!preg_match("/^transport_maps = .*hash:\/etc\/mlmmj\/transport.*/m", $content)) { - $content = preg_replace("/transport_maps = (.*)/m", "$0, hash:$configDir/transport", $content); - } - - if(!preg_match("/^mlmmj_destination_recipient_limit.*/m", $content)) { - $content .= "\n# Only deliver one message to Mlmmj at a time\nmlmmj_destination_recipient_limit = 1\n"; - } - - wf($conf['postfix']['config_dir'].'/main.cf', $content); - - //* Update postfix master.cf - $content = rf($conf['postfix']['config_dir'].'/master.cf'); - if(!preg_match('/^mlmmj\s+unix\s+-\s+n\s+n\s+-\s+-\s+pipe\s*$/m', $content)) { - copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~mlmmj'); - $content .= "\n# mlmmj mailing lists\n"; - $content .= "mlmmj unix - n n - - pipe\n"; - $content .= " flags=ORhu user=mlmmj argv=/usr/bin/mlmmj-receive -F -L "; - $content .= $mlConfig['spool_dir']."/\$nexthop\n\n"; - wf($conf['postfix']['config_dir'].'/master.cf', $content); - } - - //* Create aliasaes - touch("$configDir/aliases"); - exec("nohup /usr/sbin/postalias $configDir/aliases >/dev/null 2>&1"); - touch("$configDir/virtual"); - exec("nohup /usr/sbin/postmap $configDir/virtual >/dev/null 2>&1"); - touch("$configDir/transport"); - exec("nohup /usr/sbin/postmap $configDir/transport >/dev/null 2>&1"); - - //* Create/update cron entry - $cronEntry = '0 */2 * * * find /var'.$mlConfig['spool_dir'].'/ -mindepth 1 -maxdepth 1 -type d -exec /usr/bin/mlmmj-maintd -F -d {} \;'; - file_put_contents('/etc/cron.d/mlmmj', $cronEntry); - } - public function get_postfix_service($service, $type) { global $conf; diff --git a/install/tpl/mlmmj.conf.master b/install/tpl/mlmmj.conf.master deleted file mode 100644 index 44ba9e8728..0000000000 --- a/install/tpl/mlmmj.conf.master +++ /dev/null @@ -1,5 +0,0 @@ -# Path of the skeleton for mailing lists -skel_dir = /usr/share/mlmmj/text.skel - -# Where to store ML data and archive -spool_dir = /var/spool/mlmmj \ No newline at end of file diff --git a/install/tpl/server.ini.master b/install/tpl/server.ini.master index 172b68b2fa..2350541547 100644 --- a/install/tpl/server.ini.master +++ b/install/tpl/server.ini.master @@ -57,7 +57,7 @@ overquota_notify_client=y overquota_notify_freq=7 overquota_notify_onok=n sendmail_path=/usr/sbin/sendmail -mailinglist_manager=mlmmj +mailinglist_manager=mailman [getmail] getmail_config_dir=/etc/getmail diff --git a/install/update.php b/install/update.php index 24337fbe02..3c3414f287 100644 --- a/install/update.php +++ b/install/update.php @@ -375,12 +375,6 @@ if($reconfigure_services_answer == 'yes' || $reconfigure_services_answer == 'sel $inst->configure_mailman('update'); } - //* Configure mlmmj - if($conf['mlmmj']['installed'] == true && $inst->reconfigure_app('Mlmmj', $reconfigure_services_answer)) { - swriteln('Configuring Mlmmj'); - $inst->configure_mlmmj(/*update*/); - } - //** Configure Spamasassin if($inst->reconfigure_app('Spamassassin', $reconfigure_services_answer)) { swriteln('Configuring Spamassassin'); diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php index 3eec00e9d8..f4c23d6173 100644 --- a/interface/web/admin/form/server_config.tform.php +++ b/interface/web/admin/form/server_config.tform.php @@ -757,7 +757,7 @@ $form["tabs"]['mail'] = array( 'datatype' => 'VARCHAR', 'formtype' => 'SELECT', 'default' => '20', - 'value' => array('mlmmj' => 'Mlmmj', 'mailman' => 'Mailman') + 'value' => array('mailman' => 'Mailman') ), //################################# // ENDE Datatable fields diff --git a/interface/web/mail/form/mail_mailinglist.tform.php b/interface/web/mail/form/mail_mailinglist.tform.php index 2914e42f83..e5152ec475 100644 --- a/interface/web/mail/form/mail_mailinglist.tform.php +++ b/interface/web/mail/form/mail_mailinglist.tform.php @@ -161,135 +161,3 @@ $form["tabs"]['mailinglist'] = array ( ) ); -if($mlManager == 'mlmmj') { - $form["tabs"]['options'] = array ( - 'title' => "Options", - 'width' => 100, - 'template' => "templates/mail_mailinglist_options.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# - 'admins' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'validators' => array ( - 0 => array ( 'type' => 'ISEMAIL', - 'allowempty' => 'y', - 'separator' => "\n", - 'errmsg'=> 'email_error_isemail'), - ), - 'cols' => '30', - 'rows' => '5' - ), - 'subject_prefix' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255', - ), - 'mail_footer' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'cols' => '30', - 'rows' => '5' - ), - 'archive' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - ) - ); - - $form["tabs"]['privacy'] = array ( - 'title' => "Privacy", - 'width' => 100, - 'template' => "templates/mail_mailinglist_privacy.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# - 'list_type' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'RADIO', - 'regex' => '', - 'errmsg' => '', - 'default' => 'user', - 'value' => array ('open' => 'open_list_txt', 'closed' => 'closed_list_txt'), - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'subscribe_policy' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => 'confirm', - 'value' => array( - 'disabled' => 'sub_disabled_txt', - 'confirm' => 'sub_confirm_txt', - 'approval' => 'sub_approval_txt', - 'both' => 'sub_both_txt', - 'none' => 'sub_none_txt'), - ), - 'posting_policy' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => 'confirm', - 'value' => array( - 'closed' => 'post_closed_txt', - 'moderated' => 'post_moderated_txt', - 'free' => 'post_free_txt'), - ), - ) - ); - - $form["tabs"]['digest'] = array ( - 'title' => "Digest", - 'width' => 100, - 'template' => "templates/mail_mailinglist_digest.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# - 'digesttext' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'digestsub' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'digestinterval' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '7', - 'validators' => array(0 => array('type' => 'ISINT'), - array('type'=>'RANGE', 'range'=>'1:60') - ), - 'value' => '', - 'width' => '15' - ), - 'digestmaxmails' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '50', - 'validators' => array(0 => array('type' => 'ISINT'), - array('type'=>'RANGE', 'range'=>'10:100') - ), - 'value' => '', - 'width' => '15' - ), - ) - ); - -} -?> diff --git a/interface/web/mail/lib/module.conf.php b/interface/web/mail/lib/module.conf.php index 46cfe46812..eaed5de892 100644 --- a/interface/web/mail/lib/module.conf.php +++ b/interface/web/mail/lib/module.conf.php @@ -87,11 +87,6 @@ if($app->auth->get_client_limit($userid, 'mailmailinglist') != 0) 'html_id' => 'mail_mailinglist_list'); $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - if($mlManager == 'mlmmj') - $items[] = array( 'title' => 'Membership', - 'target' => 'content', - 'link' => 'mail/mail_ml_membership_list.php', - 'html_id' => 'mail_ml_membership_list'); } if(count($items) && $app->system->has_service($userid, 'mail')) diff --git a/interface/web/mail/list/mail_ml_membership.list.php b/interface/web/mail/list/mail_ml_membership.list.php deleted file mode 100644 index d23211817c..0000000000 --- a/interface/web/mail/list/mail_ml_membership.list.php +++ /dev/null @@ -1,93 +0,0 @@ - "mailinglist_id", - 'datatype' => "INTEGER", - 'formtype' => "SELECT", - 'op' => "like", - 'prefix' => "", - 'suffix' => "", - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT mailinglist_id, CONCAT_WS(\'@\', listname, domain) as listname FROM mail_mailinglist WHERE {AUTHSQL} ORDER BY listname', - 'keyfield'=> 'mailinglist_id', - 'valuefield'=> 'listname' - ), - 'width' => "", - 'value' => ""); - - -$liste["item"][] = array( 'field' => "email", - 'datatype' => "VARCHAR", - 'filters' => array( 0 => array( 'event' => 'SHOW', - 'type' => 'IDNTOUTF8') - ), - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "%", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "name", - 'datatype' => "VARCHAR", - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "%", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "goodbye_msg", - 'datatype' => "VARCHAR", - 'formtype' => "SELECT", - 'op' => "=", - 'prefix' => "", - 'suffix' => "", - 'width' => "", - 'value' => array('n' => "
".$app->lng('no_txt')."
", 'y' => "
".$app->lng('yes_txt')."
")); diff --git a/interface/web/mail/mail_mailinglist_edit.php b/interface/web/mail/mail_mailinglist_edit.php index 73680c8a18..57d9c77f2e 100644 --- a/interface/web/mail/mail_mailinglist_edit.php +++ b/interface/web/mail/mail_mailinglist_edit.php @@ -197,13 +197,6 @@ class page_action extends tform_actions { function onAfterInsert() { global $app, $conf; - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - if($mlManager == 'mlmmj') { - // The following update is usefull to set the prefix of the new mailinglist as the list name - $sql = 'UPDATE mail_mailinglist SET subject_prefix = ? WHERE mailinglist_id = ?'; - $app->db->query($sql, '['.$this->dataRecord['listname'].']', $this->id); - } - // make sure that the record belongs to the client group and not the admin group when a dmin inserts it // also make sure that the user can not delete domain created by a admin if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { diff --git a/interface/web/mail/mail_ml_membership_del.php b/interface/web/mail/mail_ml_membership_del.php deleted file mode 100644 index d2dcaf542b..0000000000 --- a/interface/web/mail/mail_ml_membership_del.php +++ /dev/null @@ -1,63 +0,0 @@ -auth->check_module_permissions('mail'); - -// Loading classes -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - - function onBeforeDelete() { - global $app; $conf; - - } -} - -$page = new page_action; -$page->onDelete(); - -?> diff --git a/interface/web/mail/mail_ml_membership_edit.php b/interface/web/mail/mail_ml_membership_edit.php deleted file mode 100755 index 60f0f1b21b..0000000000 --- a/interface/web/mail/mail_ml_membership_edit.php +++ /dev/null @@ -1,104 +0,0 @@ -auth->check_module_permissions('mail'); - -// Loading classes -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - - - function onShowNew() { - global $app, $conf; - - //TODO: Add ml members limit - // we will check only users, not admins -// if($_SESSION["s"]["user"]["typ"] == 'user') { -// if(!$app->tform->checkClientLimit('limit_ml_membership')) { -// $app->error($app->tform->wordbook["limit_ml_membership_txt"]); -// } -// if(!$app->tform->checkResellerLimit('limit_ml_membership')) { -// $app->error('Reseller: '.$app->tform->wordbook["limit_ml_membership_txt"]); -// } -// } - - parent::onShowNew(); - } - - function onShowEnd() { - global $app, $conf; - - if($this->id > 0) { - //* we are editing a existing record - $app->tpl->setVar("edit_disabled", 1); - - - $sql = "SELECT mailinglist_id, email FROM mail_ml_membership WHERE subscriber_id = ?"; - $mlID = $app->db->queryOneRecord($sql, $this->id); - if($mlID['mailinglist_id']) $app->tpl->setVar("mailinglist_id_value", $mlID["mailinglist_id"]); - if($mlID['email']) $app->tpl->setVar("email_value", $mlID["email"]); - } else { - $app->tpl->setVar("edit_disabled", 0); - } - - parent::onShowEnd(); - } - - function onBeforeInsert() { - global $app, $conf; - - // Set the server id of the mailinglist members = server ID of mail domain. - $domain = $app->db->queryOneRecord("SELECT server_id FROM mail_mailinglist WHERE mailinglist_id = ?", $this->dataRecord["mailinglist_id"]); - - $this->dataRecord["server_id"] = $domain['server_id']; - } - -} - -$app->tform_actions = new page_action; -$app->tform_actions->onLoad(); - -?> diff --git a/interface/web/mail/mail_ml_membership_list.php b/interface/web/mail/mail_ml_membership_list.php deleted file mode 100644 index 7d5be8a599..0000000000 --- a/interface/web/mail/mail_ml_membership_list.php +++ /dev/null @@ -1,40 +0,0 @@ -auth->check_module_permissions('mail'); - -$app->load('listform_actions'); - -class list_action extends listform_actions { - - function onShow() { - global $app, $conf; - - $app->uses('getconf'); - $global_config = $app->getconf->get_global_config('mail'); - - if($global_config['mailmailinglist_link'] == 'y') { - $app->tpl->setVar('mailmailinglist_link', 1); - } else { - $app->tpl->setVar('mailmailinglist_link', 0); - } - - parent::onShow(); - } - -} - -$list = new list_action; -$list->onLoad(); \ No newline at end of file diff --git a/interface/web/mail/templates/mail_mailinglist_digest.htm b/interface/web/mail/templates/mail_mailinglist_digest.htm deleted file mode 100644 index 57a2c1c667..0000000000 --- a/interface/web/mail/templates/mail_mailinglist_digest.htm +++ /dev/null @@ -1,48 +0,0 @@ - -

-Digest - -
- -
- {tmpl_var name='digestsub'} -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- {tmpl_var name='digesttext'} -
-
- - - -
- - -
- - diff --git a/interface/web/mail/templates/mail_mailinglist_options.htm b/interface/web/mail/templates/mail_mailinglist_options.htm deleted file mode 100644 index 9d0489a165..0000000000 --- a/interface/web/mail/templates/mail_mailinglist_options.htm +++ /dev/null @@ -1,38 +0,0 @@ - -

- -General Options -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- {tmpl_var name='archive'} -
-
- - - -
- - -
- diff --git a/interface/web/mail/templates/mail_mailinglist_privacy.htm b/interface/web/mail/templates/mail_mailinglist_privacy.htm deleted file mode 100644 index 63fe167ade..0000000000 --- a/interface/web/mail/templates/mail_mailinglist_privacy.htm +++ /dev/null @@ -1,44 +0,0 @@ - -

-Privacy - -
- -
- {tmpl_var name='list_type'} -
-
- -
- -
-
- -
- -
-
- - - -
- - -
- - \ No newline at end of file diff --git a/server/plugins-available/mlmmj_plugin.inc.php b/server/plugins-available/mlmmj_plugin.inc.php deleted file mode 100644 index 7f1130e01c..0000000000 --- a/server/plugins-available/mlmmj_plugin.inc.php +++ /dev/null @@ -1,406 +0,0 @@ - 10100 Srl -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of ISPConfig nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* -templates/mail_mailinglist_list.htm -templates/mail_mailinglist_edit.htm - -list/mail_mailinglist.list.php - -form/mail_mailinglist.tform.php - -mailinglist.php -mail_mailinglist_list.php -mail_mailinglist_edit.php -mail_mailinglist_del.php -*/ - -class mlmmj_plugin { - const ML_ALIAS = 0; - const ML_TRANSPORT = 1; - const ML_VIRTUAL = 2; - const SECONDS_IN_DAY = 86400; - - private $plugin_name = 'mlmmj_plugin'; - private $class_name = 'mlmmj_plugin'; - private $mlmmj_config_dir = '/etc/mlmmj/'; - - /* - This function is called during ispconfig installation to determine - if a symlink shall be created for this plugin. - */ - function onInstall() { - global $conf; - - if($conf['services']['mail'] == true) return true; - else return false; - } - - //This function is called when the plugin is loaded - function onLoad() { - global $app; - - // Register for the events - $app->plugins->registerEvent('mail_mailinglist_insert', $this->plugin_name, 'list_insert'); - $app->plugins->registerEvent('mail_mailinglist_update', $this->plugin_name, 'list_update'); - $app->plugins->registerEvent('mail_mailinglist_delete', $this->plugin_name, 'list_delete'); - - $app->plugins->registerEvent('mail_ml_member_insert', $this->plugin_name, 'member_insert'); - $app->plugins->registerEvent('mail_ml_member_update', $this->plugin_name, 'member_update'); - $app->plugins->registerEvent('mail_ml_member_delete', $this->plugin_name, 'member_delete'); - - } - - function list_insert($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $mlConf = $this->getMlConfig(); - $rec = $data['new']; - $listDomain = $rec['domain']; - $listName = $rec['listname']; - $listDir = $mlConf['spool_dir']."/$listDomain/$listName"; - $lang = 'en'; - $owner = $rec['email']; - - // Creating ML directories structure - mkdir("$listDir/incoming", 0755, true); - mkdir("$listDir/queue/discarded", 0755, true); - mkdir("$listDir/archive", 0755, true); - mkdir("$listDir/text", 0755, true); - mkdir("$listDir/subconf", 0755, true); - mkdir("$listDir/unsubconf", 0755, true); - mkdir("$listDir/bounce", 0755, true); - mkdir("$listDir/control", 0755, true); - mkdir("$listDir/moderation", 0755, true); - mkdir("$listDir/subscribers.d", 0755, true); - mkdir("$listDir/digesters.d", 0755, true); - mkdir("$listDir/requeue", 0755, true); - mkdir("$listDir/nomailsubs.d", 0755, true); - - // Creating ML index file - touch("$listDir/index"); - - // Creating default control files - // WARNING: Edit this section if default DB values will be modified! - touch("$listDir/control/nodigestsub"); - touch("$listDir/control/noarchive"); - file_put_contents("$listDir/control/owner", $owner); - file_put_contents("$listDir/control/listaddress", "$listName@$listDomain"); - file_put_contents("$listDir/control/prefix", "[$listName]"); - - // Copying language translations - if(!is_dir("/usr/share/mlmmj/text.skel/$lang")) $lang = 'en'; - foreach (glob("/usr/share/mlmmj/text.skel/$lang/*") as $filename) - copy($filename, "$listDir/text/".basename($filename)); - - // The mailinglist directory have to be owned by the user running the mailserver - $this->changeOwnership($listDir); - - // Creating alias entry - $this->addMapEntry("$listName: \"|/usr/bin/mlmmj-recieve -L $listDir/\"", self::ML_ALIAS); - - // Creating transport entry - $this->addMapEntry("$listDomain--$listName@localhost.mlmmj mlmmj:$listDomain/$listName", self::ML_TRANSPORT); - - // Creating virtual entry - $this->addMapEntry("$listName@$listDomain $listDomain--$listName@localhost.mlmmj", self::ML_VIRTUAL); - } - } - - // The purpose of this plugin is to rewrite the main.cf file - function list_update($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $rec = $data['new']; - $mlConf = $this->getMlConfig(); - - $controlDir = "{$mlConf['spool_dir']}/{$rec['domain']}/{$rec['listname']}/control"; - - // Doesn't matter if the list is open or close, members can ALWAYS unsubscribe - if($rec['list_type'] == 'open') { - switch($rec['subscribe_policy']) { - case 'disabled': - touch("$controlDir/closedlistsub"); - @unlink("$controlDir/submod"); - @unlink("$controlDir/nosubconfirm"); - break; - case 'both': - touch("$controlDir/submod"); - case 'approval': - touch("$controlDir/nosubconfirm"); - @unlink("$controlDir/closedlistsub"); - break; - case 'none': - touch("$controlDir/nosubconfirm"); - @unlink("$controlDir/closedlistsub"); - break; - case 'confirm': - @unlink("$controlDir/nosubconfirm"); - @unlink("$controlDir/closedlistsub"); - @unlink("$controlDir/submod"); - break; - } - - switch($rec['posting_policy']) { - case 'closed': - touch("$controlDir/subonlypost"); - break; - case 'moderated': - touch("$controlDir/modnonsubposts"); - break; - case 'free': - @unlink("$controlDir/modnonsubposts"); - @unlink("$controlDir/subonlypost"); - break; - } - } elseif($rec['list_type'] == 'closed') { - touch("$controlDir/closedlistsub"); - touch("$controlDir/subonlypost"); - @unlink("$controlDir/modnonsubposts"); - @unlink("$controlDir/submod"); - @unlink("$controlDir/nosubconfirm"); - } - - if($rec['digestsub'] == 'y') { - @unlink("$controlDir/nodigestsub"); - if($rec['digesttext'] == 'y') @unlink("$controlDir/nodigesttext"); - else touch("$controlDir/nodigesttext"); - file_put_contents("$controlDir/digestinterval", $rec['digestinterval']*self::SECONDS_IN_DAY); - file_put_contents("$controlDir/digestmaxmails", $rec['digestmaxmails']); - } else { - touch("$controlDir/nodigestsub"); - @unlink("$controlDir/nodigesttext"); - @unlink("$controlDir/digestinterval"); - @unlink("$controlDir/digestmaxmails"); - } - - if($rec['subject_prefix']) - file_put_contents("$controlDir/prefix", $rec['subject_prefix']); - else @unlink("$controlDir/prefix"); - - if($rec['mail_footer']) - file_put_contents("$controlDir/footer", $rec['mail_footer']); - else @unlink("$controlDir/footer"); - - if($rec['archive'] == 'y') - @unlink("$controlDir/noarchive"); - else - touch("$controlDir/noarchive"); - - $this->changeOwnership("$controlDir/*"); - } - } - - function list_delete($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $mlConf = $this->getMlConfig(); - $rec = $data['old']; - $listDomain = $rec['domain']; - $listName = $rec['listname']; - $listDir = $mlConf['spool_dir']."/$listDomain/$listName"; - - // Remove ML directory structure - $this->rmdirR($listDir); - @rmdir($mlConf['spool_dir']."/$listDomain"); - - // Removing alias entry - $this->delMapEntry("$listName: \"|/usr/bin/mlmmj-recieve -L $listDir/\"", self::ML_ALIAS); - - // Removing transport entry - $this->delMapEntry("$listDomain--$listName@localhost.mlmmj mlmmj:$listDomain/$listName", self::ML_TRANSPORT); - - // Removing virtual entry - $this->delMapEntry("$listName@$listDomain $listDomain--$listName@localhost.mlmmj", self::ML_VIRTUAL); - } - } - - function member_insert($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $mlConf = $this->getMlConfig(); - - $rec = $data['new']; - - $sql = "SELECT * FROM mail_mailinglist WHERE mailinglist_id = ?"; - $ml = $app->db->queryOneRecord($sql, $rec['mailinglist_id']); - if($ml['mailinglist_id']) { - $listDomain = $ml['domain']; - $listName = $ml['listname']; - $listDir = $mlConf['spool_dir']."/$listDomain/$listName"; - } - - $welcome = ($rec['welcome_msg'] == 'y')?'-c':''; - $command = "/usr/bin/mlmmj-sub -q -s -L $listDir $welcome -a ".$rec['email']; - exec("nohup $command>/dev/null 2>&1"); - } - } - - function member_update($event_name, $data) { - //TODO: Implement something usefull on update event (e.g. change to digest subscription) - } - - function member_delete($event_name, $data) { - global $app, $conf; - - $mlManager = $app->getconf->get_server_config($conf['server_id'], 'mail')['mailinglist_manager']; - - if($mlManager == 'mlmmj') { - $mlConf = $this->getMlConfig(); - - $rec = $data['old']; - - $sql = "SELECT * FROM mail_mailinglist WHERE mailinglist_id = ?"; - $ml = $app->db->queryOneRecord($sql, $rec['mailinglist_id']); - if($ml['mailinglist_id']) { - $listDomain = $ml['domain']; - $listName = $ml['listname']; - $listDir = $mlConf['spool_dir']."/$listDomain/$listName"; - } - - $goodbye = ($rec['goodbye_msg'] == 'y')?'-c':''; - $command = "/usr/bin/mlmmj-unsub -q -s -L $listDir $goodbye -a ".$rec['email']; - exec("nohup $command>/dev/null 2>&1"); - } - } - - private function getMlConfig() { - $mlConfig = @parse_ini_file($this->mlmmj_config_dir.'mlmmj.conf'); - - // Force PHP7 to use # to mark comments - if(PHP_MAJOR_VERSION >= 7 && is_array($mlConfig)) - $mlConfig = array_filter($mlConfig, function($v){return(substr($v,0,1)!=='#');}, ARRAY_FILTER_USE_KEY); - - return $mlConfig; - } - - private function changeOwnership($path, $recursive=true) { - if(basename($path) == '*') $path = dirname($path); - - if(is_dir($path)) { - if($objs = glob($path."/*")) { - foreach($objs as $obj) { - chown($obj, 'mlmmj'); - chgrp($obj, 'mlmmj'); - if(is_dir($obj) && $recursive) $this->changeOwnership($obj); - } - } - } - - return chown($path, 'mlmmj') && chgrp($path, 'mlmmj'); - } - - private function rmdirR($path) { - if(is_dir($path) === true) { - $files = array_diff(scandir($path), array('.', '..')); - foreach($files as $file) $this->rmdirR(realpath($path) . '/' . $file); - - return rmdir($path); - } elseif(is_file($path) === true) return unlink($path); - - return false; - } - - private function addMapEntry($directive, $type) { - - $destFile = $this->mlmmj_config_dir; - switch($type) { - case self::ML_ALIAS: - $destFile .= 'aliases'; - $command = 'postalias'; - break; - case self::ML_TRANSPORT: - $destFile .= 'transport'; - $command = 'postmap'; - break; - case self::ML_VIRTUAL: - $destFile .= 'virtual'; - $command = 'postmap'; - break; - } - - $lines = file($destFile, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); - $lines[] = $directive; - - file_put_contents($destFile, implode("\n", array_unique($lines))); - exec("nohup /usr/sbin/$command $destFile >/dev/null 2>&1 &"); - } - - private function delMapEntry($directive, $type) { - - $destFile = $this->mlmmj_config_dir; - switch($type) { - case self::ML_ALIAS: - $destFile .= 'aliases'; - $command = 'postalias'; - break; - case self::ML_TRANSPORT: - $destFile .= 'transport'; - $command = 'postmap'; - break; - case self::ML_VIRTUAL: - $destFile .= 'virtual'; - $command = 'postmap'; - break; - } - - $lines = file($destFile, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); - - foreach(array_keys($lines, $directive) as $key) unset($lines[$key]); - - file_put_contents($destFile, implode("\n", array_unique($lines))); - exec("nohup /usr/sbin/$command $destFile >/dev/null 2>&1 &"); - } - - private function checkSys() { - if(!is_dir($this->mlmmj_config_dir)) mkdir($this->mlmmj_config_dir, 0755); - if(!file_exists($this->mlmmj_config_dir.'mlmmj.conf')) { - file_put_contents($this->mlmmj_config_dir.'mlmmj.conf', 'skel_dir = /usr/share/mlmmj/text.skel'); - file_put_contents($this->mlmmj_config_dir.'mlmmj.conf', 'spool_dir = /var/spool/mlmmj', FILE_APPEND); - } - if(!file_exists($this->mlmmj_config_dir.'aliases')) touch($this->mlmmj_config_dir.'aliases'); - if(!file_exists($this->mlmmj_config_dir.'transport')) touch($this->mlmmj_config_dir.'transport'); - if(!file_exists($this->mlmmj_config_dir.'virtual')) touch($this->mlmmj_config_dir.'virtual'); - } -} // end class - -?> -- GitLab