Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ispconfig/ispconfig3
  • RealOpty/ispconfig3
  • Horfic/ispconfig3
  • kingcody/ispconfig3
  • mbethke/ispconfig3
  • harkman/ispconfig3
  • stefanheinen/ispconfig3
  • JanKraljic/ispconfig3
  • pulsweb/ispconfig3
  • kayyy/ispconfig3
  • mwacht/ispconfig3
  • schuetzm/ispconfig3
  • gbg/ispconfig3
  • jproxx/ispconfig3
  • Nilpo/ispconfig3
  • Cambra/ispconfig3
  • crackerizer/ispconfig3
  • simonswine/ispconfig3
  • zbuzanic/ispconfig3
  • alexalouit/ispconfig3
  • guilhermefilippo/ispconfig3
  • kotishe/ispconfig3
  • Rescue9/ispconfig3
  • DmitriyLyalyuev/ispconfig3
  • simon.levesque/ispconfig3
  • Viktor/ispconfig3
  • Dr4c0/ispconfig3
  • stefanmcds-mnt/ispconfig3
  • Konflikted/ispconfig3
  • Schoene/ispconfig3
  • stefan.eertwegh/ispconfig3
  • Quest/ispconfig3
  • bst2002/ispconfig3
  • jphustman/ispconfig3
  • lepirlouit/ispconfig3
  • lolo888/ispconfig3
  • Quetzal/ispconfig3
  • kolorafa/ispconfig3
  • jdsn/ispconfig3
  • mk/ispconfig3
  • jnorell/ispconfig3
  • madalin/ispconfig3
  • edspiner/ispconfig3
  • blu3bird/ispconfig3
  • ITManager/ispconfig3
  • virtualweb/ispconfig3
  • dirkd/ispconfig3
  • jcdirks/ispconfig3
  • bvbmedia/ispconfig3
  • CSoellinger/ispconfig3
  • lutacon/ispconfig3
  • armsby/ispconfig3
  • psantos/ispconfig3
  • pkdevbox_y/ispconfig3
  • tlanger/ispconfig3
  • Krauser/ispconfig3
  • ochorocho/ispconfig3
  • aisfrond/ispconfig3
  • ldrrp/ispconfig3
  • steglicd/ispconfig3
  • darkalex/ispconfig3
  • b.dokimakis/ispconfig3
  • MarioSteinitz/ispconfig3
  • bweston/ispconfig3
  • bob/ispconfig3
  • HHGAG/ispconfig3
  • ark74/ispconfig3
  • fuerni/ispconfig3
  • hexblot/ispconfig3
  • maxxer/ispconfig3
  • JustDevZero/ispconfig3
  • habeggerl/ispconfig3
  • phpexpert/ispconfig3
  • Questler/ispconfig3
  • JanThiel/ispconfig3
  • joni_1993/ispconfig3
  • MePha/ispconfig3
  • flies/ispconfig3
  • macjohnny/ispconfig3
  • csegarra/ispconfig3
  • Tibius/ispconfig3
  • wairuru/ispconfig3
  • pdreissen/ispconfig3
  • mgiworx/ispconfig3
  • michielp/ispconfig3
  • ZarToK/ispconfig3
  • x-f/ispconfig3
  • tomlankhorst/ispconfig3
  • olivier.br/ispconfig3
  • hajti/ispconfig3
  • JaviSabalete/ispconfig3
  • dharman/ispconfig3
  • Martin-enavn/ispconfig3
  • Fr3k4Life/ispconfig3
  • Caldeira/ispconfig3
  • enavn/ispconfig3
  • cybernet2u/ispconfig3
  • Denny/ispconfig3
  • jbbr/ispconfig3
  • kakohari/ispconfig3
  • almere/ispconfig3
  • Kyokata/ispconfig3
  • burn/ispconfig3
  • feldsam/ispconfig3
  • woutervddn/ispconfig3
  • tm/ispconfig3
  • blount/ispconfig3
  • pravdomil/ispconfig3
  • manyk/ispconfig3
  • Poppabear/ispconfig3
  • t1st3/ispconfig3
  • scrat14/ispconfig3
  • ncomputers.org/ispconfig3
  • wlisik/ispconfig3
  • CupOfTea696/ispconfig3
  • ogmelch/ispconfig3
  • techwolf12/ispconfig3
  • timo.boldt/ispconfig3
  • DemoFreak/ispconfig3
  • EndelWar/ispconfig3
  • maanus/ispconfig3
  • ms217/ispconfig3
  • luisvivasb/ispconfig3
  • Ismir/ispconfig3
  • truongld/ispconfig3
  • nhutphan/ispconfig3
  • ram/ispconfig3
  • josemorenoasix/ispconfig3
  • onestepp/ispconfig3
  • gguglielmetti/ispconfig3
  • andre/ispconfig3
  • omig/ispconfig3
  • liane/ispconfig3
  • PVasileff/ispconfig3
  • mattanja/ispconfig3
  • dnl-jst/ispconfig3
  • jkalousek/ispconfig3
  • lgg42/ispconfig3
  • ispcomm/ispconfig3
  • moglgasy/ispconfig3
  • natanfelles/ispconfig3
  • cristiandeluxe/ispconfig3
  • pete/ispconfig3
  • Sosha/ispconfig3
  • shr3k/ispconfig3
  • niceit/ispconfig3
  • dani/ispconfig3
  • Ongaro/ispconfig3
  • Djidel/ispconfig3
  • andre.ballensiefen/ispconfig3
  • qroac/ispconfig3
  • magenbrot/ispconfig3
  • doekia/ispconfig3
  • edersonmora/ispconfig3
  • zucha.imz/ispconfig3
  • ckc/ispconfig3
  • Sroka/ispconfig3
  • batgau/ispconfig3
  • isp/ispconfig3
  • oboumati/ispconfig3
  • mscholz/ispconfig3
  • katiak/ispconfig3
  • jamiroph/ispconfig3
  • buhlerax/ispconfig3
  • johan/ispconfig3
  • KordianBruck/ispconfig3
  • trs997/ispconfig3
  • Funclineal/ispconfig3
  • xals/ispconfig3
  • sververda/ispconfig3
  • presure/ispconfig3
  • vojtech.myslivec/ispconfig3
  • helmo/ispconfig3
  • brody/ispconfig3
  • GameO7er/ispconfig3
  • webslice/ispconfig3
  • ufoonline/ispconfig3
  • alwin/ispconfig3
  • t.heller/ispconfig3
  • philipp/ispconfig3
  • andrzejs/ispconfig3
  • pixcept/ispconfig3
  • tgmedia/ispconfig3
  • Nardol/ispconfig3
  • m42e/ispconfig3
  • condless/ispconfig3
  • alesak/ispconfig3
  • MasonChase/ispconfig3
  • brt/ispconfig3
  • Rusek/ispconfig3
  • credz/ispconfig3
  • fiftyz/ispconfig3
  • dciancu/ispconfig3
  • thom/ispconfig3
  • florian030/ispconfig3
  • Mixasik/ispconfig3
  • SimonSparks/ispconfig3
  • eurodomenii/ispconfig3
  • vitex/ispconfig3
  • mitho/ispconfig3
  • CaptainStarbuck/ispconfig3
  • renky/ispconfig3
  • d--j/ispconfig3
  • inetspec/ispconfig3
  • Christian/ispconfig3
  • lukav/ispconfig3
  • galgenjunge/ispconfig3
  • gody/ispconfig3
  • kpendic/ispconfig3
  • diciannove/ispconfig3
  • tbasler/ispconfig3
  • logifech/ispconfig3
  • maximaweb/ispconfig3
  • tommaso-perondi/ispconfig3
  • francoisPE/ispconfig3
  • elgeorge2k/ispconfig3
  • francoisgrizzlydev/ispconfig3
  • Chris_UK/ispconfig3
  • mrutkowski/ispconfig3
  • mladen074/ispconfig3
  • trogper/ispconfig3
  • Lokutos/ispconfig3
  • manoaratefy/ispconfig3
  • GwynethLlewelyn/ispconfig3
  • tim427/ispconfig3
  • mapreri/ispconfig3
  • gsubiron/ispconfig3
  • eriam/ispconfig3
  • Steveorevo/ispconfig3
  • Jens/ispconfig3
  • ebela/ispconfig3
  • typoworx/ispconfig3
  • teuto.net/ispconfig3
  • sonority/ispconfig3
  • element/ispconfig3
  • Petar/ispconfig3
  • ewsp/ispconfig3
  • bicisteadm/ispconfig3
  • ivmm/ispconfig3
  • blinkenbox/ispconfig3
  • Samgarr/ispconfig3
  • B.Richard/ispconfig3
  • ahrasis/ispconfig3
  • nephi.aust/ispconfig3
  • beastycoding/ispconfig3
  • luttje/ispconfig3
  • hairy/ispconfig3
  • styxtdo/ispconfig3
  • SGr33n/ispconfig3
  • mepstein/ispconfig3
  • kobuki/ispconfig3
  • dachris/ispconfig3
  • mina/ispconfig3
