*) Added Mailman integration
28 files modified
14 files added
| | |
| | | swriteln('Configuring Postfix'); |
| | | $inst->configure_postfix('dont-create-certs'); |
| | | |
| | | //** Configure mailman
|
| | | swriteln('Configuring Mailman');
|
| | | $inst->configure_mailman('update');
|
| | |
|
| | | //* Configure Jailkit |
| | | swriteln('Configuring Jailkit'); |
| | | $inst->configure_jailkit(); |
| | |
| | | if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); |
| | | if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); |
| | | if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); |
| | | if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart');
|
| | | } |
| | | if($conf['services']['web']) { |
| | | if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); |
| | |
| | | $conf['postfix']['vmail_groupname'] = 'vmail'; |
| | | $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; |
| | | |
| | | //* Mailman
|
| | | $conf['mailman']['installed'] = false; // will be detected automatically during installation
|
| | | $conf['mailman']['config_dir'] = '/etc/mailman';
|
| | | $conf['mailman']['init_script'] = 'mailman';
|
| | |
|
| | | //* Getmail |
| | | $conf['getmail']['installed'] = false; // will be detected automatically during installation |
| | | $conf['getmail']['config_dir'] = '/etc/getmail'; |
| | |
| | | $conf['postfix']['vmail_groupname'] = 'vmail'; |
| | | $conf['postfix']['vmail_mailbox_base'] = '/var/vmail'; |
| | | |
| | | //* Mailman
|
| | | $conf['mailman']['installed'] = false; // will be detected automatically during installation
|
| | | $conf['mailman']['config_dir'] = '/etc/mailman';
|
| | | $conf['mailman']['init_script'] = 'mailman';
|
| | |
|
| | | //* Getmail |
| | | $conf['getmail']['installed'] = false; // will be detected automatically during installation |
| | | $conf['getmail']['config_dir'] = '/etc/getmail'; |
| | |
| | | //* Configure Postfix |
| | | $inst->configure_postfix(); |
| | | |
| | | //* Configure Mailman
|
| | | $inst->configure_mailman('install');
|
| | | |
| | | //* Configure jailkit |
| | | swriteln('Configuring Jailkit'); |
| | | $inst->configure_jailkit(); |
| | |
| | | if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); |
| | | if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); |
| | | if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); |
| | | if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart');
|
| | | if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); |
| | | if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); |
| | | if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); |
| | |
| | | swriteln('Configuring Postfix'); |
| | | $inst->configure_postfix(); |
| | | |
| | | //* Configure Mailman
|
| | | swriteln('Configuring Mailman');
|
| | | $inst->configure_mailman();
|
| | |
|
| | | if($conf['dovecot']['installed'] == true) { |
| | | //* Configure dovecot |
| | | swriteln('Configuring Dovecot'); |
| | |
| | | if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); |
| | | if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); |
| | | if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); |
| | | if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart');
|
| | | } |
| | | |
| | | //** Configure Jailkit |
| | |
| | | |
| | | if(is_installed('mysql') || is_installed('mysqld')) $conf['mysql']['installed'] = true; |
| | | if(is_installed('postfix')) $conf['postfix']['installed'] = true; |
| | | if(is_installed('mailman')) $conf['mailman']['installed'] = true;
|
| | | if(is_installed('apache') || is_installed('apache2') || is_installed('httpd')) $conf['apache']['installed'] = true; |
| | | if(is_installed('getmail')) $conf['getmail']['installed'] = true; |
| | | if(is_installed('courierlogger')) $conf['courier']['installed'] = true; |
| | |
| | | |
| | | } |
| | | |
| | | public function configure_mailman($status = 'insert') {
|
| | | global $conf;
|
| | |
|
| | | $config_dir = $conf['mailman']['config_dir'].'/';
|
| | | $full_file_name = $config_dir.'mm_cfg.py';
|
| | | //* Backup exiting file
|
| | | if(is_file($full_file_name)) {
|
| | | copy($full_file_name, $config_dir.'mm_cfg.py~');
|
| | | }
|
| | | |
| | | // load files
|
| | | $content = rf('tpl/mm_cfg.py.master');
|
| | | $old_file = rf($full_file_name);
|
| | | |
| | | $old_options = array();
|
| | | $lines = explode("\n", $old_file); |
| | | foreach ($lines as $line)
|
| | | {
|
| | | if (strlen($line) && substr($line, 0, 1) != '#')
|
| | | {
|
| | | list($key, $value) = explode("=", $line);
|
| | | if (!empty($value))
|
| | | {
|
| | | $key = rtrim($key);
|
| | | $old_options[$key] = trim($value);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | $virtual_domains = '';
|
| | | if($status == 'update')
|
| | | {
|
| | | // create virtual_domains list
|
| | | $domainAll = $this->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain");
|
| | | |
| | | foreach($domainAll as $domain)
|
| | | {
|
| | | if ($domainAll[0]['domain'] == $domain['domain'])
|
| | | $virtual_domains .= "'".$domain['domain']."'";
|
| | | else
|
| | | $virtual_domains .= ", '".$domain['domain']."'";
|
| | | }
|
| | | }
|
| | | else
|
| | | $virtual_domains = "' '";
|
| | | |
| | | $content = str_replace('{hostname}', $conf['hostname'], $content);
|
| | | $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content);
|
| | | $content = str_replace('{virtual_domains}', $virtual_domains, $content);
|
| | |
|
| | | wf($full_file_name, $content);
|
| | | }
|
| | |
|
| | | public function configure_postfix($options = '') { |
| | | global $conf; |
| | | $cf = $conf['postfix']; |
New file |
| | |
| | | ALTER TABLE client ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1';
|
| | | ALTER TABLE client_template ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1';
|
| | |
|
| | | CREATE TABLE IF NOT EXISTS `mail_mailinglist` (
|
| | | `mailinglist_id` int(11) unsigned NOT NULL auto_increment,
|
| | | `sys_userid` int(11) unsigned NOT NULL default '0',
|
| | | `sys_groupid` int(11) unsigned NOT NULL default '0',
|
| | | `sys_perm_user` varchar(5) NOT NULL,
|
| | | `sys_perm_group` varchar(5) character set ucs2 NOT NULL,
|
| | | `sys_perm_other` varchar(5) NOT NULL,
|
| | | `server_id` int(11) unsigned NOT NULL default '0',
|
| | | `domain` varchar(255) NOT NULL,
|
| | | `listname` varchar(255) NOT NULL,
|
| | | `email` varchar(255) NOT NULL,
|
| | | `password` varchar(255) NOT NULL,
|
| | | PRIMARY KEY (`mailinglist_id`)
|
| | | ) ENGINE=MyISAM AUTO_INCREMENT=1;
|
| | |
|
| | | DROP TABLE `mail_mailman_domain`; |
| | |
| | | `limit_cron_frequency` int(11) NOT NULL default '5', |
| | | `limit_traffic_quota` int(11) NOT NULL default '-1', |
| | | `limit_client` int(11) NOT NULL default '0', |
| | | `limit_mailmailinglist` int(11) NOT NULL default '-1',
|
| | | `parent_client_id` int(11) unsigned NOT NULL default '0', |
| | | `username` varchar(64) default NULL, |
| | | `password` varchar(64) default NULL, |
| | |
| | | `limit_cron_frequency` int(11) NOT NULL default '5', |
| | | `limit_traffic_quota` int(11) NOT NULL default '-1', |
| | | `limit_client` int(11) NOT NULL default '0', |
| | | `limit_mailmailinglist` int(11) NOT NULL default '-1',
|
| | | PRIMARY KEY (`template_id`) |
| | | ) ENGINE=MyISAM AUTO_INCREMENT=1; |
| | | |
| | |
| | | -- -------------------------------------------------------- |
| | | |
| | | -- |
| | | -- Table structure for table `mail_mailman_domain` |
| | | -- Tabellenstruktur für Tabelle `mail_mailinglist`
|
| | | -- |
| | | |
| | | CREATE TABLE `mail_mailman_domain` ( |
| | | `mailman_id` int(11) unsigned NOT NULL auto_increment, |
| | | CREATE TABLE `mail_mailinglist` (
|
| | | `mailinglist_id` int(11) unsigned NOT NULL auto_increment,
|
| | | `sys_userid` int(11) unsigned NOT NULL default '0',
|
| | | `sys_groupid` int(11) unsigned NOT NULL default '0',
|
| | | `sys_perm_user` varchar(5) NOT NULL,
|
| | | `sys_perm_group` varchar(5) NOT NULL,
|
| | | `sys_perm_other` varchar(5) NOT NULL,
|
| | | `server_id` int(11) unsigned NOT NULL default '0', |
| | | `domain` varchar(255) NOT NULL default '', |
| | | `mm_home` varchar(255) NOT NULL default '', |
| | | `mm_wrap` varchar(255) NOT NULL default '', |
| | | `mm_user` varchar(50) NOT NULL default '', |
| | | `mm_group` varchar(50) NOT NULL default '', |
| | | PRIMARY KEY (`mailman_id`,`server_id`,`domain`) |
| | | `domain` varchar(255) NOT NULL,
|
| | | `listname` varchar(255) NOT NULL,
|
| | | `email` varchar(255) NOT NULL,
|
| | | `password` varchar(255) NOT NULL,
|
| | | PRIMARY KEY (`mailinglist_id`)
|
| | | ) ENGINE=MyISAM AUTO_INCREMENT=1; |
| | | |
| | | -- -------------------------------------------------------- |
New file |
| | |
| | | # -*- python -*- |
| | | |
| | | # Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc. |
| | | # |
| | | # This program is free software; you can redistribute it and/or |
| | | # modify it under the terms of the GNU General Public License |
| | | # as published by the Free Software Foundation; either version 2 |
| | | # of the License, or (at your option) any later version. |
| | | # |
| | | # This program is distributed in the hope that it will be useful, |
| | | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | # GNU General Public License for more details. |
| | | # |
| | | # You should have received a copy of the GNU General Public License |
| | | # along with this program; if not, write to the Free Software |
| | | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| | | # 02110-1301 USA |
| | | |
| | | |
| | | """This is the module which takes your site-specific settings. |
| | | |
| | | From a raw distribution it should be copied to mm_cfg.py. If you |
| | | already have an mm_cfg.py, be careful to add in only the new settings |
| | | you want. The complete set of distributed defaults, with annotation, |
| | | are in ./Defaults. In mm_cfg, override only those you want to |
| | | change, after the |
| | | |
| | | from Defaults import * |
| | | |
| | | line (see below). |
| | | |
| | | Note that these are just default settings - many can be overridden via the |
| | | admin and user interfaces on a per-list or per-user basis. |
| | | |
| | | Note also that some of the settings are resolved against the active list |
| | | setting by using the value as a format string against the |
| | | list-instance-object's dictionary - see the distributed value of |
| | | DEFAULT_MSG_FOOTER for an example.""" |
| | | |
| | | |
| | | ####################################################### |
| | | # Here's where we get the distributed defaults. # |
| | | |
| | | from Defaults import * |
| | | |
| | | ############################################################## |
| | | # Put YOUR site-specific configuration below, in mm_cfg.py . # |
| | | # See Defaults.py for explanations of the values. # |
| | | |
| | | #------------------------------------------------------------- |
| | | # The name of the list Mailman uses to send password reminders |
| | | # and similar. Don't change if you want mailman-owner to be |
| | | # a valid local part. |
| | | MAILMAN_SITE_LIST = 'mailman' |
| | | |
| | | #------------------------------------------------------------- |
| | | # If you change these, you have to configure your http server |
| | | # accordingly (Alias and ScriptAlias directives in most httpds) |
| | | DEFAULT_URL_PATTERN = 'http://%s/cgi-bin/mailman/' |
| | | PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private' |
| | | IMAGE_LOGOS = '/images/mailman/' |
| | | |
| | | #------------------------------------------------------------- |
| | | # Default domain for email addresses of newly created MLs |
| | | DEFAULT_EMAIL_HOST = '{hostname}' |
| | | #------------------------------------------------------------- |
| | | # Default host for web interface of newly created MLs |
| | | DEFAULT_URL_HOST = '{hostname}' |
| | | #------------------------------------------------------------- |
| | | # Required when setting any of its arguments. |
| | | add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) |
| | | |
| | | #------------------------------------------------------------- |
| | | # The default language for this server. |
| | | DEFAULT_SERVER_LANGUAGE = {default_language} |
| | | |
| | | #------------------------------------------------------------- |
| | | # Iirc this was used in pre 2.1, leave it for now |
| | | USE_ENVELOPE_SENDER = 0 # Still used? |
| | | |
| | | #------------------------------------------------------------- |
| | | # Unset send_reminders on newly created lists |
| | | DEFAULT_SEND_REMINDERS = 0 |
| | | |
| | | #------------------------------------------------------------- |
| | | # Uncomment this if you configured your MTA such that it |
| | | # automatically recognizes newly created lists. |
| | | # (see /usr/share/doc/mailman/README.Exim4.Debian or |
| | | # /usr/share/mailman/postfix-to-mailman.py) |
| | | # MTA=None # Misnomer, suppresses alias output on newlist |
| | | |
| | | #------------------------------------------------------------- |
| | | # Uncomment if you use Postfix virtual domains (but not |
| | | # postfix-to-mailman.py), but be sure to see |
| | | # /usr/share/doc/mailman/README.Debian first. |
| | | MTA='Postfix' |
| | | POSTFIX_STYLE_VIRTUAL_DOMAINS = [{virtual_domains}] |
| | | #------------------------------------------------------------- |
| | | # Uncomment if you want to filter mail with SpamAssassin. For |
| | | # more information please visit this website: |
| | | # http://www.jamesh.id.au/articles/mailman-spamassassin/ |
| | | # GLOBAL_PIPELINE.insert(1, 'SpamAssassin') |
| | | |
| | | # Note - if you're looking for something that is imported from mm_cfg, but you |
| | | # didn't find it above, it's probably in /usr/lib/mailman/Mailman/Defaults.py. |
| | |
| | | swriteln('Configuring Postfix'); |
| | | $inst->configure_postfix('dont-create-certs'); |
| | | |
| | | //** Configure mailman
|
| | | swriteln('Configuring Mailman');
|
| | | $inst->configure_mailman('update');
|
| | | |
| | | //* Configure Jailkit |
| | | swriteln('Configuring Jailkit'); |
| | | $inst->configure_jailkit(); |
| | |
| | | if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); |
| | | if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); |
| | | if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); |
| | | if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart');
|
| | | } |
| | | if($conf['services']['web']) { |
| | | if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); |
| | |
| | | return $affected_rows; |
| | | } |
| | | |
| | | //* Get mail mailinglist details
|
| | | public function mail_mailinglist_get($session_id, $primary_id)
|
| | | {
|
| | | global $app;
|
| | | |
| | | if(!$this->checkPerm($session_id, 'mail_mailinglist_get')) {
|
| | | $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
|
| | | return false;
|
| | | }
|
| | | $app->uses('remoting_lib');
|
| | | $app->remoting_lib->loadFormDef('../mail/form/mail_mailinglist.tform.php');
|
| | | return $app->remoting_lib->getDataRecord($primary_id);
|
| | | }
|
| | | |
| | | //* Add a mail mailinglist
|
| | | public function mail_mailinglist_add($session_id, $client_id, $params)
|
| | | {
|
| | | if(!$this->checkPerm($session_id, 'mail_mailinglist_add')) {
|
| | | $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
|
| | | return false;
|
| | | }
|
| | | $primary_id = $this->insertQuery('../mail/form/mail_mailinglist.tform.php',$client_id,$params);
|
| | | return $primary_id;
|
| | | }
|
| | | |
| | | //* Update a mail mailinglist
|
| | | public function mail_mailinglist_update($session_id, $client_id, $primary_id, $params)
|
| | | {
|
| | | if(!$this->checkPerm($session_id, 'mail_mailinglist_update')) {
|
| | | $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
|
| | | return false;
|
| | | }
|
| | | $affected_rows = $this->updateQuery('../mail/form/mail_mailinglist.tform.php', $client_id, $primary_id, $params);
|
| | | return $affected_rows;
|
| | | }
|
| | | |
| | | //* Delete a mail mailinglist
|
| | | public function mail_mailinglist_delete($session_id, $primary_id)
|
| | | {
|
| | | if(!$this->checkPerm($session_id, 'mail_mailinglist_delete')) {
|
| | | $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
|
| | | return false;
|
| | | }
|
| | | $affected_rows = $this->deleteQuery('../mail/form/mail_mailinglist.tform.php', $primary_id);
|
| | | return $affected_rows;
|
| | | }
|
| | | |
| | | //* Get mail user details |
| | | public function mail_user_get($session_id, $primary_id) |
| | | { |
| | |
| | | |
| | | $function_list = array(); |
| | | $function_list['mail_domain_get,mail_domain_add,mail_domain_update,mail_domain_delete,mail_domain_set_status,mail_domain_get_by_domain'] = 'Mail domain functions'; |
| | | $function_list['mail_mailinglist_get,mail_mailinglist_add,mail_mailinglist_update,mail_mailinglist_delete'] = 'Mail mailinglist functions';
|
| | | $function_list['mail_user_get,mail_user_add,mail_user_update,mail_user_delete'] = 'Mail user functions'; |
| | | $function_list['mail_alias_get,mail_alias_add,mail_alias_update,mail_alias_delete'] = 'Mail alias functions'; |
| | | $function_list['mail_forward_get,mail_forward_add,mail_forward_update,mail_forward_delete'] = 'Mail forward functions'; |
| | |
| | | 'width' => '30', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'mailmailinglist_link' => array (
|
| | | 'datatype' => 'VARCHAR',
|
| | | 'formtype' => 'CHECKBOX',
|
| | | 'default' => 'n',
|
| | | 'value' => array(0 => 'n',1 => 'y')
|
| | | ),
|
| | | 'mailmailinglist_url' => array (
|
| | | 'datatype' => 'VARCHAR',
|
| | | 'formtype' => 'TEXT',
|
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX',
|
| | | 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/',
|
| | | 'errmsg'=> 'mailinglist_url_error_regex'),
|
| | | ),
|
| | | 'default' => '',
|
| | | 'value' => '',
|
| | | 'width' => '30',
|
| | | 'maxlength' => '255'
|
| | | ),
|
| | | 'admin_mail' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | |
| | | $wb['password_error_empty'] = 'Password cannot be empty'; |
| | | $wb['password_strength_txt'] = 'Password Strength:'; |
| | | $wb['Mail domain functions'] = 'Mail domain functions'; |
| | | $wb['Mail mailing list functions'] = 'Mail mailinglist functions'; |
| | | $wb['Mail user functions'] = 'Mail user functions'; |
| | | $wb['Mail alias functions'] = 'Mail alias functions'; |
| | | $wb['Mail forward functions'] = 'Mail forward functions'; |
| | |
| | | $wb["dblist_phpmyadmin_link_txt"] = 'Link to phpmyadmin in DB list'; |
| | | $wb["mailboxlist_webmail_link_txt"] = 'Link to webmail in Mailbox list'; |
| | | $wb["webmail_url_txt"] = 'Webmail URL'; |
| | | $wb["mailmailinglist_link_txt"] = 'Link to mailing list in Mailing list list'; |
| | | $wb["mailmailinglist_url_txt"] = 'Mailing list URL'; |
| | | $wb["phpmyadmin_url_txt"] = 'PHPMyAdmin URL'; |
| | | $wb["use_domain_module_txt"] = 'Use the domain-module to add new domains'; |
| | | $wb["use_domain_module_hint"] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They cannot free edit the domain-field.You have to re-login after changing this value, to make the changes visible.'; |
| | |
| | | <label for="webmail_url">{tmpl_var name='webmail_url_txt'}</label> |
| | | <input name="webmail_url" id="webmail_url" value="{tmpl_var name='webmail_url'}" size="30" maxlength="255" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='mailmailinglist_link_txt'}</p> |
| | | <div class="multiField"> |
| | | {tmpl_var name='mailmailinglist_link'} |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="mailmailinglist_url">{tmpl_var name='mailmailinglist_url_txt'}</label> |
| | | <input name="mailmailinglist_url" id="mailmailinglist_url" value="{tmpl_var name='mailmailinglist_url'}" size="30" maxlength="255" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="admin_mail">{tmpl_var name='admin_mail_txt'}</label> |
| | | <input name="admin_mail" id="admin_mail" value="{tmpl_var name='admin_mail'}" size="30" maxlength="255" type="text" class="textInput" /> |
| | |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | ), |
| | | 'limit_mailmailinglist' => array (
|
| | | 'datatype' => 'INTEGER',
|
| | | 'formtype' => 'TEXT',
|
| | | 'validators' => array ( 0 => array ( 'type' => 'ISINT',
|
| | | 'errmsg'=> 'limit_mailmailinglist_error_notint'),
|
| | | ),
|
| | | 'default' => '-1',
|
| | | 'value' => '',
|
| | | 'separator' => '',
|
| | | 'width' => '10',
|
| | | 'maxlength' => '10',
|
| | | 'rows' => '',
|
| | | 'cols' => ''
|
| | | ),
|
| | | 'limit_mailforward' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'TEXT', |
| | |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | ), |
| | | 'limit_mailmailinglist' => array (
|
| | | 'datatype' => 'INTEGER',
|
| | | 'formtype' => 'TEXT',
|
| | | 'validators' => array ( 0 => array ( 'type' => 'ISINT',
|
| | | 'errmsg'=> 'limit_mailmailinglist_error_notint'),
|
| | | ),
|
| | | 'default' => '-1',
|
| | | 'value' => '',
|
| | | 'separator' => '',
|
| | | 'width' => '10',
|
| | | 'maxlength' => '10',
|
| | | 'rows' => '',
|
| | | 'cols' => ''
|
| | | ),
|
| | | 'limit_mailforward' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'TEXT', |
| | |
| | | 'rows' => '', |
| | | 'cols' => '' |
| | | ), |
| | | 'limit_mailmailinglist' => array (
|
| | | 'datatype' => 'INTEGER',
|
| | | 'formtype' => 'TEXT',
|
| | | 'validators' => array ( 0 => array ( 'type' => 'ISINT',
|
| | | 'errmsg'=> 'limit_mailmailinglist_error_notint'),
|
| | | ),
|
| | | 'default' => '-1',
|
| | | 'value' => '',
|
| | | 'separator' => '',
|
| | | 'width' => '10',
|
| | | 'maxlength' => '10',
|
| | | 'rows' => '',
|
| | | 'cols' => ''
|
| | | ),
|
| | | 'limit_mailbox' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'TEXT', |
| | |
| | | <?php |
| | | $wb["limit_maildomain_txt"] = 'Max. number of email domains'; |
| | | $wb["limit_mailmailinglist_txt"] = 'Max. number of mailing lists'; |
| | | $wb["limit_mailbox_txt"] = 'Max. number of mailboxes'; |
| | | $wb["limit_mailalias_txt"] = 'Max. number of email aliases'; |
| | | $wb["limit_mailaliasdomain_txt"] = 'Max. number of domain aliases'; |
| | |
| | | $wb["username_error_empty"] = 'Username is empty.'; |
| | | $wb["username_error_unique"] = 'The username must be unique.'; |
| | | $wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.'; |
| | | $wb["limit_mailmailinglist_error_notint"] = 'The mailing list record limit must be a number.'; |
| | | $wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.'; |
| | | $wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.'; |
| | | $wb["limit_mailaliasdomain_error_notint"] = 'The email domain alias limit must be a number.'; |
| | |
| | | $wb["limit_mailbox_txt"] = 'Max. number of mailboxes'; |
| | | $wb["limit_mailalias_txt"] = 'Max. number of email aliases'; |
| | | $wb["limit_mailaliasdomain_txt"] = 'Max. number of domain aliases'; |
| | | $wb["limit_mailmailinglist_txt"] = 'Max. number of mailing lists'; |
| | | $wb["limit_mailforward_txt"] = 'Max. number of email forwarders'; |
| | | $wb["limit_mailcatchall_txt"] = 'Max. number of email catchall accounts'; |
| | | $wb["limit_mailrouting_txt"] = 'Max. number of email routes'; |
| | |
| | | $wb["limit_webdav_user_txt"] = 'Max. number of Webdav users'; |
| | | $wb["limit_client_txt"] = 'Max. number of Clients'; |
| | | $wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.'; |
| | | $wb["limit_mailmailinglist_error_notint"] = 'The mailing list record limit must be a number.'; |
| | | $wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.'; |
| | | $wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.'; |
| | | $wb["limit_mailaliasdomain_error_notint"] = 'The email domain alias limit must be a number.'; |
| | |
| | | <?php |
| | | $wb["limit_maildomain_txt"] = 'Max. number of email domains'; |
| | | $wb["limit_mailmailinglist_txt"] = 'Max. number of mailing lists'; |
| | | $wb["limit_mailbox_txt"] = 'Max. number of mailboxes'; |
| | | $wb["limit_mailalias_txt"] = 'Max. number of email aliases'; |
| | | $wb["limit_mailforward_txt"] = 'Max. number of email forwarders'; |
| | |
| | | $wb["username_error_empty"] = 'Username is empty.'; |
| | | $wb["username_error_unique"] = 'The username must be unique.'; |
| | | $wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.'; |
| | | $wb["limit_mailmailinglist_error_notint"] = 'The mailing list record limit must be a number.'; |
| | | $wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.'; |
| | | $wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.'; |
| | | $wb["limit_mailforward_error_notint"] = 'The email forward limit must be a number.'; |
| | |
| | | <input name="limit_mailaliasdomain" id="limit_mailaliasdomain" value="{tmpl_var name='limit_mailaliasdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="limit_mailmailinglist">{tmpl_var name='limit_mailmailinglist_txt'}</label>
|
| | | <input name="limit_mailmailinglist" id="limit_mailmailinglist" value="{tmpl_var name='limit_mailmailinglist'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
|
| | | </div>
|
| | | <div class="ctrlHolder">
|
| | | <label for="limit_mailforward">{tmpl_var name='limit_mailforward_txt'}</label> |
| | | <input name="limit_mailforward" id="limit_mailforward" value="{tmpl_var name='limit_mailforward'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | |
| | | <input name="limit_mailaliasdomain" id="limit_mailaliasdomain" value="{tmpl_var name='limit_mailaliasdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="limit_mailmailinglist">{tmpl_var name='limit_mailmailinglist_txt'}</label>
|
| | | <input name="limit_mailmailinglist" id="limit_mailmailinglist" value="{tmpl_var name='limit_mailmailinglist'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
|
| | | </div>
|
| | | <div class="ctrlHolder">
|
| | | <label for="limit_mailforward">{tmpl_var name='limit_mailforward_txt'}</label> |
| | | <input name="limit_mailforward" id="limit_mailforward" value="{tmpl_var name='limit_mailforward'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | |
| | | <input name="limit_maildomain" id="limit_maildomain" value="{tmpl_var name='limit_maildomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="limit_mailmailinglist">{tmpl_var name='limit_mailmailinglist_txt'}</label>
|
| | | <input name="limit_mailmailinglist" id="limit_mailmailinglist" value="{tmpl_var name='limit_mailmailinglist'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
|
| | | </div>
|
| | | <div class="ctrlHolder">
|
| | | <label for="limit_mailbox">{tmpl_var name='limit_mailbox_txt'}</label> |
| | | <input name="limit_mailbox" id="limit_mailbox" value="{tmpl_var name='limit_mailbox'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" /> |
| | | </div> |
| | |
| | | 'db_table' => 'mail_domain',
|
| | | 'db_where' => '');
|
| | |
|
| | | $limits[] = array('field' => 'limit_mailmailinglist',
|
| | | 'db_table' => 'mail_mailinglist',
|
| | | 'db_where' => '');
|
| | | |
| | | $limits[] = array('field' => 'limit_mailbox',
|
| | | 'db_table' => 'mail_user',
|
| | | 'db_where' => '');
|
| | |
| | | $wb['of_txt'] = "of"; |
| | | $wb['unlimited_txt'] = "Unlimited"; |
| | | $wb['limit_maildomain_txt'] = "Number of email domains"; |
| | | $wb['limit_mailmailinglist_txt'] = "Number of mailing lists"; |
| | | $wb['limit_mailbox_txt'] = "Number of mailboxes"; |
| | | $wb["limit_mailalias_txt"] = 'Number of email aliases'; |
| | | $wb["limit_mailaliasdomain_txt"] = 'Number of domain aliases'; |
New file |
| | |
| | | <?php
|
| | |
|
| | | /*
|
| | | Form Definition
|
| | |
|
| | | Tabledefinition
|
| | |
|
| | | Datatypes:
|
| | | - INTEGER (Forces the input to Int)
|
| | | - DOUBLE
|
| | | - CURRENCY (Formats the values to currency notation)
|
| | | - VARCHAR (no format check, maxlength: 255)
|
| | | - TEXT (no format check)
|
| | | - DATE (Dateformat, automatic conversion to timestamps)
|
| | |
|
| | | Formtype:
|
| | | - TEXT (Textfield)
|
| | | - TEXTAREA (Textarea)
|
| | | - PASSWORD (Password textfield, input is not shown when edited)
|
| | | - SELECT (Select option field)
|
| | | - RADIO
|
| | | - CHECKBOX
|
| | | - CHECKBOXARRAY
|
| | | - FILE
|
| | |
|
| | | VALUE:
|
| | | - Wert oder Array
|
| | |
|
| | | Hint:
|
| | | The ID field of the database table is not part of the datafield definition.
|
| | | The ID field must be always auto incement (int or bigint).
|
| | |
|
| | |
|
| | | */
|
| | |
|
| | | $form["title"] = "Mailing List";
|
| | | $form["description"] = "";
|
| | | $form["name"] = "mail_mailinglist";
|
| | | $form["action"] = "mail_mailinglist_edit.php";
|
| | | $form["db_table"] = "mail_mailinglist";
|
| | | $form["db_table_idx"] = "mailinglist_id";
|
| | | $form["db_history"] = "yes";
|
| | | $form["tab_default"] = "mailinglist";
|
| | | $form["list_default"] = "mail_mailinglist_list.php";
|
| | | $form["auth"] = 'yes'; // yes / no
|
| | |
|
| | | $form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
|
| | | $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
|
| | | $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
|
| | | $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
|
| | | $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
|
| | |
|
| | | $form["tabs"]['mailinglist'] = array (
|
| | | 'title' => "Mailing List",
|
| | | 'width' => 100,
|
| | | 'template' => "templates/mail_mailinglist_edit.htm",
|
| | | 'fields' => array (
|
| | | ##################################
|
| | | # Begin Datatable fields
|
| | | ##################################
|
| | | 'server_id' => array (
|
| | | 'datatype' => 'INTEGER',
|
| | | 'formtype' => 'SELECT',
|
| | | 'default' => '',
|
| | | 'datasource' => array ( 'type' => 'SQL',
|
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name',
|
| | | 'keyfield'=> 'server_id',
|
| | | 'valuefield'=> 'server_name'
|
| | | ),
|
| | | 'value' => ''
|
| | | ),
|
| | | 'domain' => array (
|
| | | 'datatype' => 'VARCHAR',
|
| | | 'formtype' => 'TEXT',
|
| | | 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
|
| | | 'errmsg'=> 'domain_error_empty'),
|
| | | 1 => array ( 'type' => 'REGEX',
|
| | | 'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z\-]{2,10}$/',
|
| | | 'errmsg'=> 'domain_error_regex'),
|
| | | ),
|
| | | 'default' => '',
|
| | | 'value' => '',
|
| | | 'width' => '30',
|
| | | 'maxlength' => '255'
|
| | | ),
|
| | | 'listname' => array (
|
| | | 'datatype' => 'VARCHAR',
|
| | | 'formtype' => 'TEXT',
|
| | | 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
|
| | | 'errmsg'=> 'listname_error_empty'),
|
| | | ),
|
| | | 'default' => '',
|
| | | 'value' => '',
|
| | | 'width' => '30',
|
| | | 'maxlength' => '255'
|
| | | ),
|
| | | 'email' => array (
|
| | | 'datatype' => 'VARCHAR',
|
| | | 'formtype' => 'TEXT',
|
| | | 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
|
| | | 'errmsg'=> 'email_error_isemail'),
|
| | | ),
|
| | | 'default' => '',
|
| | | 'value' => '',
|
| | | 'width' => '30',
|
| | | 'maxlength' => '255'
|
| | | ),
|
| | | 'password' => array (
|
| | | 'datatype' => 'VARCHAR',
|
| | | 'formtype' => 'PASSWORD',
|
| | | 'encryption'=> 'CLEARTEXT',
|
| | | 'default' => '',
|
| | | 'value' => '',
|
| | | 'width' => '30',
|
| | | 'maxlength' => '255'
|
| | | ),
|
| | | ##################################
|
| | | # ENDE Datatable fields
|
| | | ##################################
|
| | | )
|
| | | );
|
| | | ?> |
New file |
| | |
| | | <?php
|
| | | $wb["limit_mailmailinglist_txt"] = 'Limit reached';
|
| | | $wb["domain_error_empty"] = 'Domain is empty.';
|
| | | $wb["listname_error_empty"] = 'Listname is empty.';
|
| | | $wb["domain_error_regex"] = 'Invalid domain name.';
|
| | | $wb["email_in_use_txt"] = 'Email is in use';
|
| | | $wb["no_domain_perm"] = 'You have no permission for this domain.';
|
| | | $wb["password_strength_txt"] = 'Password strength';
|
| | | $wb["server_id_txt"] = 'Server';
|
| | | $wb["domain_txt"] = 'Domain';
|
| | | $wb["listname_txt"] = 'Listname';
|
| | | $wb["client_txt"] = 'Client';
|
| | | $wb["email_txt"] = 'Email';
|
| | | $wb["password_txt"] = 'Password';
|
| | | ?> |
New file |
| | |
| | | <?php
|
| | | $wb["list_head_txt"] = 'Mailing List';
|
| | | $wb["domain_txt"] = 'Domain';
|
| | | $wb["listname_txt"] = 'Listname';
|
| | | ?> |
| | |
| | | 'items' => $items); |
| | | } |
| | | |
| | | //**** Mailinglist menu
|
| | | $items = array();
|
| | |
|
| | | if($app->auth->get_client_limit($userid,'mailmailinglist') != 0)
|
| | | {
|
| | | $items[] = array( 'title' => 'Mailing List',
|
| | | 'target' => 'content',
|
| | | 'link' => 'mail/mail_mailinglist_list.php',
|
| | | 'html_id' => 'mail_mailinglist_list');
|
| | | }
|
| | |
|
| | | if(count($items))
|
| | | {
|
| | | $module['nav'][] = array( 'title' => 'Mailing List',
|
| | | 'open' => 1,
|
| | | 'items' => $items);
|
| | | }
|
| | |
|
| | | //**** Spamfilter menu |
| | | $items = array(); |
| | | |
New file |
| | |
| | | <?php
|
| | |
|
| | | /*
|
| | | Datatypes:
|
| | | - INTEGER
|
| | | - DOUBLE
|
| | | - CURRENCY
|
| | | - VARCHAR
|
| | | - TEXT
|
| | | - DATE
|
| | | */
|
| | |
|
| | |
|
| | |
|
| | | // Name of the list
|
| | | $liste["name"] = "mail_mailinglist";
|
| | |
|
| | | // Database table
|
| | | $liste["table"] = "mail_mailinglist";
|
| | |
|
| | | // Index index field of the database table
|
| | | $liste["table_idx"] = "mailinglist_id";
|
| | |
|
| | | // Search Field Prefix
|
| | | $liste["search_prefix"] = "search_";
|
| | |
|
| | | // Records per page
|
| | | $liste["records_per_page"] = 15;
|
| | |
|
| | | // Script File of the list
|
| | | $liste["file"] = "mail_mailinglist_list.php";
|
| | |
|
| | | // Script file of the edit form
|
| | | $liste["edit_file"] = "mail_mailinglist_edit.php";
|
| | |
|
| | | // Script File of the delete script
|
| | | $liste["delete_file"] = "mail_mailinglist_del.php";
|
| | |
|
| | | // Paging Template
|
| | | $liste["paging_tpl"] = "templates/paging.tpl.htm";
|
| | |
|
| | | // Enable auth
|
| | | $liste["auth"] = "yes";
|
| | |
|
| | |
|
| | | /*****************************************************
|
| | | * Suchfelder
|
| | | *****************************************************/
|
| | | $liste["item"][] = array( 'field' => "listname",
|
| | | 'datatype' => "VARCHAR",
|
| | | 'formtype' => "TEXT",
|
| | | 'op' => "like",
|
| | | 'prefix' => "%",
|
| | | 'suffix' => "%",
|
| | | 'width' => "",
|
| | | 'value' => "");
|
| | | |
| | | $liste["item"][] = array( 'field' => "domain",
|
| | | 'datatype' => "VARCHAR",
|
| | | 'formtype' => "TEXT",
|
| | | 'op' => "like",
|
| | | 'prefix' => "%",
|
| | | 'suffix' => "%",
|
| | | 'width' => "",
|
| | | 'value' => "");
|
| | |
|
| | | ?> |
| | |
| | | $app->db->datalogDelete('spamfilter_users','id',$rec['id']); |
| | | } |
| | | |
| | | // Delete all mailinglists that belong to this domain
|
| | | $records = $app->db->queryAllRecords("SELECT mailinglist_id FROM mail_mailinglist WHERE domain = '".$app->db->quote($domain)."'");
|
| | | foreach($records as $rec) {
|
| | | $app->db->datalogDelete('mail_mailinglist','mailinglist_id',$rec['id']);
|
| | | }
|
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //* Update the mailinglist
|
| | | $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $sys_groupid WHERE domain = '".mysql_real_escape_string($this->oldDataRecord['domain'])."'");
|
| | |
|
| | | //* Delete the old spamfilter record |
| | | $tmp = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".mysql_real_escape_string($this->oldDataRecord["domain"])."'"); |
| | | $app->db->datalogDelete('spamfilter_users', 'id', $tmp["id"]); |
New file |
| | |
| | | <?php
|
| | |
|
| | | /*
|
| | | Copyright (c) 2005, Till Brehm, projektfarm Gmbh
|
| | | 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.
|
| | | */
|
| | |
|
| | | /******************************************
|
| | | * Begin Form configuration
|
| | | ******************************************/
|
| | |
|
| | | $list_def_file = "list/mail_mailinglist.list.php";
|
| | | $tform_def_file = "form/mail_mailinglist.tform.php";
|
| | |
|
| | | /******************************************
|
| | | * End Form configuration
|
| | | ******************************************/
|
| | |
|
| | | require_once('../../lib/config.inc.php');
|
| | | require_once('../../lib/app.inc.php');
|
| | |
|
| | | //* Check permissions for module
|
| | | $app->auth->check_module_permissions('mail');
|
| | |
|
| | | // Loading classes
|
| | | $app->uses('tpl,tform,tform_actions');
|
| | | $app->load('tform_actions');
|
| | |
|
| | | class page_action extends tform_actions {
|
| | | }
|
| | |
|
| | | $page = new page_action;
|
| | | $page->onDelete();
|
| | |
|
| | | ?> |
New file |
| | |
| | | <?php
|
| | | /*
|
| | | Copyright (c) 2005 - 2009, Till Brehm, projektfarm Gmbh
|
| | | 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.
|
| | | */
|
| | |
|
| | |
|
| | | /******************************************
|
| | | * Begin Form configuration
|
| | | ******************************************/
|
| | |
|
| | | $tform_def_file = "form/mail_mailinglist.tform.php";
|
| | |
|
| | | /******************************************
|
| | | * End Form configuration
|
| | | ******************************************/
|
| | |
|
| | | require_once('../../lib/config.inc.php');
|
| | | require_once('../../lib/app.inc.php');
|
| | |
|
| | | //* Check permissions for module
|
| | | $app->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;
|
| | | |
| | | // we will check only users, not admins
|
| | | if($_SESSION["s"]["user"]["typ"] == 'user') {
|
| | | if(!$app->tform->checkClientLimit('limit_mailmailinglist')) {
|
| | | $app->error($app->tform->wordbook["limit_mailmailinglist_txt"]);
|
| | | }
|
| | | if(!$app->tform->checkResellerLimit('limit_mailmailinglist')) {
|
| | | $app->error('Reseller: '.$app->tform->wordbook["limit_mailmailinglist_txt"]);
|
| | | }
|
| | | }
|
| | | |
| | | parent::onShowNew();
|
| | | }
|
| | | |
| | | function onShowEnd() {
|
| | | global $app, $conf;
|
| | | |
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') {
|
| | | // Getting Clients of the user
|
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') {
|
| | | $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
|
| | | } else {
|
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"];
|
| | | $sql = "SELECT client.client_id, limit_web_domain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id";
|
| | | }
|
| | | $clients = $app->db->queryAllRecords($sql);
|
| | | $client_select = '';
|
| | | if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
|
| | | $tmp_data_record = $app->tform->getDataRecord($this->id);
|
| | | if(is_array($clients)) {
|
| | | foreach( $clients as $client) {
|
| | | $selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
|
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
|
| | | }
|
| | | }
|
| | | $app->tpl->setVar("client_group_id",$client_select);
|
| | |
|
| | | } elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
|
| | |
|
| | | // Get the limits of the client
|
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"];
|
| | | $client = $app->db->queryOneRecord("SELECT client.client_id, contact_name, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name");
|
| | |
|
| | | // Fill the client select field
|
| | | $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id'];
|
| | | $clients = $app->db->queryAllRecords($sql);
|
| | | $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
|
| | | $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contact_name'].'</option>';
|
| | | $tmp_data_record = $app->tform->getDataRecord($this->id);
|
| | | if(is_array($clients)) {
|
| | | foreach( $clients as $client) {
|
| | | $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
|
| | | $client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
|
| | | }
|
| | | }
|
| | | $app->tpl->setVar("client_group_id",$client_select);
|
| | | }
|
| | | |
| | | // Getting Domains of the user
|
| | | $sql = "SELECT domain FROM mail_domain WHERE ".$app->tform->getAuthSQL('r').' ORDER BY domain';
|
| | | $domains = $app->db->queryAllRecords($sql);
|
| | | $domain_select = '';
|
| | | if(is_array($domains)) {
|
| | | foreach( $domains as $domain) {
|
| | | $selected = ($domain["domain"] == $this->dataRecord["domain"])?'SELECTED':'';
|
| | | $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
|
| | | }
|
| | | }
|
| | | $app->tpl->setVar("domain_option",$domain_select);
|
| | | |
| | | if($this->id > 0) {
|
| | | //* we are editing a existing record
|
| | | $app->tpl->setVar("edit_disabled", 1);
|
| | | $app->tpl->setVar("listname_value", $this->dataRecord["listname"]);
|
| | | $app->tpl->setVar("domain_value", $this->dataRecord["domain"]);
|
| | | $app->tpl->setVar("email_value", $this->dataRecord["email"]);
|
| | | } else {
|
| | | $app->tpl->setVar("edit_disabled", 0);
|
| | | }
|
| | | |
| | | parent::onShowEnd();
|
| | | }
|
| | | |
| | | function onSubmit() {
|
| | | global $app, $conf;
|
| | | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin') {
|
| | |
|
| | | // Get the limits of the client
|
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"];
|
| | | $client = $app->db->queryOneRecord("SELECT limit_mailmailinglist, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
|
| | | |
| | | //* Check if Domain belongs to user
|
| | | if(isset($_POST["domain"])) {
|
| | | $domain = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = '".$this->dataRecord["domain"]."' AND ".$app->tform->getAuthSQL('r'));
|
| | | if($domain["domain"] != $this->dataRecord["domain"]) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
|
| | | }
|
| | |
|
| | | // When the record is updated
|
| | | if($this->id == 0) {
|
| | | //Check if email is in use
|
| | | $check = $app->db->queryOneRecord("SELECT count(source) as number FROM mail_forwarding WHERE source = '".$this->dataRecord["listname"]."@".$this->dataRecord["domain"]."'");
|
| | | if($check['number'] != 0) {
|
| | | $app->error($app->tform->wordbook["email_in_use_txt"]);
|
| | | }
|
| | | |
| | | $check = $app->db->queryOneRecord("SELECT count(email) as number FROM mail_user WHERE email = '".$this->dataRecord["listname"]."@".$this->dataRecord["domain"]."'");
|
| | | if($check['number'] != 0) {
|
| | | $app->error($app->tform->wordbook["email_in_use_txt"]);
|
| | | }
|
| | | |
| | | $check = $app->db->queryOneRecord("SELECT count(mailinglist_id) as number FROM mail_mailinglist WHERE listname = '".$this->dataRecord["listname"]."' AND domain = '".$this->dataRecord["domain"]."'");
|
| | | if($check['number'] != 0) {
|
| | | $app->error($app->tform->wordbook["email_in_use_txt"]);
|
| | | }
|
| | | |
| | | // Check if the user may add another mail_domain
|
| | | if($client["limit_mailmailinglist"] >= 0) {
|
| | | $tmp = $app->db->queryOneRecord("SELECT count(mailinglist_id) as number FROM mail_mailinglist WHERE sys_groupid = $client_group_id");
|
| | | if($tmp["number"] >= $client["limit_mailmailinglist"]) {
|
| | | $app->error($app->tform->wordbook["limit_mailmailinglist_txt"]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // Clients may not set the client_group_id, so we unset them if user is not a admin
|
| | | if(!$app->auth->has_clients($_SESSION['s']['user']['userid'])) unset($this->dataRecord["client_group_id"]);
|
| | | }
|
| | |
|
| | | //* make sure that the email domain is lowercase
|
| | | if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
|
| | |
|
| | | parent::onSubmit();
|
| | | }
|
| | | |
| | | function onBeforeInsert() {
|
| | | global $app, $conf;
|
| | |
|
| | | // Set the server id of the mailinglist = server ID of mail domain.
|
| | | $domain = $app->db->queryOneRecord("SELECT server_id FROM mail_domain WHERE domain = '".$this->dataRecord["domain"]."'");
|
| | | $this->dataRecord["server_id"] = $domain['server_id'];
|
| | | }
|
| | | |
| | | function onAfterInsert() {
|
| | | global $app, $conf;
|
| | |
|
| | | // 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"])) {
|
| | | $client_group_id = intval($this->dataRecord["client_group_id"]);
|
| | | $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE mailinglist_id = ".$this->id);
|
| | | }
|
| | | if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) {
|
| | | $client_group_id = intval($this->dataRecord["client_group_id"]);
|
| | | $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE mailinglist_id = ".$this->id);
|
| | | }
|
| | | }
|
| | | |
| | | function onBeforeUpdate() {
|
| | | global $app, $conf;
|
| | | |
| | | //* Check if the server has been changed
|
| | | // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
|
| | | if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
|
| | | $rec = $app->db->queryOneRecord("SELECT server_id, domain from mail_mailinglist WHERE mailinglist_id = ".$this->id);
|
| | | $this->dataRecord["server_id"] = $rec['server_id'];
|
| | | unset($rec);
|
| | | //* If the user is neither admin nor reseller
|
| | | } else {
|
| | | //* We do not allow users to change a domain which has been created by the admin
|
| | | $rec = $app->db->queryOneRecord("SELECT domain from mail_mailinglist WHERE mailinglist_id = ".$this->id);
|
| | | if($rec['domain'] != $this->dataRecord["domain"] && $app->tform->checkPerm($this->id,'u')) {
|
| | | //* Add a error message and switch back to old server
|
| | | $app->tform->errorMessage .= $app->lng('The Domain can not be changed. Please ask your Administrator if you want to change the domain name.');
|
| | | $this->dataRecord["domain"] = $rec['domain'];
|
| | | }
|
| | | unset($rec);
|
| | | }
|
| | | }
|
| | | |
| | | function onAfterUpdate() {
|
| | | global $app, $conf;
|
| | | |
| | | // make sure that the record belongs to the clinet group and not the admin group when admin 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"])) {
|
| | | $client_group_id = intval($this->dataRecord["client_group_id"]);
|
| | | $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE mailinglist_id = ".$this->id);
|
| | | }
|
| | | if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) {
|
| | | $client_group_id = intval($this->dataRecord["client_group_id"]);
|
| | | $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE mailinglist_id = ".$this->id);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | $app->tform_actions = new page_action;
|
| | | $app->tform_actions->onLoad();
|
| | |
|
| | | ?>
|
New file |
| | |
| | | <?php
|
| | | require_once('../../lib/config.inc.php');
|
| | | require_once('../../lib/app.inc.php');
|
| | |
|
| | | /******************************************
|
| | | * Begin Form configuration
|
| | | ******************************************/
|
| | |
|
| | | $list_def_file = "list/mail_mailinglist.list.php";
|
| | |
|
| | | /******************************************
|
| | | * End Form configuration
|
| | | ******************************************/
|
| | |
|
| | | //* Check permissions for module
|
| | | $app->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();
|
| | |
|
| | |
|
| | | ?> |
New file |
| | |
| | | <?php
|
| | | /*
|
| | | Copyright (c) 2008, Till Brehm, projektfarm Gmbh
|
| | | 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.
|
| | | */
|
| | |
|
| | |
|
| | | require_once('../../lib/config.inc.php');
|
| | | require_once('../../lib/app.inc.php');
|
| | |
|
| | | //* Check permissions for module
|
| | | $app->auth->check_module_permissions('mail');
|
| | |
|
| | | /* get the id of the mail (must be int!) */
|
| | | if (!isset($_GET['id'])){
|
| | | die ("No List selected!");
|
| | | }
|
| | | $listId = intval($_GET['id']);
|
| | |
|
| | | /*
|
| | | * Get the data to connect to the database
|
| | | */
|
| | | $dbData = $app->db->queryAllRecords("SELECT server_id, listname FROM mail_mailinglist WHERE mailinglist_id = " . $listId);
|
| | | $serverId = intval($dbData[0]['server_id']);
|
| | | if ($serverId == 0){
|
| | | die ("No List - Server found!");
|
| | | }
|
| | |
|
| | | $serverData = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$serverId);
|
| | |
|
| | | $app->uses('getconf');
|
| | | $global_config = $app->getconf->get_global_config('mail');
|
| | |
|
| | | if($global_config['mailmailinglist_url'] != '') {
|
| | | header('Location:' . $global_config['mailmailinglist_url']);
|
| | | } else {
|
| | |
|
| | | /*
|
| | | * We only redirect to the login-form, so there is no need, to check any rights
|
| | | */
|
| | | isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http';
|
| | | header('Location:' . $http . '://' . $serverData['server_name'] . '/cgi-bin/mailman/admin/' . $dbData[0]['listname']);
|
| | | }
|
| | | exit;
|
| | | ?> |
New file |
| | |
| | | <h2><tmpl_var name="list_head_txt"></h2>
|
| | | <p><tmpl_var name="list_desc_txt"></p>
|
| | |
|
| | | <div class="panel panel_mail_mailinglist">
|
| | |
|
| | | <div class="pnl_formsarea">
|
| | | <fieldset class="inlineLabels"><legend>Mailing List</legend> |
| | | <tmpl_if name="is_admin">
|
| | | <div class="ctrlHolder">
|
| | | <label for="client_group_id">{tmpl_var name='client_txt'}</label>
|
| | | <select name="client_group_id" id="client_group_id" class="selectInput">
|
| | | {tmpl_var name='client_group_id'}
|
| | | </select>
|
| | | </div>
|
| | | </tmpl_if>
|
| | | |
| | | <tmpl_if name="is_reseller">
|
| | | <div class="ctrlHolder">
|
| | | <label for="client_group_id">{tmpl_var name='client_txt'}</label>
|
| | | <select name="client_group_id" id="client_group_id" class="selectInput">
|
| | | {tmpl_var name='client_group_id'}
|
| | | </select>
|
| | | </div>
|
| | | </tmpl_if>
|
| | | |
| | | <tmpl_if name="edit_disabled">
|
| | | <div class="ctrlHolder">
|
| | | <label for="domain_disabled">{tmpl_var name='domain_txt'}</label>
|
| | | <select name="domain_disabled" id="domain_disabled" class="selectInput" disabled="disabled">
|
| | | {tmpl_var name='domain_option'}
|
| | | </select>
|
| | | <input type="hidden" name="domain" value="{tmpl_var name='domain_value'}" />
|
| | | </div>
|
| | | |
| | | <div class="ctrlHolder">
|
| | | <label for="listname_disabled">{tmpl_var name='listname_txt'}</label>
|
| | | <input name="listname_disabled" id="listname_disabled" value="{tmpl_var name='listname'}" size="30" maxlength="255" type="text" class="textInput" disabled="disabled" />
|
| | | <input type="hidden" name="listname" value="{tmpl_var name='listname_value'}" />
|
| | | </div>
|
| | | <div class="ctrlHolder">
|
| | | <label for="email_disabled">{tmpl_var name='email_txt'}</label>
|
| | | <input name="email_disabled" id="email_disabled" value="{tmpl_var name='email'}" size="30" maxlength="255" type="text" class="textInput" disabled="disabled" />
|
| | | <input type="hidden" name="email" value="{tmpl_var name='email_value'}" />
|
| | | </div>
|
| | | <tmpl_else>
|
| | | <div class="ctrlHolder">
|
| | | <label for="domain">{tmpl_var name='domain_txt'}</label>
|
| | | <select name="domain" id="domain" class="selectInput">
|
| | | {tmpl_var name='domain_option'}
|
| | | </select>
|
| | | </div>
|
| | | <div class="ctrlHolder">
|
| | | <label for="listname">{tmpl_var name='listname_txt'}</label>
|
| | | <input name="listname" id="listname" value="{tmpl_var name='listname'}" size="30" maxlength="255" type="text" class="textInput" />
|
| | | </div>
|
| | | <div class="ctrlHolder">
|
| | | <label for="email">{tmpl_var name='email_txt'}</label>
|
| | | <input name="email" id="email" value="{tmpl_var name='email'}" size="30" maxlength="255" type="text" class="textInput" />
|
| | | </div>
|
| | | </tmpl_if>
|
| | | <div class="ctrlHolder">
|
| | | <label for="password">{tmpl_var name='password_txt'}</label>
|
| | | <input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />
|
| | | </div>
|
| | | <div class="ctrlHolder">
|
| | | <p class="label">{tmpl_var name='password_strength_txt'}</p>
|
| | | <div id="passBar"></div>
|
| | | <p class="formHint"><span id="passText"> </span></p>
|
| | | </div>
|
| | | </fieldset>
|
| | |
|
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}">
|
| | |
|
| | | <div class="buttonHolder buttons">
|
| | | <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','mail/mail_mailinglist_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
|
| | | <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('mail/mail_mailinglist_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
|
| | | </div>
|
| | | </div>
|
| | | |
| | | </div>
|
New file |
| | |
| | | <h2><tmpl_var name="list_head_txt"></h2>
|
| | |
|
| | | <div class="panel panel_list_mail_mailinglist">
|
| | |
|
| | | <div class="pnl_toolsarea">
|
| | | <fieldset><legend>{tmpl_var name="toolsarea_head_txt"}</legend>
|
| | | <div class="buttons">
|
| | | <button class="iconstxt icoAdd" type="button" onClick="loadContent('mail/mail_mailinglist_edit.php');">
|
| | | <span>{tmpl_var name="add_new_record_txt"}</span>
|
| | | </button>
|
| | | </div>
|
| | | </fieldset>
|
| | | </div>
|
| | |
|
| | | <div class="pnl_listarea">
|
| | | <fieldset><legend><tmpl_var name="list_head_txt"></legend>
|
| | | <table class="list">
|
| | | <thead>
|
| | | <tr>
|
| | | <th class="tbl_col_listname" scope="col"><tmpl_var name="listname_txt"></th>
|
| | | <th class="tbl_col_domain" scope="col"><tmpl_var name="domain_txt"></th>
|
| | | <th class="tbl_col_buttons" scope="col"> </th>
|
| | | </tr>
|
| | | <tr>
|
| | | <td class="tbl_col_listname"><input type="text" name="search_listname" value="{tmpl_var name='search_listname'}" /></td>
|
| | | <td class="tbl_col_domain"><input type="text" name="search_domain" value="{tmpl_var name='search_domain'}" /></td>
|
| | | <td class="tbl_col_buttons"><div class="buttons"><button type="button" class="icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="submitForm('pageForm','mail/mail_mailinglist_list.php');"><span>{tmpl_var name="filter_txt"}</span></button></div></td>
|
| | | </tr>
|
| | | </thead>
|
| | | <tbody>
|
| | | <tmpl_loop name="records">
|
| | | <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
|
| | | <td class="tbl_col_listname"><a href="#" onClick="loadContent('mail/mail_mailinglist_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="listname"}</a></td>
|
| | | <td class="tbl_col_domain"><a href="#" onClick="loadContent('mail/mail_mailinglist_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="domain"}</a></td>
|
| | | <td class="tbl_col_buttons">
|
| | | <div class="buttons icons16">
|
| | | <tmpl_if name="mailmailinglist_link"><a class="icons16 icoWebmailer" href="mail/mailinglist.php?id={tmpl_var name='id'}" target="mailmailinglist"><span>{tmpl_var name='delete_txt'}</span></a></tmpl_if>
|
| | | <a class="icons16 icoDelete" href="javascript: del_record('mail/mail_mailinglist_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a>
|
| | | </div>
|
| | | </td>
|
| | | </tr>
|
| | | </tmpl_loop>
|
| | | </tbody>
|
| | | <tfoot>
|
| | | <tr>
|
| | | <td class="tbl_footer tbl_paging" colspan="3"><tmpl_var name="paging"></td>
|
| | | </tr>
|
| | | </tfoot>
|
| | | </table>
|
| | | </fieldset>
|
| | | </div>
|
| | |
|
| | | </div>
|
New file |
| | |
| | | # -*- python -*- |
| | | |
| | | # Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc. |
| | | # |
| | | # This program is free software; you can redistribute it and/or |
| | | # modify it under the terms of the GNU General Public License |
| | | # as published by the Free Software Foundation; either version 2 |
| | | # of the License, or (at your option) any later version. |
| | | # |
| | | # This program is distributed in the hope that it will be useful, |
| | | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | # GNU General Public License for more details. |
| | | # |
| | | # You should have received a copy of the GNU General Public License |
| | | # along with this program; if not, write to the Free Software |
| | | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| | | # 02110-1301 USA |
| | | |
| | | |
| | | """This is the module which takes your site-specific settings. |
| | | |
| | | From a raw distribution it should be copied to mm_cfg.py. If you |
| | | already have an mm_cfg.py, be careful to add in only the new settings |
| | | you want. The complete set of distributed defaults, with annotation, |
| | | are in ./Defaults. In mm_cfg, override only those you want to |
| | | change, after the |
| | | |
| | | from Defaults import * |
| | | |
| | | line (see below). |
| | | |
| | | Note that these are just default settings - many can be overridden via the |
| | | admin and user interfaces on a per-list or per-user basis. |
| | | |
| | | Note also that some of the settings are resolved against the active list |
| | | setting by using the value as a format string against the |
| | | list-instance-object's dictionary - see the distributed value of |
| | | DEFAULT_MSG_FOOTER for an example.""" |
| | | |
| | | |
| | | ####################################################### |
| | | # Here's where we get the distributed defaults. # |
| | | |
| | | from Defaults import * |
| | | |
| | | ############################################################## |
| | | # Put YOUR site-specific configuration below, in mm_cfg.py . # |
| | | # See Defaults.py for explanations of the values. # |
| | | |
| | | #------------------------------------------------------------- |
| | | # The name of the list Mailman uses to send password reminders |
| | | # and similar. Don't change if you want mailman-owner to be |
| | | # a valid local part. |
| | | MAILMAN_SITE_LIST = 'mailman' |
| | | |
| | | #------------------------------------------------------------- |
| | | # If you change these, you have to configure your http server |
| | | # accordingly (Alias and ScriptAlias directives in most httpds) |
| | | DEFAULT_URL_PATTERN = 'http://%s/cgi-bin/mailman/' |
| | | PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private' |
| | | IMAGE_LOGOS = '/images/mailman/' |
| | | |
| | | #------------------------------------------------------------- |
| | | # Default domain for email addresses of newly created MLs |
| | | DEFAULT_EMAIL_HOST = '{hostname}' |
| | | #------------------------------------------------------------- |
| | | # Default host for web interface of newly created MLs |
| | | DEFAULT_URL_HOST = '{hostname}' |
| | | #------------------------------------------------------------- |
| | | # Required when setting any of its arguments. |
| | | add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) |
| | | |
| | | #------------------------------------------------------------- |
| | | # The default language for this server. |
| | | DEFAULT_SERVER_LANGUAGE = {default_language} |
| | | |
| | | #------------------------------------------------------------- |
| | | # Iirc this was used in pre 2.1, leave it for now |
| | | USE_ENVELOPE_SENDER = 0 # Still used? |
| | | |
| | | #------------------------------------------------------------- |
| | | # Unset send_reminders on newly created lists |
| | | DEFAULT_SEND_REMINDERS = 0 |
| | | |
| | | #------------------------------------------------------------- |
| | | # Uncomment this if you configured your MTA such that it |
| | | # automatically recognizes newly created lists. |
| | | # (see /usr/share/doc/mailman/README.Exim4.Debian or |
| | | # /usr/share/mailman/postfix-to-mailman.py) |
| | | # MTA=None # Misnomer, suppresses alias output on newlist |
| | | |
| | | #------------------------------------------------------------- |
| | | # Uncomment if you use Postfix virtual domains (but not |
| | | # postfix-to-mailman.py), but be sure to see |
| | | # /usr/share/doc/mailman/README.Debian first. |
| | | MTA='Postfix' |
| | | POSTFIX_STYLE_VIRTUAL_DOMAINS = [{virtual_domains}] |
| | | #------------------------------------------------------------- |
| | | # Uncomment if you want to filter mail with SpamAssassin. For |
| | | # more information please visit this website: |
| | | # http://www.jamesh.id.au/articles/mailman-spamassassin/ |
| | | # GLOBAL_PIPELINE.insert(1, 'SpamAssassin') |
| | | |
| | | # Note - if you're looking for something that is imported from mm_cfg, but you |
| | | # didn't find it above, it's probably in /usr/lib/mailman/Mailman/Defaults.py. |
| | |
| | | 'mail_get_delete', |
| | | 'mail_content_filter_insert', |
| | | 'mail_content_filter_update', |
| | | 'mail_content_filter_delete'); |
| | | 'mail_content_filter_delete',
|
| | | 'mail_mailinglist_insert',
|
| | | 'mail_mailinglist_update',
|
| | | 'mail_mailinglist_delete');
|
| | | |
| | | //* This function is called during ispconfig installation to determine |
| | | // if a symlink shall be created for this plugin. |
| | |
| | | $app->modules->registerTableHook('mail_user','mail_module','process'); |
| | | $app->modules->registerTableHook('mail_get','mail_module','process'); |
| | | $app->modules->registerTableHook('mail_content_filter','mail_module','process'); |
| | | $app->modules->registerTableHook('mail_mailinglist','mail_module','process');
|
| | | |
| | | } |
| | | |
| | |
| | | if($action == 'u') $app->plugins->raiseEvent('mail_content_filter_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('mail_content_filter_delete',$data); |
| | | break; |
| | | case 'mail_mailinglist':
|
| | | if($action == 'i') $app->plugins->raiseEvent('mail_mailinglist_insert',$data);
|
| | | if($action == 'u') $app->plugins->raiseEvent('mail_mailinglist_update',$data);
|
| | | if($action == 'd') $app->plugins->raiseEvent('mail_mailinglist_delete',$data);
|
| | | break;
|
| | | } // end switch |
| | | } // end function |
| | | |
New file |
| | |
| | | <?php
|
| | |
|
| | | /*
|
| | | Copyright (c) 2007, Till Brehm, projektfarm Gmbh
|
| | | 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.
|
| | | */
|
| | |
|
| | | class mailman_plugin {
|
| | | |
| | | var $plugin_name = 'mailman_plugin';
|
| | | var $class_name = 'mailman_plugin';
|
| | | |
| | | |
| | | var $mailman_config_dir = '/etc/mailman/';
|
| | | |
| | | //* 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','mailman_plugin','insert');
|
| | | $app->plugins->registerEvent('mail_mailinglist_update','mailman_plugin','update');
|
| | | $app->plugins->registerEvent('mail_mailinglist_delete','mailman_plugin','delete');
|
| | | |
| | | |
| | | |
| | | }
|
| | | |
| | | function insert($event_name,$data) {
|
| | | global $app, $conf;
|
| | | |
| | | $this->update_config();
|
| | | |
| | | exec("/usr/lib/mailman/bin/newlist -u ".$data["new"]["domain"]." -e ".$data["new"]["domain"]." ".$data["new"]["listname"]." ".$data["new"]["email"]." ".$data["new"]["password"]."");
|
| | | |
| | | exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null');
|
| | | |
| | | $app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ".$data["new"]['mailinglist_id']);
|
| | | |
| | | }
|
| | | |
| | | // The purpose of this plugin is to rewrite the main.cf file
|
| | | function update($event_name,$data) {
|
| | | global $app, $conf;
|
| | | |
| | | exec("/usr/lib/mailman/bin/change_pw -l ".$data["new"]["listname"]." -p ".$data["new"]["password"]."");
|
| | | |
| | | exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null');
|
| | | |
| | | $app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ".$data["new"]['mailinglist_id']);
|
| | | |
| | | }
|
| | | |
| | | function delete($event_name,$data) {
|
| | | global $app, $conf;
|
| | | |
| | | $this->update_config();
|
| | | |
| | | exec("/usr/lib/mailman/bin/rmlist -a ".$data["old"]["listname"]);
|
| | | |
| | | exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null');
|
| | | |
| | | }
|
| | | |
| | | function update_config() {
|
| | | global $app, $conf;
|
| | | |
| | | copy($this->mailman_config_dir.'mm_cfg.py',$this->mailman_config_dir.'mm_cfg.py');
|
| | | |
| | | // load the server configuration options
|
| | | $app->uses('getconf');
|
| | | $server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
|
| | | |
| | | // load files
|
| | | $content = file_get_contents($conf["rootpath"]."/conf/mm_cfg.py.master");
|
| | | $old_file = file_get_contents($this->mailman_config_dir."/mm_cfg.py");
|
| | | |
| | | $old_options = array();
|
| | | $lines = explode("\n", $old_file); |
| | | foreach ($lines as $line)
|
| | | {
|
| | | if (strlen($line) && substr($line, 0, 1) != '#')
|
| | | {
|
| | | list($key, $value) = explode("=", $line);
|
| | | if (!empty($value))
|
| | | {
|
| | | $key = rtrim($key);
|
| | | $old_options[$key] = trim($value);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | // create virtual_domains list
|
| | | $domainAll = $app->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain");
|
| | | $virtual_domains = '';
|
| | | foreach($domainAll as $domain)
|
| | | {
|
| | | if ($domainAll[0]['domain'] == $domain['domain'])
|
| | | $virtual_domains .= "'".$domain['domain']."'";
|
| | | else
|
| | | $virtual_domains .= ", '".$domain['domain']."'";
|
| | | }
|
| | | |
| | | $content = str_replace('{hostname}', $server_config['hostname'], $content);
|
| | | $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content);
|
| | | $content = str_replace('{virtual_domains}', $virtual_domains, $content);
|
| | | |
| | | file_put_contents($this->mailman_config_dir."/mm_cfg.py", $content);
|
| | | }
|
| | |
|
| | | } // end class
|
| | |
|
| | | ?>
|