Commits (11)
#!/bin/bash
#### Config ################################
DBHOST="localhost"
DBUSER="powerdns"
DBPASS="password"
DATABASE="powerdns"
DEBUG="no"
#### End of Config #########################
REQUIRED_COMMANDS="
mysql
host
grep
awk
tail
"
# print debug messages to STDERR
function debug {
if [ "${DEBUG}" == "yes" ] ; then
echo "DEBUG: $@" >&2
fi
}
for CMD in ${REQUIRED_COMMANDS} ; do
CMDNAME=`echo ${CMD} | awk '{print toupper($1) }' | sed -e s@"-"@""@g`
export $(eval "echo ${CMDNAME}")=`which ${CMD} 2>/dev/null`
if [ -z "${!CMDNAME}" ] ; then
debug "Command: ${CMD} not found!"
exit 1
else
debug "Found command $(echo $CMDNAME) in ${!CMDNAME}"
fi
done
MYSQLCMD="${MYSQL} -h ${DBHOST} -u ${DBUSER} -p${DBPASS} --skip-column-name --silent -e"
check() {
AUTH=`${HOST} -t SOA ${2} ${1} | ${TAIL} -n1 | ${GREP} "has no SOA record"`
if [ "${AUTH}" == "${2} has no SOA record" ]; then
debug "Server ${1} has no SOA for ${2} - removing zone..."
DOMAIN_ID=`${MYSQLCMD} "USE ${DATABASE}; SELECT id FROM domains WHERE name='${2}' AND type='SLAVE' AND master='${1}' LIMIT 1;"`
${MYSQLCMD} "USE ${DATABASE}; DELETE FROM records WHERE domain_id='${DOMAIN_ID}';"
${MYSQLCMD} "USE ${DATABASE}; DELETE FROM domains WHERE id='${DOMAIN_ID}';"
fi
}
MASTERS=(`${MYSQLCMD} "USE ${DATABASE}; SELECT DISTINCT ip FROM supermasters;"`)
for m in "${MASTERS[@]}"; do
NAMES=(`${MYSQLCMD} "USE ${DATABASE}; SELECT name FROM domains WHERE type = 'SLAVE' AND master = '${m}';"`)
for d in "${NAMES[@]}"; do
check ${m} ${d}
done
done
......@@ -228,8 +228,10 @@ if($conf['services']['mail'] == true) {
$inst->configure_spamassassin();
//** Configure Amavis
swriteln('Configuring Amavisd');
$inst->configure_amavis();
if($conf['amavis']['installed'] == true) {
swriteln('Configuring Amavisd');
$inst->configure_amavis();
}
//** Configure Getmail
swriteln('Configuring Getmail');
......
......@@ -216,8 +216,10 @@ if($install_mode == 'standard') {
$inst->configure_spamassassin();
//* Configure Amavis
swriteln('Configuring Amavisd');
$inst->configure_amavis();
if($conf['amavis']['installed'] == true) {
swriteln('Configuring Amavisd');
$inst->configure_amavis();
}
//* Configure Getmail
swriteln('Configuring Getmail');
......
......@@ -289,8 +289,10 @@ if($reconfigure_services_answer == 'yes') {
$inst->configure_spamassassin();
//** Configure Amavis
swriteln('Configuring Amavisd');
$inst->configure_amavis();
if($conf['amavis']['installed'] == true) {
swriteln('Configuring Amavisd');
$inst->configure_amavis();
}
//** Configure Getmail
swriteln('Configuring Getmail');
......
......@@ -149,7 +149,7 @@ class mail_user_filter_plugin {
} elseif ($page_form->dataRecord["op"] == 'is') {
$content .= $searchterm."$";
} elseif ($page_form->dataRecord["op"] == 'begins') {
$content .= " ".$searchterm."";
$content .= "^".$searchterm.".*";
} elseif ($page_form->dataRecord["op"] == 'ends') {
$content .= ".*".$searchterm."$";
}
......
......@@ -202,6 +202,8 @@ if($_POST['create'] == 1) {
if(isset($_POST['ip']) && $_POST['ip'] == '') $error .= $app->lng('error_ip_empty').'<br />';
if(isset($_POST['ipv6']) && $_POST['ipv6'] == '') $error .= $app->lng('error_ipv6_empty').'<br />';
if(isset($_POST['ns1']) && $_POST['ns1'] == '') $error .= $app->lng('error_ns1_empty').'<br />';
elseif(isset($_POST['ns1']) && !preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z0-9]{2,30}$/', $_POST['ns1'])) $error .= $app->lng('error_ns1_regex').'<br />';
......@@ -238,6 +240,7 @@ if($_POST['create'] == 1) {
$tpl_content = $template_record['template'];
if($_POST['domain'] != '') $tpl_content = str_replace('{DOMAIN}', $_POST['domain'], $tpl_content);
if($_POST['ip'] != '') $tpl_content = str_replace('{IP}', $_POST['ip'], $tpl_content);
if($_POST['ipv6'] != '') $tpl_content = str_replace('{IPV6}',$_POST['ipv6'],$tpl_content);
if($_POST['ns1'] != '') $tpl_content = str_replace('{NS1}', $_POST['ns1'], $tpl_content);
if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content);
if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content);
......
......@@ -74,7 +74,7 @@ $form["tabs"]['template'] = array (
'formtype' => 'CHECKBOXARRAY',
'default' => '',
'separator' => ',',
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM (use TXT|{DOMAIN}.|{DKIM} in your Template)'),
'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)'),
'validators' => array ( 0 => array ('type' => 'CUSTOM',
'class' => 'validate_dkim',
'function' => 'check_template',
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Email';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'IP Address';
$wb['ipv6_txt'] = 'IPv6 Address';
$wb['error_origin_empty'] = 'Origin empty.';
$wb['error_ns_empty'] = 'NS empty.';
$wb['error_mbox_empty'] = 'Mbox empty.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum empty.';
$wb['error_ttl_empty'] = 'TTL empty.';
$wb['error_domain_empty'] = 'Domain empty';
$wb['error_ip_empty'] = 'IP empty.';
$wb['error_ipv6_empty'] = 'IPv6 empty.';
$wb['error_ns1_empty'] = 'NS1 empty.';
$wb['error_ns2_empty'] = 'NS2 empty.';
$wb['error_email_empty'] = 'EMail empty.';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Емайл';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'IP адрес';
$wb['ipv6_txt'] = 'IPv6 адрес';
$wb['error_origin_empty'] = 'Origin empty.';
$wb['error_ns_empty'] = 'NS empty.';
$wb['error_mbox_empty'] = 'Mbox empty.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum empty.';
$wb['error_ttl_empty'] = 'TTL empty.';
$wb['error_domain_empty'] = 'Domain empty';
$wb['error_ip_empty'] = 'IP empty.';
$wb['error_ipv6_empty'] = 'IPv6 empty.';
$wb['error_ns1_empty'] = 'NS1 empty.';
$wb['error_ns2_empty'] = 'NS2 empty.';
$wb['error_email_empty'] = 'Полето с имейла е празно';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Correio';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'Endereço IP';
$wb['ipv6_txt'] = 'Endereço IPv6';
$wb['error_origin_empty'] = 'Origem em branco.';
$wb['error_ns_empty'] = 'NS vazio.';
$wb['error_mbox_empty'] = 'Mbox vazia.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum vazio.';
$wb['error_ttl_empty'] = 'TTL vazio.';
$wb['error_domain_empty'] = 'Domínio vazio';
$wb['error_ip_empty'] = 'IP vazio.';
$wb['error_ipv6_empty'] = 'IPv6 vazio.';
$wb['error_ns1_empty'] = 'NS1 vazio.';
$wb['error_ns2_empty'] = 'NS2 vazio.';
$wb['error_email_empty'] = 'Correio vazio.';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'E-mail';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'IP adresa';
$wb['ipv6_txt'] = 'IPv6 adresa';
$wb['error_origin_empty'] = 'Zdroj je prázdný.';
$wb['error_ns_empty'] = 'NS je prázdný.';
$wb['error_mbox_empty'] = 'Mbox je prázdný.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum je prázdný.';
$wb['error_ttl_empty'] = 'TTL je prázdný.';
$wb['error_domain_empty'] = 'Doména je prázdná';
$wb['error_ip_empty'] = 'IP adresa je prázdná.';
$wb['error_ipv6_empty'] = 'IPv6 adresa je prázdná.';
$wb['error_ns1_empty'] = 'NS1 je prázdný.';
$wb['error_ns2_empty'] = 'NS2 je prázdný.';
$wb['error_email_empty'] = 'E-mail je prázdný.';
......
......@@ -13,6 +13,7 @@ $wb['dkim_txt'] = 'DKIM aktiviert';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'IP Adresse';
$wb['ipv6_txt'] = 'IPv6 Adresse';
$wb['error_origin_empty'] = 'Quelle ist leer.';
$wb['error_ns_empty'] = 'NS ist leer.';
$wb['error_mbox_empty'] = 'E-Mail Adresse ist leer.';
......@@ -23,6 +24,7 @@ $wb['error_minimum_empty'] = 'Minimum leer.';
$wb['error_ttl_empty'] = 'TTL ist leer.';
$wb['error_domain_empty'] = 'Domain ist leer';
$wb['error_ip_empty'] = 'IP Adresse ist leer.';
$wb['error_ipv6_empty'] = 'IPv6 Adresse ist leer.';
$wb['error_ns1_empty'] = 'NS1 ist leer.';
$wb['error_ns2_empty'] = 'NS2 ist leer.';
$wb['error_email_empty'] = 'E-Mail Adresse ist leer.';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Email';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'Διεύθυνση IP';
$wb['ipv6_txt'] = 'Διεύθυνση IPv6';
$wb['error_origin_empty'] = 'Δεν έχει οριστεί το Origin.';
$wb['error_ns_empty'] = 'Δεν έχει οριστεί ο NS.';
$wb['error_mbox_empty'] = 'Δεν έχει οριστεί το Mbox.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Δεν έχει οριστεί το Minimum.';
$wb['error_ttl_empty'] = 'Δεν έχει οριστεί το TTL.';
$wb['error_domain_empty'] = 'Δεν έχει οριστεί το Domain';
$wb['error_ip_empty'] = 'Δεν έχει οριστεί ή IP.';
$wb['error_ipv6_empty'] = 'Δεν έχει οριστεί ή IPv6.';
$wb['error_ns1_empty'] = 'Δεν έχει οριστεί ο NS1.';
$wb['error_ns2_empty'] = 'Δεν έχει οριστεί ο NS2.';
$wb['error_email_empty'] = 'Δεν έχει οριστεί το EMail.';
......
......@@ -13,6 +13,7 @@ $wb['dkim_txt'] = 'DKIM enabled';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'IP Address';
$wb['ipv6_txt'] = 'IPv6 Address';
$wb['error_origin_empty'] = 'Origin empty.';
$wb['error_ns_empty'] = 'NS empty.';
$wb['error_mbox_empty'] = 'Mbox empty.';
......@@ -23,6 +24,7 @@ $wb['error_minimum_empty'] = 'Minimum empty.';
$wb['error_ttl_empty'] = 'TTL empty.';
$wb['error_domain_empty'] = 'Domain empty';
$wb['error_ip_empty'] = 'IP empty.';
$wb['error_ipv6_empty'] = 'IPv6 empty.';
$wb['error_ns1_empty'] = 'NS1 empty.';
$wb['error_ns2_empty'] = 'NS2 empty.';
$wb['error_email_empty'] = 'Email empty.';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Correo';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'Dirección IP';
$wb['ipv6_txt'] = 'Dirección IPv6';
$wb['error_origin_empty'] = 'El campo Origen está vacío.';
$wb['error_ns_empty'] = 'El campo NS está vacío.';
$wb['error_mbox_empty'] = 'El campo Mbox está vacío.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'El campo Mínimo está vacío.';
$wb['error_ttl_empty'] = 'El campo TTL está vacío.';
$wb['error_domain_empty'] = 'El campo Dominio está vacío.';
$wb['error_ip_empty'] = 'El campo IP está vacío.';
$wb['error_ipv6_empty'] = 'El campo IPv6 está vacío.';
$wb['error_ns1_empty'] = 'El campo NS1 está vacío.';
$wb['error_ns2_empty'] = 'El campo NS2 está vacío.';
$wb['error_email_empty'] = 'El campo Correo electrónico está vacío.';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Vastuuhenkilön sähköpostiosoite';
$wb['ns1_txt'] = '1. nimipalvelin';
$wb['ns2_txt'] = '2. nimipalvelin';
$wb['ip_txt'] = 'IP-osoite';
$wb['ipv6_txt'] = 'IPv6-osoite';
$wb['error_origin_empty'] = 'Verkkotunnusta ei ole annettu.';
$wb['error_ns_empty'] = 'NS-kenttä tyhjä.';
$wb['error_mbox_empty'] = 'Mbox-kenttä tyhjä.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum-kenttä tyhjä.';
$wb['error_ttl_empty'] = 'TTL-kenttä tyhjä.';
$wb['error_domain_empty'] = 'Domain-kenttä tyhjä';
$wb['error_ip_empty'] = 'IP-kenttä tyhjä.';
$wb['error_ipv6_empty'] = 'IPv6-kenttä tyhjä.';
$wb['error_ns1_empty'] = 'NS1-kenttä tyhjä.';
$wb['error_ns2_empty'] = 'NS2-kenttä tyhjä.';
$wb['error_email_empty'] = 'EMail-kenttä tyhjä.';
......
......@@ -10,6 +10,7 @@ $wb['dkim_txt'] = 'DKIM activé';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'Adresse IP';
$wb['ipv6_txt'] = 'Adresse IPv6';
$wb['error_origin_empty'] = 'Origine vide.';
$wb['error_ns_empty'] = 'NS vide.';
$wb['error_mbox_empty'] = 'Mbox vide.';
......@@ -20,6 +21,7 @@ $wb['error_minimum_empty'] = 'Minimum vide.';
$wb['error_ttl_empty'] = 'TTL vide.';
$wb['error_domain_empty'] = 'Domaine vide';
$wb['error_ip_empty'] = 'IP vide.';
$wb['error_ipv6_empty'] = 'IPv6 vide.';
$wb['error_ns1_empty'] = 'NS1 vide.';
$wb['error_ns2_empty'] = 'NS2 vide.';
$wb['error_email_empty'] = 'Email vide.';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Email';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'IP adresa';
$wb['ipv6_txt'] = 'IPv6 adresa';
$wb['error_origin_empty'] = 'Prazno polje: Origin.';
$wb['error_ns_empty'] = 'Prazno polje: NS.';
$wb['error_mbox_empty'] = 'Prazno polje: Mbox.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Prazno polje: Minimum.';
$wb['error_ttl_empty'] = 'Prazno polje: TTL.';
$wb['error_domain_empty'] = 'Prazno polje: Domena.';
$wb['error_ip_empty'] = 'Prazno polje: IP adresa.';
$wb['error_ipv6_empty'] = 'Prazno polje: IPv6 adresa.';
$wb['error_ns1_empty'] = 'Prazno polje: NS1.';
$wb['error_ns2_empty'] = 'Prazno polje: NS1.';
$wb['error_email_empty'] = 'Prazno polje: Email.';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Email';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'IP Address';
$wb['ipv6_txt'] = 'IPv6 Address';
$wb['error_origin_empty'] = 'Origin empty.';
$wb['error_ns_empty'] = 'NS empty.';
$wb['error_mbox_empty'] = 'Mbox empty.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum empty.';
$wb['error_ttl_empty'] = 'TTL empty.';
$wb['error_domain_empty'] = 'Domain empty';
$wb['error_ip_empty'] = 'IP empty.';
$wb['error_ipv6_empty'] = 'IPv6 empty.';
$wb['error_ns1_empty'] = 'NS1 empty.';
$wb['error_ns2_empty'] = 'NS2 empty.';
$wb['error_email_empty'] = 'EMail empty.';
......
......@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Email';
$wb['ns1_txt'] = 'NS 1';
$wb['ns2_txt'] = 'NS 2';
$wb['ip_txt'] = 'Alamat IP';
$wb['ipv6_txt'] = 'Alamat IPv6';
$wb['error_origin_empty'] = 'Origin kosong.';
$wb['error_ns_empty'] = 'NS kosong.';
$wb['error_mbox_empty'] = 'Mbox kosong.';
......@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum kosong.';
$wb['error_ttl_empty'] = 'TTL kosong.';
$wb['error_domain_empty'] = 'Domain kosong';
$wb['error_ip_empty'] = 'IP kosong.';
$wb['error_ipv6_empty'] = 'IPv6 kosong.';
$wb['error_ns1_empty'] = 'NS1 kosong.';
$wb['error_ns2_empty'] = 'NS2 kosong.';
$wb['error_email_empty'] = 'EMail kosong.';
......