253 results
Show changes
Showing
with 336 additions and 17 deletions
......@@ -256,6 +256,13 @@ class page_action extends tform_actions {
$app->tpl->setVar('dkim_public', $rec['dkim_public'], true);
if (!empty($rec['dkim_public'])) $app->tpl->setVar('dns_record', $dns_record, true);
$csrf_token = $app->auth->csrf_token_get('mail_domain_del');
$app->tpl->setVar('_csrf_id', $csrf_token['csrf_id']);
$app->tpl->setVar('_csrf_key', $csrf_token['csrf_key']);
$global_config = $app->getconf->get_global_config();
$app->tpl->setVar('show_delete_on_forms', $global_config['misc']['show_delete_on_forms']);
parent::onShowEnd();
}
......
......@@ -86,6 +86,13 @@ class page_action extends tform_actions {
}
$app->tpl->setVar("email_domain", $domain_select);
$csrf_token = $app->auth->csrf_token_get('mail_forward_del');
$app->tpl->setVar('_csrf_id', $csrf_token['csrf_id']);
$app->tpl->setVar('_csrf_key', $csrf_token['csrf_key']);
$global_config = $app->getconf->get_global_config();
$app->tpl->setVar('show_delete_on_forms', $global_config['misc']['show_delete_on_forms']);
parent::onShowEnd();
}
......
......@@ -50,6 +50,16 @@ $app->load('tform_actions');
class page_action extends tform_actions {
// MX10
function onSubmit() {
global $app, $conf;
// Leading '@' is mandatory, if domainname.
if(!preg_match('/@/', $this->dataRecord["source"])) {
$this->dataRecord["source"] = '@' . $this->dataRecord["source"];
}
parent::onSubmit();
}
}
$app->tform_actions = new page_action;
......
......@@ -82,6 +82,10 @@ class page_action extends tform_actions {
$rec["type"] = $types[$tmp_parts[0]] ? $tmp_parts[0] : 'custom';
}
}
// MX10
$rec["type"] = 'custom';
if($rec["type"] == 'custom') {
$dest = $this->dataRecord["transport"];
} elseif(!empty($tmp_parts[2])) {
......@@ -163,6 +167,8 @@ class page_action extends tform_actions {
if($this->dataRecord["type"] == 'custom') {
$this->dataRecord["transport"] = $transport;
// MX10
$this->dataRecord["transport"] = 'alternatefrom';
} else {
$this->dataRecord["transport"] = $this->dataRecord["type"].':'.$transport;
}
......
......@@ -146,6 +146,13 @@ class page_action extends tform_actions {
$app->tpl->setVar("enable_custom_login", 0);
}
$csrf_token = $app->auth->csrf_token_get('mail_user_del');
$app->tpl->setVar('_csrf_id', $csrf_token['csrf_id']);
$app->tpl->setVar('_csrf_key', $csrf_token['csrf_key']);
$global_config = $app->getconf->get_global_config();
$app->tpl->setVar('show_delete_on_forms', $global_config['misc']['show_delete_on_forms']);
parent::onShowEnd();
}
......
......@@ -38,7 +38,12 @@
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<input type="hidden" name="type" value="alias">
<div class="clear"><div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_alias_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_alias_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div></div>
<div class="clear">
<tmpl_if name='id'><tmpl_if name='show_delete_on_forms' op="==" value="y">
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('mail/mail_alias_del.php?id={tmpl_var name='id'}&_csrf_id={tmpl_var name='_csrf_id'}&_csrf_key={tmpl_var name='_csrf_key'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a>
</tmpl_if></tmpl_if>
<div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_alias_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_alias_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div>
</div>
......@@ -139,10 +139,15 @@
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<input type="hidden" name="type" value="local">
<div class="clear"><div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_domain_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_domain_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div></div>
<div class="clear">
<tmpl_if name='id'><tmpl_if name='show_delete_on_forms' op="==" value="y">
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('mail/mail_domain_del.php?id={tmpl_var name='id'}&_csrf_id={tmpl_var name='_csrf_id'}&_csrf_key={tmpl_var name='_csrf_key'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a>
</tmpl_if></tmpl_if>
<div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_domain_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_domain_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div>
</div>
<script language="JavaScript" type="text/javascript">
$("#dkim-button").click(function() { getDKIM(); });
......
......@@ -36,7 +36,12 @@
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<input type="hidden" name="type" value="forward">
<div class="clear"><div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_forward_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_forward_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div></div>
<div class="clear">
<tmpl_if name='id'><tmpl_if name='show_delete_on_forms' op="==" value="y">
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('mail/mail_domain_del.php?id={tmpl_var name='id'}&_csrf_id={tmpl_var name='_csrf_id'}&_csrf_key={tmpl_var name='_csrf_key'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a>
</tmpl_if></tmpl_if>
<div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_forward_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_forward_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div>
</div>
......@@ -114,7 +114,12 @@
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="clear"><div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_user_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_user_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div></div>
<div class="clear">
<tmpl_if name='id'><tmpl_if name='show_delete_on_forms' op="==" value="y">
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('mail/mail_user_del.php?id={tmpl_var name='id'}&_csrf_id={tmpl_var name='_csrf_id'}&_csrf_key={tmpl_var name='_csrf_key'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a>
</tmpl_if></tmpl_if>
<div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_user_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_user_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div>
</div>
......@@ -166,4 +166,7 @@ $wb['no_munin_url_defined_txt'] = 'No Munin URL defined.';
$wb['no_permissions_to_view_munin_txt'] = 'You are not allowed to access Munin.';
$wb['Database size'] = 'Database size';
$wb['MySQL Database size'] = 'MySQL Database size';
$wb['monitor_title_mx_ip_match_txt'] = 'MX record to server IP match';
$wb['no_data_mx_ip_match_txt'] = 'MX record check data present';
$wb['monitor_serverstate_mx_ip_matchwarning_txt'] = 'Not all DNS MX records match the server IP';
?>
......@@ -114,6 +114,14 @@ case 'mailq':
$description = '';
$add_padding = true;
break;
case 'mx_ip_match':
$template = 'templates/show_data.htm';
$output .= $app->tools_monitor->showMx_ip_match();
$time = $app->tools_monitor->getDataTime('mx_ip_match');
$title = $app->lng("monitor_title_mx_ip_match_txt"). ' ('. $monTransSrv .' : ' . $_SESSION['monitor']['server_name'] . ')';
$description = '';
$add_padding = true;
break;
case 'raid_state':
$template = 'templates/show_data.htm';
$output .= $app->tools_monitor->showRaidState();
......
......@@ -557,6 +557,22 @@ function _processDbState($type, $serverId, $serverState, $messages) {
break;
}
}
if ($type == 'mx_ip_match') {
switch ($record['state']) {
case 'ok':
$messages[$app->lng("monitor_serverstate_listok_txt")][] = $app->lng("monitor_serverstate_mx_ip_matchok_txt") . ' ' .
"<a href='#' data-load-content='monitor/show_data.php?type=mx_ip_match'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
break;
case 'warning':
$messages[$app->lng("monitor_serverstate_listwarning_txt")][] = $app->lng("monitor_serverstate_mx_ip_matchwarning_txt") . ' ' .
"<a href='#' data-load-content='monitor/show_data.php?type=mx_ip_match'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
break;
default:
$messages[$app->lng("monitor_serverstate_listunknown_txt")][] = $app->lng("monitor_serverstate_mx_ip_match_unknown_txt") . ' ' .
"<a href='#' data-load-content='monitor/show_data.php?type=mx_ip_match'>[" . $app->lng("monitor_serverstate_more_txt") . "]</a>";
break;
}
}
if ($type == 'sys_log') {
switch ($record['state']) {
......
<?php
/*
Copyright (c) 2020, Herman van Rink, Initfour websolutions
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 cronjob_monitor_domain_mx extends cronjob {
// job schedule
protected $_schedule = '30 6 * * *';
protected $_run_at_new = true;
private $_tools = null;
/* this function is optional if it contains no custom code */
public function onPrepare() {
global $app;
parent::onPrepare();
}
/* this function is optional if it contains no custom code */
public function onBeforeRun() {
global $app;
return parent::onBeforeRun();
}
private function _resolveHostnameBoth46($hostname) {
global $app;
$app->uses('getconf,functions');
$smtpin_ips = gethostbynamel($hostname);
$smtpin_ips_v6 = $app->functions->gethostbynamel6($hostname);
if ($smtpin_ips_v6) {
$smtpin_ips = array_merge($smtpin_ips, $smtpin_ips_v6);
}
return $smtpin_ips;
}
public function onRunJob() {
global $app, $conf;
$app->uses('getconf,functions');
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
/* used for all monitor cronjobs */
$app->load('monitor_tools');
$this->_tools = new monitor_tools();
/* end global section for monitor cronjobs */
// Initialize data array
$data = array();
$state = 'no_state';
// the id of the server as int
$server_id = intval($conf['server_id']);
$hostname = $app->system->hostname();
$smtpin_ips = $this->_resolveHostnameBoth46($hostname);
# Add additional IP's, e.g. an extrernal spamfilter/proxy.
if (!empty($mail_config['additional_smtp_hostnames'])) {
$additional_smtp_hostnames = explode(',', $mail_config['additional_smtp_hostnames']);
foreach ($additional_smtp_hostnames as $hostname) {
$extra = $this->_resolveHostnameBoth46($hostname);
if ($extra) {
$smtpin_ips = array_merge($smtpin_ips, $extra);
}
}
}
# Add additional IP's , e.g. for secondary IP on the same box or a proxy.
if (!empty($mail_config['additional_smtp_ips'])) {
$smtpin_ips = array_merge($smtpin_ips, explode(',', $mail_config['additional_smtp_ips']));
}
$maildomains = $app->db->queryAllRecords("SELECT domain, active FROM mail_domain WHERE server_id = ?", $server_id);
if(is_array($maildomains)) {
$state = 'ok';
foreach ($maildomains as $maildomain) {
$mx_records = array();
$mx_weight = array();
$found_mx = getmxrr($maildomain['domain'], $mx_records, $mx_weight) ;
$mx_sorted = array();
// Merge records and weight into a single array to sort on priority.
// ignore multiple mx's at the same weight
foreach ($mx_records as $key => $name) {
$mx_sorted[$mx_weight[$key]] = $mx_records[$key];
}
ksort ($mx_sorted, SORT_NUMERIC);
reset ($mx_sorted);
$first_mx = array_shift($mx_sorted);
$mx_ip = gethostbyname($first_mx);
if (!in_array( $mx_ip, $smtpin_ips)) {
if ($maildomain['active'] == 'y') {
$str = 'Domain is active but the DNS does not match our IP. ( points to: ' . ($first_mx ?? 'not found') . ')';
$app->log('Mail domain[' . $maildomain['domain'] . ']: ' . $str, LOGLEVEL_WARN);
$state = 'warning';
$data[$maildomain['domain']] = $str;
} else {
$app->log('Good, the mail domain[' . $maildomain['domain'] . '] is not active and DNS is not pointing to us.', LOGLEVEL_DEBUG);
}
}
else {
if ($maildomain['active'] == 'n') {
$app->log('DNS points to our IP but the mail domain[' . $maildomain['domain'] . '] is not active.', LOGLEVEL_WARN);
$state = 'warning';
$data[$maildomain['domain']] = 'DNS points to our IP but the mail domain is not active.';
}
else {
// DNS OK.
}
}
}
}
$res = array();
$res['server_id'] = $server_id;
$res['type'] = 'mx_ip_match';
$res['data'] = $data;
$res['state'] = $state;
/**
* Insert the data into the database
*/
$sql = 'REPLACE INTO monitor_data (server_id, type, created, data, state) ' .
'VALUES (?, ?, UNIX_TIMESTAMP(), ?, ?)';
$app->dbmaster->query($sql, $res['server_id'], $res['type'], serialize($res['data']), $res['state']);
// The new data is written, now we can delete the old one.
$this->_tools->delOldRecords($res['type'], $res['server_id']);
parent::onRunJob();
}
/* this function is optional if it contains no custom code */
public function onAfterRun() {
global $app;
parent::onAfterRun();
}
}
?>
......@@ -483,6 +483,63 @@ class functions {
}
}
/**
* From https://www.php.net/manual/en/function.gethostbyname.php#70936
*/
public function gethostbyname6($host, $try_a = false) {
// get AAAA record for $host
// if $try_a is true, if AAAA fails, it tries for A
// the first match found is returned
// otherwise returns false
$dns = gethostbynamel6($host, $try_a);
if ($dns == false) { return false; }
else { return $dns[0]; }
}
/**
* From https://www.php.net/manual/en/function.gethostbyname.php#70936
*/
public function gethostbynamel6($host, $try_a = false) {
// get AAAA records for $host,
// if $try_a is true, if AAAA fails, it tries for A
// results are returned in an array of ips found matching type
// otherwise returns false
$dns6 = dns_get_record($host, DNS_AAAA);
if ($try_a == true) {
$dns4 = dns_get_record($host, DNS_A);
$dns = array_merge($dns4, $dns6);
}
else { $dns = $dns6; }
$ip6 = array();
$ip4 = array();
foreach ($dns as $record) {
if ($record["type"] == "A") {
$ip4[] = $record["ip"];
}
if ($record["type"] == "AAAA") {
$ip6[] = $record["ipv6"];
}
}
if (count($ip6) < 1) {
if ($try_a == true) {
if (count($ip4) < 1) {
return false;
}
else {
return $ip4;
}
}
else {
return false;
}
}
else {
return $ip6;
}
}
}
?>
......@@ -88,7 +88,7 @@ echo "\n".str_repeat('-', 80)."\n";
echo "\n\n>> Update \n\n";
echo "Please choose the update method. For production systems select 'stable'. \nWARNING: The update from GIT is only for development systems and may break your current setup. Do not use the GIT version on servers that host any live websites!\nNote: On Multiserver systems, enable maintenance mode and update your master server first. Then update all slave servers, and disable maintenance mode when all servers are updated.\n\n";
$method = simple_query('Select update method', array('stable', 'nightly', 'git-develop'), 'stable');
$method = simple_query('Select update method', array('stable', 'nightly', 'git-develop', 'stable-helmo', 'testing-helmo'), 'stable-helmo');
if($method == 'stable') {
$new_version = @file_get_contents('https://www.ispconfig.org/downloads/ispconfig3_version.txt') or die('Unable to retrieve version file.');
......
......@@ -27,6 +27,10 @@ elif [[ "$SOURCE" == "nightly" ]] ; then
URL="https://www.ispconfig.org/downloads/ISPConfig-3-nightly.tar.gz"
elif [[ "$SOURCE" == "git-develop" ]] ; then
URL="https://git.ispconfig.org/ispconfig/ispconfig3/-/archive/develop/ispconfig3-develop.tar.gz"
elif [[ "$SOURCE" == "testing-helmo" ]] ; then
URL="https://git.ispconfig.org/helmo/ispconfig3/-/archive/testing-helmo/ispconfig3-testing-helmo.tar.gz"
elif [[ "$SOURCE" == "stable-helmo" ]] ; then
URL="https://git.ispconfig.org/helmo/ispconfig3/-/archive/stable-helmo/ispconfig3-stable-helmo.tar.gz"
else
echo "Please choose an installation source (stable, nightly, git-develop)"
exit 1
......