diff --git a/config/exim4/exim4.conf.template b/config/exim4/exim4.conf.template new file mode 100644 index 0000000000000000000000000000000000000000..b99fded9eb42e4b52b117ded44efc6bf46655be8 --- /dev/null +++ b/config/exim4/exim4.conf.template @@ -0,0 +1,434 @@ +###################################################################### +# MAIN CONFIGURATION SETTINGS # +###################################################################### + +# MySQL defines +MYSQL_SERVER=localhost +MYSQL_USER=root +MYSQL_PASSWORD=matze +MYSQL_DB=mailserver +MYSQL_EMAILTABLE=mail_email +MYSQL_DOMAINTABLE=mail_domain +MYSQL_WHITETABLE=mail_whitelist +MYSQL_BLACKTABLE=mail_blacklist + +# Server ID for Multiserver Setups +MAILSERVER_ID=1 +MAILSERVER_HOSTNAME=mail. +MAILSERVER_EXIM_BINARY=/usr/sbin/exim4 +MAILSERVER_SPAMC_BINARY=/usr/bin/spamc + +# Mailman vars +MAILMAN_HOME=/var/lib/mailman +MAILMAN_WRAP=MAILMAN_HOME/mail/wrapper +MAILMAN_UID=list +MAILMAN_GID=list + +# MySQL queries +# MYSQL_Q_LDOMAIN=SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='${quote_mysql:$domain}' AND type = 'local' +# MYSQL_Q_RDOMAIN=SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='${quote_mysql:$domain}' AND type = 'relay' + +MYSQL_Q_VSCAN=SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND opt_virscan='yes' + + +MM_HOME=${lookup mysql{SELECT mm_home FROM mail_mailman_domain WHERE domain='${quote_mysql:domain}'}} +MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck +MM_WRAP=${lookup mysql{SELECT mm_wrap FROM mail_mailman_domain WHERE domain='${quote_mysql:domain}'}} + +# MySQL connection +hide mysql_servers = "MYSQL_SERVER/MYSQL_DB/MYSQL_USER/MYSQL_PASSWORD" + +# starting 'normal' config + +primary_hostname = MAILSERVER_HOSTNAME + +domainlist local_domains = mysql;SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='${quote_mysql:$domain}' AND (type = 'local' OR type = 'alias') +domainlist relay_to_domains = mysql;SELECT DISTINCT domain FROM MYSQL_DOMAINTABLE WHERE domain='${quote_mysql:$domain}' AND type = 'relay' +hostlist relay_from_hosts = 127.0.0.1 +domainlist mmdomains = ${lookup mysql {SELECT domain FROM mail_mailman_domain}} + +acl_smtp_rcpt = acl_check_rcpt + +qualify_domain = +# qualify_recipient = + +# allow_domain_literals + +never_users = root +trusted_users = mail + +host_lookup = * +rfc1413_hosts = * +rfc1413_query_timeout = 15s + +check_spool_space = 50M +check_log_space = 20M +return_size_limit = 20k +message_size_limit = 20M + +# sender_unqualified_hosts = +# recipient_unqualified_hosts = + +# percent_hack_domains = + +ignore_bounce_errors_after = 2d +timeout_frozen_after = 7d + +deliver_queue_load_max = 8 +queue_only_load = 10 +remote_max_parallel = 15 + +#tls_certificate = +#tls_privatekey = +#tls_advertise_hosts = * + +# SSL/TLS cert and key +tls_certificate = /etc/exim4/smtpd.cert +tls_privatekey = /etc/exim4/smtpd.key + +# Advertise TLS to anyone +tls_advertise_hosts = * + +# Require auth over SSL only. +# auth_over_tls_hosts = * + +spamd_address = 127.0.0.1 783 + +###################################################################### +# ACL CONFIGURATION # +# Specifies access control lists for incoming SMTP mail # +###################################################################### + +begin acl + +acl_check_rcpt: + accept hosts = : + deny domains = +local_domains + local_parts = ^[.] : ^.*[@%!/|] + deny domains = !+local_domains + local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./ + accept local_parts = postmaster + domains = +local_domains + require verify = sender + accept domains = +local_domains + endpass + verify = recipient + accept domains = +relay_to_domains + endpass + verify = recipient + accept hosts = +relay_from_hosts + accept authenticated = * + deny message = relay not permitted + +acl_check_data: + warn message = X-Spam-Score: $spam_score ($spam_bar) + spam = nobody:true + warn message = X-Spam-Report: $spam_report + spam = nobody:true + warn message = Subject: *SPAM* $h_Subject + spam = nobody + + # reject spam at high scores (> 12) + deny message = This message scored $spam_score spam points. + spam = nobody:true + condition = ${if >{$spam_score_int}{120}{1}{0}} + + + +###################################################################### +# ROUTERS CONFIGURATION # +# Specifies how addresses are handled # +###################################################################### +# THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! # +# An address is passed to each router in turn until it is accepted. # +###################################################################### + +begin routers + +fail_router: + driver = redirect + domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND enabled='no'}{$value}} + data = ":fail:" + allow_fail + +mailman_router: + driver = accept + domains = +mmdomains + require_files = MM_LISTCHK + local_part_suffix_optional + local_part_suffix = -admin : \ + -bounces : -bounces+* : \ + -confirm : -confirm+* : \ + -join : -leave : \ + -owner : -request : \ + -subscribe : -unsubscribe + transport = mailman_transport + +dnslookup: + driver = dnslookup + domains = ! +local_domains + transport = remote_smtp + ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 + no_more + +domain_aliases: + driver=redirect + domains=${lookup mysql{SELECT domain FROM mail_domain WHERE type = 'alias'}} + data=$local_part@${lookup mysql{SELECT destination FROM mail_domain WHERE domain='${domain}'}} + +blacklist_router: + driver = manualroute + senders = ${lookup mysql {SELECT DISTINCT MYSQL_BLACKTABLE.address FROM MYSQL_BLACKTABLE WHERE '${quote_mysql:$sender_address}' LIKE MYSQL_BLACKTABLE.address}{$value}} + condition = "${if !def:h_X-Spam-Flag: {1}{0}}" + headers_add = X-Spam-Flag: YES + route_list = * localhost + self = pass + +#system_aliases: +# driver = redirect +# allow_fail +# allow_defer +# data = ${lookup{$local_part}lsearch{/etc/aliases}} +# user = exim +# file_transport = address_file +# pipe_transport = address_pipe + +#mysql_systemalias: +# driver = redirect +# allow_fail +# allow_defer +# data = ${lookup mysql{SELECT dest FROM mail_systemalias WHERE local_part='${quote_mysql:$local_part}'}} + +mysql_email_alias: + driver = redirect + allow_fail + allow_defer + data = ${lookup mysql{ SELECT destination FROM mail_redirect WHERE email='${local_part}@${domain}' AND type = 'alias'}} + +#spamcheck_router: +# driver = manualroute +# domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND spamscan='yes'}{$value}} +# senders = ! ${lookup mysql {SELECT DISTINCT MYSQL_WHITETABLE.address FROM MYSQL_WHITETABLE WHERE '${quote_mysql:$sender_address}' LIKE MYSQL_WHITETABLE.address}{$value}} +# condition = ${if and { \ +# {!eq {$received_protocol}{spam-scanned}} \ +# {!eq {$received_protocol}{local}} \ +# } {1}{0}} +# headers_remove = X-Spam-Flag +# route_list = "* localhost byname" +# transport = spamcheck +# verify = false + +#spampurge_router: +# driver = manualroute +# domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND spampurge='yes'}{$value}} +# condition = "${if eq{$h_X-Spam-Flag:}{YES} {1}{0}}" +# route_list = "* localhost byname" +# transport = devnull_transport +# verify = false + +autoresponder_router: + driver = accept + domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND autoresponder='yes'}{$value}} + transport = autoresponder_transport + unseen + +cc_router: + driver = redirect + data = ${lookup mysql {SELECT cc FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}')}{$value}} + unseen + +forward_router: + driver = redirect + data = ${lookup mysql {SELECT forward FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND forward != ''}{$value}} + +local_mailbox_router: + driver = accept + domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND maildir != ''}{$value}} + transport = local_delivery + +mysql_default_router: + driver=redirect + data=${lookup mysql{ SELECT dest FROM mail_virtual_default WHERE domain='${domain}'}} + allow_fail + allow_defer + +#domain_catchall_director: +# driver = redirect +# domains = ${lookup mysql {SELECT SUBSTRING_INDEX(email,'@',-1) FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@') AND forward != ''}{$value}} +# data = ${lookup mysql {SELECT forward FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@') AND forward != ''}{$value}} + +###################################################################### +# TRANSPORTS CONFIGURATION # +###################################################################### +# ORDER DOES NOT MATTER # +# Only one appropriate transport is called for each delivery. # +###################################################################### + +begin transports + +remote_smtp: + driver = smtp + +devnull_delivery: + driver = appendfile + file = /dev/null + group = mail + +address_pipe: + driver = pipe + return_output + +address_file: + driver = appendfile + delivery_date_add + envelope_to_add + return_path_add + +address_reply: + driver = autoreply + +mailman_transport: + driver = pipe + command = /var/mailman/lists.mas-services.co.uk/mail/mailman \ + '${if def:local_part_suffix \ + {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \ + {post}}' \ + $local_part + current_directory = ${lookup mysql{SELECT mm_home FROM mail_mailman_domain WHERE domain='${domain}'}} + home_directory = ${lookup mysql{SELECT mm_home FROM mail_mailman_domain WHERE domain='${domain}'}} + user = ${lookup mysql{SELECT mm_user FROM mail_mailman_domain WHERE domain='${domain}'}} + group = ${lookup mysql{SELECT mm_group FROM mail_mailman_domain WHERE domain='${domain}'}} + +spamcheck: + driver = pipe + command = MAILSERVER_EXIM_BINARY -oMr spam-scanned -bS + use_bsmtp = true + transport_filter = MAILSERVER_SPAMC_BINARY + home_directory = "/tmp" + current_directory = "/tmp" + user = mail + group = mail + log_output = true + return_fail_output = true + return_path_add = false + message_prefix = + message_suffix = + +local_delivery: + driver = appendfile + directory = ${lookup mysql {SELECT concat(maildir,'/Maildir') FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}')}{$value}} + maildir_format + user = mail + group = mail + quota = ${lookup mysql{select quota from MYSQL_EMAILTABLE where email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}')}{${value}M}} + quota_is_inclusive = false + #quota_size_regex = ,S=(\d+): + quota_warn_threshold = 75% + maildir_use_size_file = false + quota_warn_message = "To: $local_part@$domain\n\ + Subject: Mailbox quota warning\n\n\ + This message was automatically generated by the mail delivery software.\n\n\ + You are now using over 75% of your allocated mail storage quota.\n\n\ + If your mailbox fills completely, further incoming messages will be automatically\n\ + returned to their senders.\n\n\ + Please take note of this and remove unwanted mail from your mailbox.\n" + mode = 0660 + directory_mode = 0770 + +#mysql_delivery: +# driver = appendfile +# maildir_format +# directory = \ +# ${lookup mysql{SELECT maildir FROM passwd \ +# WHERE email='${local_part}@${domain}'}} +# user = \ +# ${lookup mysql{SELECT uid FROM passwd \ +# WHERE email='${local_part}@${domain}'}} +# group = \ +# ${lookup mysql{SELECT gid FROM passwd \ +# WHERE email='${local_part}@${domain}'}} + + +autoresponder_transport: + driver = autoreply + to = ${sender_address} + from = "vacation@${domain}" + subject = "Autoresponder: ${local_part}@${domain}" + text = ${lookup mysql {SELECT autoresponder_text FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}')}{$value}} + +devnull_transport: + driver = appendfile + file = /dev/null + user = mail + +###################################################################### +# RETRY CONFIGURATION # +###################################################################### + +begin retry + +# This single retry rule applies to all domains and all errors. It specifies +# retries every 15 minutes for 2 hours, then increasing retry intervals, +# starting at 1 hour and increasing each time by a factor of 1.5, up to 16 +# hours, then retries every 6 hours until 4 days have passed since the first +# failed delivery. + +# Domain Error Retries +# ------ ----- ------- + +* * F,2h,15m; G,16h,1h,1.5; F,4d,6h + + + +###################################################################### +# REWRITE CONFIGURATION # +###################################################################### + +# There are no rewriting specifications in this default configuration file. +begin rewrite + + + +###################################################################### +# AUTHENTICATION CONFIGURATION # +###################################################################### + +# There are no authenticator specifications in this default configuration file. + +begin authenticators + +fixed_plain: + driver = plaintext + public_name = PLAIN + server_condition = ${lookup mysql{SELECT email FROM MYSQL_EMAILTABLE WHERE email='${quote_mysql:$2}' AND cryptpwd=encrypt('${quote_mysql:$3}', cryptpwd)}{1}fail} + server_set_id = $2 + +fixed_login: + driver = plaintext + public_name = LOGIN + server_prompts = "Username:: : Password::" + server_condition = ${lookup mysql{SELECT email FROM MYSQL_EMAILTABLE WHERE email='${quote_mysql:$1}' AND cryptpwd=encrypt('${quote_mysql:$2}', cryptpwd)}{1}fail} + server_set_id = $1 + +cram: + driver = cram_md5 + public_name = CRAM-MD5 + server_secret = "${lookup mysql {SELECT clearpwd FROM mail_box WHERE email = '${sg {$1}{'}{}}' AND is_enabled = 'yes'} {$value} fail}" + server_set_id = $1 + + +###################################################################### +# CONFIGURATION FOR local_scan() # +###################################################################### + +# If you have built Exim to include a local_scan() function that contains +# tables for private options, you can define those options here. Remember to +# uncomment the "begin" line. It is commented by default because it provokes +# an error with Exim binaries that are not built with LOCAL_SCAN_HAS_OPTIONS +# set in the Local/Makefile. + +# begin local_scan + + +# End of Exim configuration file + diff --git a/interface/lib/classes/listform_actions.inc.php b/interface/lib/classes/listform_actions.inc.php index 0df5391d1d6a1d8e154df709bbfe3617abfea774..c76a23c70dcc85d423f9823a1dac7ad7897dc24a 100644 --- a/interface/lib/classes/listform_actions.inc.php +++ b/interface/lib/classes/listform_actions.inc.php @@ -99,11 +99,15 @@ class listform_actions { // Generate the search sql if($app->listform->listDef["auth"] != 'no') { if($_SESSION["s"]["user"]["typ"] == "admin") { - $sql_where = $this->SQLExtWhere; + $sql_where = ""; } else { - $sql_where = $this->SQLExtWhere ." ". $app->tform->getAuthSQL('r')." and"; + $sql_where = $app->tform->getAuthSQL('r')." and"; } } + + if($this->SQLExtWhere != '') { + $sql_where .= " ".$this->SQLExtWhere." and"; + } $sql_where = $app->listform->getSearchSQL($sql_where); $app->tpl->setVar($app->listform->searchValues); diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php index 2c54f37ff50f1f3d0f4addcb6c6e85c631f45c99..5fb64445facdadfd7b8924efe6c1b608e6d0dec7 100644 --- a/interface/lib/classes/tform.inc.php +++ b/interface/lib/classes/tform.inc.php @@ -107,6 +107,7 @@ class tform { var $formDef; var $wordbook; var $module; + var $primary_id; /** * Laden der Tabellendefinition @@ -535,14 +536,15 @@ class tform { } break; case 'UNIQUE': - $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."'"); if($this->action == 'NEW') { + $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."'"); if($num_rec["number"] > 0) { $errmsg = $validator['errmsg']; $this->errorMessage .= $this->wordbook[$errmsg]."
\r\n"; } } else { - if($num_rec["number"] > 1) { + $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."' AND ".$this->formDef['db_table_idx']." != ".$this->primary_id); + if($num_rec["number"] > 0) { $errmsg = $validator['errmsg']; $this->errorMessage .= $this->wordbook[$errmsg]."
\r\n"; } @@ -610,6 +612,7 @@ class tform { } $this->action = $action; + $this->primary_id = $primary_id; $record = $this->encode($record,$tab); $sql_insert_key = ''; diff --git a/interface/web/sites/form/mail_box.tform.php b/interface/web/sites/form/mail_box.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..91400dfdfe2795447f132c8bc0a68a948a1a4f38 --- /dev/null +++ b/interface/web/sites/form/mail_box.tform.php @@ -0,0 +1,104 @@ + 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"]['domain'] = array ( + 'title' => "Domain", + 'width' => 100, + 'template' => "templates/mail_domain_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 1 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' => 'UNIQUE', + 'errmsg'=> 'domain_error_unique'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'value' => array('local' => 'local','relay'=>'relay','manual_relay'=>'manual Relay') + ), + 'active' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'CHECKBOX', + 'default' => '1', + 'value' => '1' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + + +?> \ No newline at end of file diff --git a/interface/web/sites/form/mail_domain.tform.php b/interface/web/sites/form/mail_domain.tform.php index cdf6b9461b3335032a6939e25598bdff25b02869..91400dfdfe2795447f132c8bc0a68a948a1a4f38 100644 --- a/interface/web/sites/form/mail_domain.tform.php +++ b/interface/web/sites/form/mail_domain.tform.php @@ -42,7 +42,7 @@ $form["db_table_idx"] = "domain_id"; $form["db_history"] = "yes"; $form["tab_default"] = "domain"; $form["list_default"] = "mail_domain_list.php"; -$form["auth"] = 'no'; +$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 diff --git a/interface/web/sites/form/mail_domain_alias.tform.php b/interface/web/sites/form/mail_domain_alias.tform.php index e50d0f68aac89fd3cba355cfd344a3be1aa159d8..d2373d8e058917597ca0a60ccdc2e8cdad68b086 100644 --- a/interface/web/sites/form/mail_domain_alias.tform.php +++ b/interface/web/sites/form/mail_domain_alias.tform.php @@ -42,7 +42,7 @@ $form["db_table_idx"] = "domain_id"; $form["db_history"] = "yes"; $form["tab_default"] = "domain"; $form["list_default"] = "mail_domain_alias_list.php"; -$form["auth"] = 'no'; +$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 @@ -87,8 +87,6 @@ $form["tabs"]['domain'] = array ( 'formtype' => 'TEXT', 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'destination_error_empty'), - 1 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'destination_error_unique'), ), 'default' => '', 'value' => '', diff --git a/interface/web/sites/form/mail_domain_relay.tform.php b/interface/web/sites/form/mail_domain_relay.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..eb208032d71ae72041768e9ed99ecef5b4bf61d3 --- /dev/null +++ b/interface/web/sites/form/mail_domain_relay.tform.php @@ -0,0 +1,104 @@ + 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"]['domain'] = array ( + 'title' => "Domain", + 'width' => 100, + 'template' => "templates/mail_domain_relay_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 1 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' => 'UNIQUE', + 'errmsg'=> 'domain_error_unique'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'value' => array('relay'=>'relay','local' => 'local','manual_relay'=>'manual Relay') + ), + 'active' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'CHECKBOX', + 'default' => '1', + 'value' => '1' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + + +?> \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_mail_domain.lng b/interface/web/sites/lib/lang/en_mail_domain.lng index 9645078df688bf763ccbabdd0247ba9e86b40383..c6a788e454ffc0f80167b15f16503324f6f85af6 100644 --- a/interface/web/sites/lib/lang/en_mail_domain.lng +++ b/interface/web/sites/lib/lang/en_mail_domain.lng @@ -5,4 +5,8 @@ $wb["type_txt"] = 'Type'; $wb["active_txt"] = 'Active'; $wb["btn_save_txt"] = 'Save'; $wb["btn_cancel_txt"] = 'Cancel'; +$wb["domain_error_empty"] = 'Domain is empty.'; +$wb["domain_error_unique"] = 'Duplicate Domain.'; +$wb["destination_error_empty"] = 'Destination is empty.'; + ?> \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_mail_domain_alias.lng b/interface/web/sites/lib/lang/en_mail_domain_alias.lng new file mode 100644 index 0000000000000000000000000000000000000000..37d6fb0fab7158498b1ea89842ea375babeeab42 --- /dev/null +++ b/interface/web/sites/lib/lang/en_mail_domain_alias.lng @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_mail_domain_alias_list.lng b/interface/web/sites/lib/lang/en_mail_domain_alias_list.lng index c5851ccc1c9298391c0ef54e05ae94ef7eb49478..75d9593a476c32a19d9b2197480f5f21c19cc44d 100644 --- a/interface/web/sites/lib/lang/en_mail_domain_alias_list.lng +++ b/interface/web/sites/lib/lang/en_mail_domain_alias_list.lng @@ -1,12 +1,13 @@ \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_mail_domain_list.lng b/interface/web/sites/lib/lang/en_mail_domain_list.lng index efdf7fc71de187dc5acd0698b7e639612da7ee94..990fa9d0daf4859471df99ce17941ae4394a9922 100644 --- a/interface/web/sites/lib/lang/en_mail_domain_list.lng +++ b/interface/web/sites/lib/lang/en_mail_domain_list.lng @@ -8,4 +8,5 @@ $wb["page_next_txt"] = 'Next'; $wb["page_back_txt"] = 'Back'; $wb["delete_txt"] = 'Delete'; $wb["filter_txt"] = 'Filter'; +$wb["add_new_record_txt"] = 'Add new Domain'; ?> \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_mail_domain_relay.lng b/interface/web/sites/lib/lang/en_mail_domain_relay.lng new file mode 100644 index 0000000000000000000000000000000000000000..87c85815be4db9a9df521b891714ca6bf7d17384 --- /dev/null +++ b/interface/web/sites/lib/lang/en_mail_domain_relay.lng @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_mail_domain_relay_list.lng b/interface/web/sites/lib/lang/en_mail_domain_relay_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..ac796d00be59369d73f43adda55385e3f32819f4 --- /dev/null +++ b/interface/web/sites/lib/lang/en_mail_domain_relay_list.lng @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php index 325b7c2a906cca1f5b552066f29631084f414d59..b3072291db03131ecfdf5d9caa11d73dd97f2bba 100644 --- a/interface/web/sites/lib/module.conf.php +++ b/interface/web/sites/lib/module.conf.php @@ -27,20 +27,32 @@ $module = array ( 'link' => 'sites/mail_domain_alias_list.php', ), 2 => + array ( + 'title' => 'Domain Relay', + 'target' => 'content', + 'link' => 'sites/mail_domain_relay_list.php', + ), + 3 => array ( 'title' => 'Email Mailbox', 'target' => 'content', 'link' => '', ), - 3 => + 4 => + array ( + 'title' => 'Email Alias', + 'target' => 'content', + 'link' => '', + ), + 5 => array ( 'title' => 'Email Forward', 'target' => 'content', 'link' => '', ), - 4 => + 6 => array ( - 'title' => 'Domain Catchall', + 'title' => 'Email Catchall', 'target' => 'content', 'link' => '', ), diff --git a/interface/web/sites/list/mail_domain_relay.list.php b/interface/web/sites/list/mail_domain_relay.list.php new file mode 100644 index 0000000000000000000000000000000000000000..9f0ea3549c0bee0d107c43212ae85da3e30b6d78 --- /dev/null +++ b/interface/web/sites/list/mail_domain_relay.list.php @@ -0,0 +1,68 @@ + "server_id", + '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' => ""); + +?> \ No newline at end of file diff --git a/interface/web/sites/mail_domain_alias_list.php b/interface/web/sites/mail_domain_alias_list.php index b948cb0beff11c4c506c72dcce312efb9f07bed4..6512cf1099bb53b83915e03eae1dbfd03cf7147c 100644 --- a/interface/web/sites/mail_domain_alias_list.php +++ b/interface/web/sites/mail_domain_alias_list.php @@ -19,6 +19,11 @@ if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) } $app->uses('listform_actions'); + +// Limit the results to alias domains +$app->listform_actions->SQLExtWhere = "type = 'alias'"; + +// Generate the page $app->listform_actions->onLoad(); diff --git a/interface/web/sites/mail_domain_list.php b/interface/web/sites/mail_domain_list.php index cc6d8f549f135f6e64b05183d376acacc6bc8d78..8098c05998afd350b17e9f785d8a096fb21f1ded 100644 --- a/interface/web/sites/mail_domain_list.php +++ b/interface/web/sites/mail_domain_list.php @@ -19,6 +19,10 @@ if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) } $app->uses('listform_actions'); + +// Limit the results to alias domains +$app->listform_actions->SQLExtWhere = "type = 'local'"; + $app->listform_actions->onLoad(); diff --git a/interface/web/sites/mail_domain_relay_del.php b/interface/web/sites/mail_domain_relay_del.php new file mode 100644 index 0000000000000000000000000000000000000000..a5eef580848bc867252374a869ee77e0d681f00a --- /dev/null +++ b/interface/web/sites/mail_domain_relay_del.php @@ -0,0 +1,54 @@ +uses("tform_actions"); +$app->tform_actions->onDelete(); + +?> \ No newline at end of file diff --git a/interface/web/sites/mail_domain_relay_edit.php b/interface/web/sites/mail_domain_relay_edit.php new file mode 100644 index 0000000000000000000000000000000000000000..fd8a3eacefd77c5fed8f15b12e1a8e4de282e542 --- /dev/null +++ b/interface/web/sites/mail_domain_relay_edit.php @@ -0,0 +1,56 @@ +uses('tpl,tform,tform_actions'); + +// let tform_actions handle the page +$app->tform_actions->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/sites/mail_domain_relay_list.php b/interface/web/sites/mail_domain_relay_list.php new file mode 100644 index 0000000000000000000000000000000000000000..b713b29daa428936e000f14feb9ef53637822f2f --- /dev/null +++ b/interface/web/sites/mail_domain_relay_list.php @@ -0,0 +1,30 @@ +uses('listform_actions'); + +// Limit the results to alias domains +$app->listform_actions->SQLExtWhere = "type = 'relay'"; + +// Generate the page +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file diff --git a/interface/web/sites/templates/mail_domain_alias_edit.htm b/interface/web/sites/templates/mail_domain_alias_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..029da8cb8b81f377ca6c8c6f83fb93330c06efe9 --- /dev/null +++ b/interface/web/sites/templates/mail_domain_alias_edit.htm @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='server_id_txt'}: + +
{tmpl_var name='domain_txt'}:
{tmpl_var name='destination_txt'}:
{tmpl_var name='active_txt'}:{tmpl_var name='active'}
  
  + +
+ + \ No newline at end of file diff --git a/interface/web/sites/templates/mail_domain_alias_list.htm b/interface/web/sites/templates/mail_domain_alias_list.htm index 357250ab1fccdeea5a59211d047676656751fd74..f5b2145753989a69921f4356e83caa0242c7032b 100644 --- a/interface/web/sites/templates/mail_domain_alias_list.htm +++ b/interface/web/sites/templates/mail_domain_alias_list.htm @@ -1,5 +1,6 @@

+

diff --git a/interface/web/sites/templates/mail_domain_list.htm b/interface/web/sites/templates/mail_domain_list.htm index e400ca3939e9ee5e12c497ccf7be7e3ddcfe1293..93e7d1a76bb9e2dc600916a2d072e432bae07910 100644 --- a/interface/web/sites/templates/mail_domain_list.htm +++ b/interface/web/sites/templates/mail_domain_list.htm @@ -1,6 +1,6 @@

-

+

diff --git a/interface/web/sites/templates/mail_domain_relay_edit.htm b/interface/web/sites/templates/mail_domain_relay_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..43de4421a0f49ecd66373fecf1c51d5d83650f2d --- /dev/null +++ b/interface/web/sites/templates/mail_domain_relay_edit.htm @@ -0,0 +1,29 @@ +
+ + + + + + + + + + + + + + + + + + + +
{tmpl_var name='server_id_txt'}: + +
{tmpl_var name='domain_txt'}:
{tmpl_var name='active_txt'}:{tmpl_var name='active'}
  
  + +
+ + \ No newline at end of file diff --git a/interface/web/sites/templates/mail_domain_relay_list.htm b/interface/web/sites/templates/mail_domain_relay_list.htm new file mode 100644 index 0000000000000000000000000000000000000000..7c2c0ebd2c9c7d5536a849431299749f661086c8 --- /dev/null +++ b/interface/web/sites/templates/mail_domain_relay_list.htm @@ -0,0 +1,27 @@ + +

+

+ + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="server_id"}{tmpl_var name="domain"}[{tmpl_var name='delete_txt'}]
+
\ No newline at end of file