From 9fa20e229c756dc4c4d7848660cebc00199ac4dd Mon Sep 17 00:00:00 2001 From: "andre.peters" Date: Mon, 15 Jan 2018 19:53:09 +0100 Subject: [PATCH 01/10] [Web] Allow sync interval from 1 to 3600 --- data/web/edit.php | 2 +- data/web/inc/functions.mailbox.inc.php | 4 ++-- data/web/modals/mailbox.php | 2 +- data/web/modals/user.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/web/edit.php b/data/web/edit.php index 11c924b5a..b53e17940 100644 --- a/data/web/edit.php +++ b/data/web/edit.php @@ -705,7 +705,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
- +
diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 56fe167c6..dac60364d 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -238,7 +238,7 @@ function mailbox($_action, $_type, $_data = null, $attr = null) { ); return false; } - if (!filter_var($mins_interval, FILTER_VALIDATE_INT, array('options' => array('min_range' => 10, 'max_range' => 3600)))) { + if (!filter_var($mins_interval, FILTER_VALIDATE_INT, array('options' => array('min_range' => 1, 'max_range' => 3600)))) { $_SESSION['return'] = array( 'type' => 'danger', 'msg' => sprintf($lang['danger']['access_denied']) @@ -1448,7 +1448,7 @@ function mailbox($_action, $_type, $_data = null, $attr = null) { ); return false; } - if (!filter_var($mins_interval, FILTER_VALIDATE_INT, array('options' => array('min_range' => 10, 'max_range' => 3600)))) { + if (!filter_var($mins_interval, FILTER_VALIDATE_INT, array('options' => array('min_range' => 1, 'max_range' => 3600)))) { $_SESSION['return'] = array( 'type' => 'danger', 'msg' => sprintf($lang['danger']['access_denied']) diff --git a/data/web/modals/mailbox.php b/data/web/modals/mailbox.php index b70cbe138..3f05f8f87 100644 --- a/data/web/modals/mailbox.php +++ b/data/web/modals/mailbox.php @@ -374,7 +374,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
- + 10-3600
diff --git a/data/web/modals/user.php b/data/web/modals/user.php index 50a6922c2..8c6072590 100644 --- a/data/web/modals/user.php +++ b/data/web/modals/user.php @@ -53,7 +53,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
- + 10-3600
From 9f258df883220d4d7c96802cae783db1da5197cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristia=CC=81n=20Feldsam?= Date: Tue, 16 Jan 2018 00:06:01 +0100 Subject: [PATCH 02/10] DNS Diagnostics - Allow for domain administrator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristián Feldsam --- data/web/inc/ajax/dns_diagnostics.php | 137 +++++++++++++------------- 1 file changed, 70 insertions(+), 67 deletions(-) diff --git a/data/web/inc/ajax/dns_diagnostics.php b/data/web/inc/ajax/dns_diagnostics.php index d6c989b3e..fa3354d50 100644 --- a/data/web/inc/ajax/dns_diagnostics.php +++ b/data/web/inc/ajax/dns_diagnostics.php @@ -7,7 +7,7 @@ define('state_missing', '2"); -if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "admin") { +if (isset($_SESSION['mailcow_cc_role']) && ($_SESSION['mailcow_cc_role'] == "admin"|| $_SESSION['mailcow_cc_role'] == "domainadmin")) { $domains = mailbox('get', 'domains'); foreach(mailbox('get', 'domains') as $dn) { @@ -77,73 +77,76 @@ $spf_link = ' $dmarc_link = 'DMARC Assistant'; $records = array(); -$records[] = array( - $mailcow_hostname, - 'A', - $ip -); -$records[] = array( - $ptr, - 'PTR', - $mailcow_hostname -); -if (!empty($ip6)) { - $records[] = array( - $mailcow_hostname, - 'AAAA', - $ip6 - ); - $records[] = array( - $ptr6, - 'PTR', - $mailcow_hostname - ); +if($_SESSION['mailcow_cc_role'] == "admin") +{ + $records[] = array( + $mailcow_hostname, + 'A', + $ip + ); + $records[] = array( + $ptr, + 'PTR', + $mailcow_hostname + ); + if (!empty($ip6)) { + $records[] = array( + $mailcow_hostname, + 'AAAA', + $ip6 + ); + $records[] = array( + $ptr6, + 'PTR', + $mailcow_hostname + ); + } + $records[] = array( + '_25._tcp.' . $autodiscover_config['smtp']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['smtp']['server'], 25, 1) + ); + $records[] = array( + '_' . $https_port . '._tcp.' . $mailcow_hostname, + 'TLSA', + generate_tlsa_digest($mailcow_hostname, $https_port) + ); + $records[] = array( + '_' . $autodiscover_config['pop3']['tlsport'] . '._tcp.' . $autodiscover_config['pop3']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['tlsport'], 1) + ); + $records[] = array( + '_' . $autodiscover_config['imap']['tlsport'] . '._tcp.' . $autodiscover_config['imap']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['tlsport'], 1) + ); + $records[] = array( + '_' . $autodiscover_config['smtp']['port'] . '._tcp.' . $autodiscover_config['smtp']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['port']) + ); + $records[] = array( + '_' . $autodiscover_config['smtp']['tlsport'] . '._tcp.' . $autodiscover_config['smtp']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['tlsport'], 1) + ); + $records[] = array( + '_' . $autodiscover_config['imap']['port'] . '._tcp.' . $autodiscover_config['imap']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['port']) + ); + $records[] = array( + '_' . $autodiscover_config['pop3']['port'] . '._tcp.' . $autodiscover_config['pop3']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['port']) + ); + $records[] = array( + '_' . $autodiscover_config['sieve']['port'] . '._tcp.' . $autodiscover_config['sieve']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['sieve']['server'], $autodiscover_config['sieve']['port'], 1) + ); } -$records[] = array( - '_25._tcp.' . $autodiscover_config['smtp']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['smtp']['server'], 25, 1) -); -$records[] = array( - '_' . $https_port . '._tcp.' . $mailcow_hostname, - 'TLSA', - generate_tlsa_digest($mailcow_hostname, $https_port) -); -$records[] = array( - '_' . $autodiscover_config['pop3']['tlsport'] . '._tcp.' . $autodiscover_config['pop3']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['tlsport'], 1) -); -$records[] = array( - '_' . $autodiscover_config['imap']['tlsport'] . '._tcp.' . $autodiscover_config['imap']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['tlsport'], 1) -); -$records[] = array( - '_' . $autodiscover_config['smtp']['port'] . '._tcp.' . $autodiscover_config['smtp']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['port']) -); -$records[] = array( - '_' . $autodiscover_config['smtp']['tlsport'] . '._tcp.' . $autodiscover_config['smtp']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['tlsport'], 1) -); -$records[] = array( - '_' . $autodiscover_config['imap']['port'] . '._tcp.' . $autodiscover_config['imap']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['port']) -); -$records[] = array( - '_' . $autodiscover_config['pop3']['port'] . '._tcp.' . $autodiscover_config['pop3']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['port']) -); -$records[] = array( - '_' . $autodiscover_config['sieve']['port'] . '._tcp.' . $autodiscover_config['sieve']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['sieve']['server'], $autodiscover_config['sieve']['port'], 1) -); $records[] = array( $domain, 'MX', From 2a8bdc8deab60db693fe36aa217dbdc88887e332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristia=CC=81n=20Feldsam?= Date: Tue, 16 Jan 2018 00:06:21 +0100 Subject: [PATCH 03/10] DNS Diagnostics - Ehnaced SPF record check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristián Feldsam --- data/web/inc/ajax/dns_diagnostics.php | 13 +++++++++---- data/web/lang/lang.en.php | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/data/web/inc/ajax/dns_diagnostics.php b/data/web/inc/ajax/dns_diagnostics.php index fa3354d50..3735b17ca 100644 --- a/data/web/inc/ajax/dns_diagnostics.php +++ b/data/web/inc/ajax/dns_diagnostics.php @@ -73,7 +73,7 @@ if (!isset($autodiscover_config['sieve'])) { } // Init records array -$spf_link = 'SPF Record Syntax'; +$spf_link = 'SPF Record Syntax
'.$lang['diagnostics']['allow'].' '.$ip.'
'.$lang['diagnostics']['allow'].' '.$ip6.'
'; $dmarc_link = 'DMARC Assistant'; $records = array(); @@ -348,9 +348,14 @@ foreach ($records as $record) { $state = $current[$data_field[$current['type']]] . state_optional; } elseif ($current['type'] == 'TXT' && - stripos($current['txt'], 'v=spf' && - $record[2] == $spf_link) === 0) { - $state = $current[$data_field[$current['type']]] . state_optional; + stripos($current['txt'], 'v=spf') === 0 && + $record[2] == $spf_link) { + $state = state_nomatch; + $rslt = get_spf_allowed_hosts($record[0]); + if(in_array($ip, $rslt) && in_array($ip6, $rslt)){ + $state = state_good; + } + $state .= '
' . $current[$data_field[$current['type']]].state_optional; } elseif ($current['type'] == 'TXT' && stripos($current['txt'], 'v=dkim') === 0 && diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php index 7fce2a3b1..b23ec4d61 100644 --- a/data/web/lang/lang.en.php +++ b/data/web/lang/lang.en.php @@ -556,6 +556,7 @@ $lang['diagnostics']['dns_records_data'] = 'Correct Data'; $lang['diagnostics']['dns_records_status'] = 'Current State'; $lang['diagnostics']['optional'] = 'This record is optional.'; $lang['diagnostics']['cname_from_a'] = 'Value derived from A/AAAA record. This is supported as long as the record points to the correct resource.'; +$lang['diagnostics']['allow'] = 'Allow'; $lang['admin']['relay_from'] = '"From:" address'; $lang['admin']['api_allow_from'] = "Allow API access from these IPs"; From 9aeaab23ab1e0b742f7ecfb98c23d684e66dc5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Peters?= Date: Tue, 16 Jan 2018 09:26:48 +0100 Subject: [PATCH 04/10] Update lang.en.php --- data/web/lang/lang.en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php index b23ec4d61..178c722a4 100644 --- a/data/web/lang/lang.en.php +++ b/data/web/lang/lang.en.php @@ -556,7 +556,7 @@ $lang['diagnostics']['dns_records_data'] = 'Correct Data'; $lang['diagnostics']['dns_records_status'] = 'Current State'; $lang['diagnostics']['optional'] = 'This record is optional.'; $lang['diagnostics']['cname_from_a'] = 'Value derived from A/AAAA record. This is supported as long as the record points to the correct resource.'; -$lang['diagnostics']['allow'] = 'Allow'; +$lang['diagnostics']['allow'] = 'Allow %s'; $lang['admin']['relay_from'] = '"From:" address'; $lang['admin']['api_allow_from'] = "Allow API access from these IPs"; From f1f7749b852b5bd2e69bae5e8f0aeadd0eb8b493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Peters?= Date: Tue, 16 Jan 2018 09:33:39 +0100 Subject: [PATCH 05/10] Update dns_diagnostics.php Sprintf makes multi-lang easier. Fix indents --- data/web/inc/ajax/dns_diagnostics.php | 175 ++++++++++++++------------ 1 file changed, 92 insertions(+), 83 deletions(-) diff --git a/data/web/inc/ajax/dns_diagnostics.php b/data/web/inc/ajax/dns_diagnostics.php index 3735b17ca..f15f8eb49 100644 --- a/data/web/inc/ajax/dns_diagnostics.php +++ b/data/web/inc/ajax/dns_diagnostics.php @@ -73,111 +73,120 @@ if (!isset($autodiscover_config['sieve'])) { } // Init records array -$spf_link = 'SPF Record Syntax
'.$lang['diagnostics']['allow'].' '.$ip.'
'.$lang['diagnostics']['allow'].' '.$ip6.'
'; +$spf_link = 'SPF Record Syntax
+ ' . sprintf($lang['diagnostics']['allow'], $ip) . '
' . sprintf($lang['diagnostics']['allow'], $ip6) . '
'; $dmarc_link = 'DMARC Assistant'; $records = array(); -if($_SESSION['mailcow_cc_role'] == "admin") -{ +if ($_SESSION['mailcow_cc_role'] == "admin") { + $records[] = array( + $mailcow_hostname, + 'A', + $ip + ); + $records[] = array( + $ptr, + 'PTR', + $mailcow_hostname + ); + if (!empty($ip6)) { $records[] = array( $mailcow_hostname, - 'A', - $ip + 'AAAA', + $ip6 ); $records[] = array( - $ptr, + $ptr6, 'PTR', $mailcow_hostname ); - if (!empty($ip6)) { - $records[] = array( - $mailcow_hostname, - 'AAAA', - $ip6 - ); - $records[] = array( - $ptr6, - 'PTR', - $mailcow_hostname - ); - } - $records[] = array( - '_25._tcp.' . $autodiscover_config['smtp']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['smtp']['server'], 25, 1) - ); - $records[] = array( - '_' . $https_port . '._tcp.' . $mailcow_hostname, - 'TLSA', - generate_tlsa_digest($mailcow_hostname, $https_port) - ); - $records[] = array( - '_' . $autodiscover_config['pop3']['tlsport'] . '._tcp.' . $autodiscover_config['pop3']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['tlsport'], 1) - ); - $records[] = array( - '_' . $autodiscover_config['imap']['tlsport'] . '._tcp.' . $autodiscover_config['imap']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['tlsport'], 1) - ); - $records[] = array( - '_' . $autodiscover_config['smtp']['port'] . '._tcp.' . $autodiscover_config['smtp']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['port']) - ); - $records[] = array( - '_' . $autodiscover_config['smtp']['tlsport'] . '._tcp.' . $autodiscover_config['smtp']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['tlsport'], 1) - ); - $records[] = array( - '_' . $autodiscover_config['imap']['port'] . '._tcp.' . $autodiscover_config['imap']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['port']) - ); - $records[] = array( - '_' . $autodiscover_config['pop3']['port'] . '._tcp.' . $autodiscover_config['pop3']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['port']) - ); - $records[] = array( - '_' . $autodiscover_config['sieve']['port'] . '._tcp.' . $autodiscover_config['sieve']['server'], - 'TLSA', - generate_tlsa_digest($autodiscover_config['sieve']['server'], $autodiscover_config['sieve']['port'], 1) - ); + } + $records[] = array( + '_25._tcp.'.$autodiscover_config['smtp']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['smtp']['server'], 25, 1) + ); + $records[] = array( + '_'.$https_port. + '._tcp.'.$mailcow_hostname, + 'TLSA', + generate_tlsa_digest($mailcow_hostname, $https_port) + ); + $records[] = array( + '_'.$autodiscover_config['pop3']['tlsport']. + '._tcp.'.$autodiscover_config['pop3']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['tlsport'], 1) + ); + $records[] = array( + '_'.$autodiscover_config['imap']['tlsport']. + '._tcp.'.$autodiscover_config['imap']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['tlsport'], 1) + ); + $records[] = array( + '_'.$autodiscover_config['smtp']['port']. + '._tcp.'.$autodiscover_config['smtp']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['port']) + ); + $records[] = array( + '_'.$autodiscover_config['smtp']['tlsport']. + '._tcp.'.$autodiscover_config['smtp']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['tlsport'], 1) + ); + $records[] = array( + '_'.$autodiscover_config['imap']['port']. + '._tcp.'.$autodiscover_config['imap']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['port']) + ); + $records[] = array( + '_'.$autodiscover_config['pop3']['port']. + '._tcp.'.$autodiscover_config['pop3']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['port']) + ); + $records[] = array( + '_'.$autodiscover_config['sieve']['port']. + '._tcp.'.$autodiscover_config['sieve']['server'], + 'TLSA', + generate_tlsa_digest($autodiscover_config['sieve']['server'], $autodiscover_config['sieve']['port'], 1) + ); } $records[] = array( - $domain, - 'MX', - $mailcow_hostname + $domain, + 'MX', + $mailcow_hostname ); $records[] = array( - 'autodiscover.' . $domain, - 'CNAME', - $mailcow_hostname + 'autodiscover.'.$domain, + 'CNAME', + $mailcow_hostname ); $records[] = array( - '_autodiscover._tcp.' . $domain, - 'SRV', - $mailcow_hostname . ' ' . $https_port + '_autodiscover._tcp.'.$domain, + 'SRV', + $mailcow_hostname. + ' '.$https_port ); $records[] = array( - 'autoconfig.' . $domain, - 'CNAME', - $mailcow_hostname + 'autoconfig.'.$domain, + 'CNAME', + $mailcow_hostname ); $records[] = array( - $domain, - 'TXT', - $spf_link, - state_optional + $domain, + 'TXT', + $spf_link, + state_optional ); $records[] = array( - '_dmarc.' . $domain, - 'TXT', - $dmarc_link, - state_optional + '_dmarc.'.$domain, + 'TXT', + $dmarc_link, + state_optional ); if (!empty($dkim = dkim('details', $domain))) { From d2aa57d01f289b170948a286de034448af9aa999 Mon Sep 17 00:00:00 2001 From: "andre.peters" Date: Tue, 16 Jan 2018 12:37:45 +0100 Subject: [PATCH 06/10] [Web] Remove 10M limit from quarantaine info text --- data/web/lang/lang.de.php | 3 +-- data/web/lang/lang.en.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/data/web/lang/lang.de.php b/data/web/lang/lang.de.php index 2eaf350c5..9620ca046 100644 --- a/data/web/lang/lang.de.php +++ b/data/web/lang/lang.de.php @@ -607,8 +607,7 @@ $lang['success']['items_released'] = "Ausgewählte Objekte wurden an Mailbox ver $lang['danger']['imagick_exception'] = "Fataler Bildverarbeitungsfehler"; $lang['quarantaine']['quarantaine'] = "Quarantäne"; -$lang['quarantaine']['qinfo'] = "Das Quarantänesystem speichert abgelehnte Nachrichten in der Datenbank. Dem Sender wird nicht signalisiert, dass seine E-Mail zugestellt wurde.
- E-Mails mit einer maximalen Größe von 10 MiB werden gespeichert."; +$lang['quarantaine']['qinfo'] = "Das Quarantänesystem speichert abgelehnte Nachrichten in der Datenbank. Dem Sender wird nicht signalisiert, dass seine E-Mail zugestellt wurde."; $lang['quarantaine']['release'] = "Freigeben"; $lang['quarantaine']['empty'] = 'Keine Einträge'; $lang['quarantaine']['toggle_all'] = 'Alle auswählen'; diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php index 7fce2a3b1..93f73e607 100644 --- a/data/web/lang/lang.en.php +++ b/data/web/lang/lang.en.php @@ -602,8 +602,7 @@ $lang['success']['items_released'] = "Selected items were released"; $lang['danger']['imagick_exception'] = "Error: Imagick exception while reading image"; $lang['quarantaine']['quarantaine'] = "Quarantaine"; -$lang['quarantaine']['qinfo'] = "The quarantaine system will save rejected mail to the database, while the sender will not be given the impression of a delivered mail.
- Only mails up to 10 MiB will be saved in the quarantaine."; +$lang['quarantaine']['qinfo'] = "The quarantaine system will save rejected mail to the database, while the sender will not be given the impression of a delivered mail."; $lang['quarantaine']['release'] = "Release"; $lang['quarantaine']['empty'] = 'No results'; $lang['quarantaine']['toggle_all'] = 'Toggle all'; From c227675262be6acbca660598d5ba3113639af8d3 Mon Sep 17 00:00:00 2001 From: "andre.peters" Date: Tue, 16 Jan 2018 12:41:30 +0100 Subject: [PATCH 07/10] [Web] Remove 'allow ip' --- data/web/inc/ajax/dns_diagnostics.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/web/inc/ajax/dns_diagnostics.php b/data/web/inc/ajax/dns_diagnostics.php index f15f8eb49..479bdf9dd 100644 --- a/data/web/inc/ajax/dns_diagnostics.php +++ b/data/web/inc/ajax/dns_diagnostics.php @@ -73,8 +73,7 @@ if (!isset($autodiscover_config['sieve'])) { } // Init records array -$spf_link = 'SPF Record Syntax
- ' . sprintf($lang['diagnostics']['allow'], $ip) . '
' . sprintf($lang['diagnostics']['allow'], $ip6) . '
'; +$spf_link = 'SPF Record Syntax
; $dmarc_link = 'DMARC Assistant'; $records = array(); From 5fd3d986c7a2d9d14ee167f5c414ee44726ea5a7 Mon Sep 17 00:00:00 2001 From: "andre.peters" Date: Tue, 16 Jan 2018 12:42:09 +0100 Subject: [PATCH 08/10] [Rspamd] Fix settings map regex --- data/conf/rspamd/dynmaps/settings.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/conf/rspamd/dynmaps/settings.php b/data/conf/rspamd/dynmaps/settings.php index fcc656a89..bcb822640 100644 --- a/data/conf/rspamd/dynmaps/settings.php +++ b/data/conf/rspamd/dynmaps/settings.php @@ -157,7 +157,7 @@ while ($row = array_shift($rows)) { ?> whitelist_ { prepare("SELECT GROUP_CONCAT(REPLACE(`value`, '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` + $stmt = $pdo->prepare("SELECT GROUP_CONCAT(REPLACE(CONCAT('^', `value`, '$'), '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` WHERE `object`= :object AND `option` = 'whitelist_from'"); $stmt->execute(array(':object' => $row['object'])); @@ -196,7 +196,7 @@ while ($row = array_shift($rows)) { } whitelist_header_ { prepare("SELECT GROUP_CONCAT(REPLACE(`value`, '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` + $stmt = $pdo->prepare("SELECT GROUP_CONCAT(REPLACE(CONCAT('^', `value`, '$'), '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` WHERE `object`= :object AND `option` = 'whitelist_from'"); $stmt->execute(array(':object' => $row['object'])); @@ -249,7 +249,7 @@ while ($row = array_shift($rows)) { ?> blacklist_ { prepare("SELECT GROUP_CONCAT(REPLACE(`value`, '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` + $stmt = $pdo->prepare("SELECT GROUP_CONCAT(REPLACE(CONCAT('^', `value`, '$'), '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` WHERE `object`= :object AND `option` = 'blacklist_from'"); $stmt->execute(array(':object' => $row['object'])); @@ -288,7 +288,7 @@ while ($row = array_shift($rows)) { } blacklist_header_ { prepare("SELECT GROUP_CONCAT(REPLACE(`value`, '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` + $stmt = $pdo->prepare("SELECT GROUP_CONCAT(REPLACE(CONCAT('^', `value`, '$'), '*', '.*') SEPARATOR '|') AS `value` FROM `filterconf` WHERE `object`= :object AND `option` = 'blacklist_from'"); $stmt->execute(array(':object' => $row['object'])); From dca9ae4a34462e58226d72d55130bd82f8942f18 Mon Sep 17 00:00:00 2001 From: "andre.peters" Date: Tue, 16 Jan 2018 12:42:46 +0100 Subject: [PATCH 09/10] [Web] Remove 'allow ip' --- data/web/inc/ajax/dns_diagnostics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/inc/ajax/dns_diagnostics.php b/data/web/inc/ajax/dns_diagnostics.php index 479bdf9dd..f5f43fe8c 100644 --- a/data/web/inc/ajax/dns_diagnostics.php +++ b/data/web/inc/ajax/dns_diagnostics.php @@ -73,7 +73,7 @@ if (!isset($autodiscover_config['sieve'])) { } // Init records array -$spf_link = 'SPF Record Syntax
; +$spf_link = 'SPF Record Syntax
;' $dmarc_link = 'DMARC Assistant'; $records = array(); From 7fd6a1260cda8086fab5f37720f782d176114020 Mon Sep 17 00:00:00 2001 From: "andre.peters" Date: Tue, 16 Jan 2018 12:43:09 +0100 Subject: [PATCH 10/10] [Web] Remove 'allow ip' --- data/web/inc/ajax/dns_diagnostics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/inc/ajax/dns_diagnostics.php b/data/web/inc/ajax/dns_diagnostics.php index f5f43fe8c..23d990418 100644 --- a/data/web/inc/ajax/dns_diagnostics.php +++ b/data/web/inc/ajax/dns_diagnostics.php @@ -73,7 +73,7 @@ if (!isset($autodiscover_config['sieve'])) { } // Init records array -$spf_link = 'SPF Record Syntax
;' +$spf_link = 'SPF Record Syntax
'; $dmarc_link = 'DMARC Assistant'; $records = array();