Skip to content

Commit

Permalink
CI Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bwalkerl committed Jan 30, 2024
1 parent 2191b0e commit 5ae14b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions classes/check/dnsnoreply.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public function get_result() : result {
} else if (str_contains($domain, '.' . $noreplydomain)) {
$status = result::OK;
$summary = "LMS is a subdomain of noreply domain";
} else if (str_contains($noreplydomain, '.' . $domain)) {
$status = result::OK;
$summary = "Noreply domain is a subdomain of LMS";
} else if (str_contains($noreplydomain, '.' . $primarydomain)) {
$summary = "LMS and noreply domain have a shared domain";
} else {
Expand Down
15 changes: 11 additions & 4 deletions classes/dns_util.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function get_subdomains($domain) {

/**
* Get spf txt record contents
* @param string $domain specify a different domain
* @return string txt record
*/
public function get_spf_record($domain = '') {
Expand Down Expand Up @@ -122,7 +123,7 @@ public function get_mxtoolbox_spf_url() {
* Returns the include if matched
*
* The include can have a wildcard and this will return the actual matched value.
* @param string include domain
* @param string $include include domain
* @return string matched include
*/
public function include_present(string $include) {
Expand Down Expand Up @@ -151,6 +152,8 @@ public function get_dkim_selector() {

/**
* Get DKIM txt record contents
* @param string $selector DKIM selector
* @param string $domain DKIM domain
* @return string txt record
*/
public function get_dkim_dns_domain($selector, $domain) {
Expand All @@ -159,6 +162,7 @@ public function get_dkim_dns_domain($selector, $domain) {

/**
* Get DKIM txt record contents
* @param string $selector DKIM selector
* @return string txt record
*/
public function get_dkim_record($selector) {
Expand All @@ -175,7 +179,7 @@ public function get_dkim_record($selector) {

/**
* Get DKIM txt record contents
* @return string txt record
* @return array txt record
*/
public function get_dmarc_dns_record() {
$domain = $this->get_noreply_domain();
Expand Down Expand Up @@ -203,13 +207,14 @@ public function get_dmarc_dns_record() {

/**
* Get MX record contents
* @return string txt record
* @param string $domain domain to check
* @return array txt record
*/
public function get_mx_record($domain) {

$records = @dns_get_record($domain, DNS_MX);
if (empty($records)) {
return;
return [];
}
usort($records, function($a, $b) {
if ($a['pri'] == $b['pri']) {
Expand All @@ -222,6 +227,8 @@ public function get_mx_record($domain) {

/**
* Get matching record contents
* @param string $domain domain to check
* @param string $match search for specific match
* @return string txt record
*/
public function get_matching_dns_record($domain, $match) {
Expand Down

0 comments on commit 5ae14b4

Please sign in to comment.