private function scanAddress($address)
    {
        /*
         * today's timestamp used as report time (today 00:00) to prevent a lot of duplicates on the
         * same day. Using the same time will aggregate and deduplicate events into 1 per day.
         */


        if (!filter_var($address, FILTER_VALIDATE_IP) === false) {
            $addressReverse = implode('.', array_reverse(preg_split('/\./', $address)));

            foreach ($this->feeds as $feedName => $feedData) {
                $this->feedName = $feedName;

                if ($this->isKnownFeed() && $this->isEnabledFeed()) {
                    $lookup = $addressReverse . '.' . $feedData['zone'] . '.';

                    if ($result = gethostbyname($lookup)) {
                        if ($result != $lookup) {
                            // If config is empty, we fall back to this
                            $reason = 'SPAM Sending host';

                            // Set the config default reason if available
                            if (array_key_exists('default', $feedData['codes'])) {
                                $reason = $feedData['codes']['default'];
                            }

                            // Set the config specific reason if available
                            if (array_key_exists($result, $feedData['codes'])) {
                                $reason = $feedData['codes'][$result];
                            }

                            $incident = new Incident();
                            $incident->source      = $feedName;
                            $incident->source_id   = false;
                            $incident->ip          = $address;
                            $incident->domain      = false;
                            $incident->class       = $feedData['class'];
                            $incident->type        = $feedData['type'];

                            /*
                             * today's timestamp used as report time (today 00:00) to prevent a lot of duplicates on the
                             * same day. Using the same time will aggregate and deduplicate events into 1 per day.
                             */
                            $incident->timestamp   = Carbon::today()->timestamp;

                            $incident->information = json_encode(
                                array_merge(
                                    $feedData['information'],
                                    [
                                        'reason' => $reason
                                    ]
                                )
                            );

                            $this->incidents[] = $incident;
                        }
                    }
                }
            }
        } else {
            $this->warningCount++;
        }

        return true;
    }
private function scanAddress($address)
    {
        /*
         * today's timestamp used as report time (today 00:00) to prevent a lot of duplicates on the
         * same day. Using the same time will aggregate and deduplicate events into 1 per day.
         */


        if (!filter_var($address, FILTER_VALIDATE_IP) === false) {
            $addressReverse = implode('.', array_reverse(preg_split('/\./', $address)));

            foreach ($this->feeds as $feedName => $feedData) {
                $this->feedName = $feedName;

                if ($this->isKnownFeed() && $this->isEnabledFeed()) {
                    $lookup = $addressReverse . '.' . $feedData['zone'] . '.';

                    if ($result = gethostbyname($lookup)) {
                        if ($result != $lookup) {
                            // If config is empty, we fall back to this
                            $reason = 'SPAM Sending host';

                            // Set the config default reason if available
                            if (array_key_exists('default', $feedData['codes'])) {
                                $reason = $feedData['codes']['default'];
                            }

                            // Set the config specific reason if available
                            if (array_key_exists($result, $feedData['codes'])) {
                                $reason = $feedData['codes'][$result];
                            }

                            $incident = new Incident();
                            $incident->source      = $feedName;
                            $incident->source_id   = false;
                            $incident->ip          = $address;
                            $incident->domain      = false;
                            $incident->class       = $feedData['class'];
                            $incident->type        = $feedData['type'];

                            /*
                             * today's timestamp used as report time (today 00:00) to prevent a lot of duplicates on the
                             * same day. Using the same time will aggregate and deduplicate events into 1 per day.
                             */
                            $incident->timestamp   = Carbon::today()->timestamp;

                            $incident->information = json_encode(
                                array_merge(
                                    $feedData['information'],
                                    [
                                        'reason' => $reason
                                    ]
                                )
                            );

                            $this->incidents[] = $incident;
                        }
                    }
                }
            }
        } else {
            $this->warningCount++;
        }

        return true;
    }
private function scanAddress ( $ address ) { /*
         * today's timestamp used as report time (today 00:00) to prevent a lot of duplicates on the
         * same day. Using the same time will aggregate and deduplicate events into 1 per day.
         */ if ( ! filter_var ( $ address , FILTER_VALIDATE_IP ) === false ) { $ addressReverse = implode ( '.' , array_reverse ( preg_split ( '/\./' , $ address ) ) ) ; foreach ( $ this -> feeds as $ feedName => $ feedData ) { $ this -> feedName = $ feedName ; if ( $ this -> isKnownFeed ( ) && $ this -> isEnabledFeed ( ) ) { $ lookup = $ addressReverse . '.' . $ feedData [ 'zone' ] . '.' ; if ( $ result = gethostbyname ( $ lookup ) ) { if ( $ result != $ lookup ) { // If config is empty, we fall back to this $ reason = 'SPAM Sending host' ; // Set the config default reason if available if ( array_key_exists ( 'default' , $ feedData [ 'codes' ] ) ) { $ reason = $ feedData [ 'codes' ] [ 'default' ] ; } // Set the config specific reason if available if ( array_key_exists ( $ result , $ feedData [ 'codes' ] ) ) { $ reason = $ feedData [ 'codes' ] [ $ result ] ; } $ incident = new Incident ( ) ; $ incident -> source = $ feedName ; $ incident -> source_id = false ; $ incident -> ip = $ address ; $ incident -> domain = false ; $ incident -> class = $ feedData [ 'class' ] ; $ incident -> type = $ feedData [ 'type' ] ; /*
                             * today's timestamp used as report time (today 00:00) to prevent a lot of duplicates on the
                             * same day. Using the same time will aggregate and deduplicate events into 1 per day.
                             */ $ incident -> timestamp = Carbon :: today ( ) -> timestamp ; $ incident -> information = json_encode ( array_merge ( $ feedData [ 'information' ] , [ 'reason' => $ reason ] ) ) ; $ this -> incidents [ ] = $ incident ; } } } } } else { $ this -> warningCount ++ ; } return true ; }
Scan the address using a DNS request

@param string $address
@return boolean
Scan the address using a DNS request