Skip to content

Commit 53f4a0b

Browse files
author
Marius Cramer
committed
Merge remote-tracking branch 'schoene/master'
2 parents b80a703 + 4f69fb7 commit 53f4a0b

34 files changed

+250
-45
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
#### Config ################################
3+
4+
DBHOST="localhost"
5+
DBUSER="powerdns"
6+
DBPASS="password"
7+
DATABASE="powerdns"
8+
9+
DEBUG="no"
10+
11+
#### End of Config #########################
12+
13+
REQUIRED_COMMANDS="
14+
mysql
15+
host
16+
grep
17+
awk
18+
tail
19+
"
20+
21+
# print debug messages to STDERR
22+
function debug {
23+
if [ "${DEBUG}" == "yes" ] ; then
24+
echo "DEBUG: $@" >&2
25+
fi
26+
}
27+
28+
for CMD in ${REQUIRED_COMMANDS} ; do
29+
CMDNAME=`echo ${CMD} | awk '{print toupper($1) }' | sed -e s@"-"@""@g`
30+
export $(eval "echo ${CMDNAME}")=`which ${CMD} 2>/dev/null`
31+
if [ -z "${!CMDNAME}" ] ; then
32+
debug "Command: ${CMD} not found!"
33+
exit 1
34+
else
35+
debug "Found command $(echo $CMDNAME) in ${!CMDNAME}"
36+
fi
37+
done
38+
39+
MYSQLCMD="${MYSQL} -h ${DBHOST} -u ${DBUSER} -p${DBPASS} --skip-column-name --silent -e"
40+
41+
check() {
42+
AUTH=`${HOST} -t SOA ${2} ${1} | ${TAIL} -n1 | ${GREP} "has no SOA record"`
43+
if [ "${AUTH}" == "${2} has no SOA record" ]; then
44+
debug "Server ${1} has no SOA for ${2} - removing zone..."
45+
DOMAIN_ID=`${MYSQLCMD} "USE ${DATABASE}; SELECT id FROM domains WHERE name='${2}' AND type='SLAVE' AND master='${1}' LIMIT 1;"`
46+
${MYSQLCMD} "USE ${DATABASE}; DELETE FROM records WHERE domain_id='${DOMAIN_ID}';"
47+
${MYSQLCMD} "USE ${DATABASE}; DELETE FROM domains WHERE id='${DOMAIN_ID}';"
48+
fi
49+
}
50+
51+
MASTERS=(`${MYSQLCMD} "USE ${DATABASE}; SELECT DISTINCT ip FROM supermasters;"`)
52+
for m in "${MASTERS[@]}"; do
53+
NAMES=(`${MYSQLCMD} "USE ${DATABASE}; SELECT name FROM domains WHERE type = 'SLAVE' AND master = '${m}';"`)
54+
for d in "${NAMES[@]}"; do
55+
check ${m} ${d}
56+
done
57+
done

install/autoupdate.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,10 @@
228228
$inst->configure_spamassassin();
229229

230230
//** Configure Amavis
231-
swriteln('Configuring Amavisd');
232-
$inst->configure_amavis();
231+
if($conf['amavis']['installed'] == true) {
232+
swriteln('Configuring Amavisd');
233+
$inst->configure_amavis();
234+
}
233235

234236
//** Configure Getmail
235237
swriteln('Configuring Getmail');

install/install.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@
216216
$inst->configure_spamassassin();
217217

218218
//* Configure Amavis
219-
swriteln('Configuring Amavisd');
220-
$inst->configure_amavis();
219+
if($conf['amavis']['installed'] == true) {
220+
swriteln('Configuring Amavisd');
221+
$inst->configure_amavis();
222+
}
221223

222224
//* Configure Getmail
223225
swriteln('Configuring Getmail');

install/update.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@
289289
$inst->configure_spamassassin();
290290

291291
//** Configure Amavis
292-
swriteln('Configuring Amavisd');
293-
$inst->configure_amavis();
292+
if($conf['amavis']['installed'] == true) {
293+
swriteln('Configuring Amavisd');
294+
$inst->configure_amavis();
295+
}
294296

295297
//** Configure Getmail
296298
swriteln('Configuring Getmail');

interface/lib/plugins/mail_user_filter_plugin.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private function mail_user_filter_get_rule($page_form) {
149149
} elseif ($page_form->dataRecord["op"] == 'is') {
150150
$content .= $searchterm."$";
151151
} elseif ($page_form->dataRecord["op"] == 'begins') {
152-
$content .= " ".$searchterm."";
152+
$content .= "^".$searchterm.".*";
153153
} elseif ($page_form->dataRecord["op"] == 'ends') {
154154
$content .= ".*".$searchterm."$";
155155
}

interface/web/dns/dns_wizard.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@
202202

203203
if(isset($_POST['ip']) && $_POST['ip'] == '') $error .= $app->lng('error_ip_empty').'<br />';
204204

205+
if(isset($_POST['ipv6']) && $_POST['ipv6'] == '') $error .= $app->lng('error_ipv6_empty').'<br />';
206+
205207
if(isset($_POST['ns1']) && $_POST['ns1'] == '') $error .= $app->lng('error_ns1_empty').'<br />';
206208
elseif(isset($_POST['ns1']) && !preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z0-9]{2,30}$/', $_POST['ns1'])) $error .= $app->lng('error_ns1_regex').'<br />';
207209

@@ -238,6 +240,7 @@
238240
$tpl_content = $template_record['template'];
239241
if($_POST['domain'] != '') $tpl_content = str_replace('{DOMAIN}', $_POST['domain'], $tpl_content);
240242
if($_POST['ip'] != '') $tpl_content = str_replace('{IP}', $_POST['ip'], $tpl_content);
243+
if($_POST['ipv6'] != '') $tpl_content = str_replace('{IPV6}',$_POST['ipv6'],$tpl_content);
241244
if($_POST['ns1'] != '') $tpl_content = str_replace('{NS1}', $_POST['ns1'], $tpl_content);
242245
if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content);
243246
if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content);

interface/web/dns/form/dns_template.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
'formtype' => 'CHECKBOXARRAY',
7575
'default' => '',
7676
'separator' => ',',
77-
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM (use TXT|{DOMAIN}.|{DKIM} in your Template)'),
77+
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM (use TXT|{DOMAIN}.|{DKIM} in your Template)'),
7878
'validators' => array ( 0 => array ('type' => 'CUSTOM',
7979
'class' => 'validate_dkim',
8080
'function' => 'check_template',

interface/web/dns/lib/lang/ar_dns_wizard.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Email';
99
$wb['ns1_txt'] = 'NS 1';
1010
$wb['ns2_txt'] = 'NS 2';
1111
$wb['ip_txt'] = 'IP Address';
12+
$wb['ipv6_txt'] = 'IPv6 Address';
1213
$wb['error_origin_empty'] = 'Origin empty.';
1314
$wb['error_ns_empty'] = 'NS empty.';
1415
$wb['error_mbox_empty'] = 'Mbox empty.';
@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum empty.';
1920
$wb['error_ttl_empty'] = 'TTL empty.';
2021
$wb['error_domain_empty'] = 'Domain empty';
2122
$wb['error_ip_empty'] = 'IP empty.';
23+
$wb['error_ipv6_empty'] = 'IPv6 empty.';
2224
$wb['error_ns1_empty'] = 'NS1 empty.';
2325
$wb['error_ns2_empty'] = 'NS2 empty.';
2426
$wb['error_email_empty'] = 'EMail empty.';

interface/web/dns/lib/lang/bg_dns_wizard.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Емайл';
99
$wb['ns1_txt'] = 'NS 1';
1010
$wb['ns2_txt'] = 'NS 2';
1111
$wb['ip_txt'] = 'IP адрес';
12+
$wb['ipv6_txt'] = 'IPv6 адрес';
1213
$wb['error_origin_empty'] = 'Origin empty.';
1314
$wb['error_ns_empty'] = 'NS empty.';
1415
$wb['error_mbox_empty'] = 'Mbox empty.';
@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum empty.';
1920
$wb['error_ttl_empty'] = 'TTL empty.';
2021
$wb['error_domain_empty'] = 'Domain empty';
2122
$wb['error_ip_empty'] = 'IP empty.';
23+
$wb['error_ipv6_empty'] = 'IPv6 empty.';
2224
$wb['error_ns1_empty'] = 'NS1 empty.';
2325
$wb['error_ns2_empty'] = 'NS2 empty.';
2426
$wb['error_email_empty'] = 'Полето с имейла е празно';

interface/web/dns/lib/lang/br_dns_wizard.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Correio';
99
$wb['ns1_txt'] = 'NS 1';
1010
$wb['ns2_txt'] = 'NS 2';
1111
$wb['ip_txt'] = 'Endereço IP';
12+
$wb['ipv6_txt'] = 'Endereço IPv6';
1213
$wb['error_origin_empty'] = 'Origem em branco.';
1314
$wb['error_ns_empty'] = 'NS vazio.';
1415
$wb['error_mbox_empty'] = 'Mbox vazia.';
@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum vazio.';
1920
$wb['error_ttl_empty'] = 'TTL vazio.';
2021
$wb['error_domain_empty'] = 'Domínio vazio';
2122
$wb['error_ip_empty'] = 'IP vazio.';
23+
$wb['error_ipv6_empty'] = 'IPv6 vazio.';
2224
$wb['error_ns1_empty'] = 'NS1 vazio.';
2325
$wb['error_ns2_empty'] = 'NS2 vazio.';
2426
$wb['error_email_empty'] = 'Correio vazio.';

0 commit comments

Comments
 (0)