Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a new feed option ignore_codes #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions config/Rbl.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@
*/
'feeds' => [
'Spamhaus' => [
'zone' => 'zen.spamhaus.org',
'class' => 'RBL_LISTED',
'type' => 'ABUSE',
'enabled' => true,
'fields' => [
'zone' => 'zen.spamhaus.org',
'class' => 'RBL_LISTED',
'type' => 'ABUSE',
'enabled' => true,
'fields' => [
//
],
'filters' => [
'filters' => [
//
],
'information' => [
'information' => [
'delisting url' => 'https://www.spamhaus.org/lookup/',
],
'codes' => [
'codes' => [
'127.0.0.2' => 'SBL Listing - Contains: Direct UBE sources, spam operations & spam service',
'127.0.0.3' => 'CSS Listing - Contains: Direct snowshoe spam sources detected via automation',
'127.0.0.4' => 'XBL Listing - Contains: CBL (3rd party exploits such as proxies, trojans, etc.)',
Expand All @@ -77,29 +77,35 @@
'PBL Listing - Contains: End-user Non-MTA IP addresses set by ISP outbound mail policy',
'default' => 'SPAM Sending host'
],
'method' => 'dns',
'zonefile' => '',
'ignore_codes' => [
//
],
'method' => 'dns',
'zonefile' => '',
],
'Spamcop' => [
'zone' => 'bl.spamcop.net',
'class' => 'RBL_LISTED',
'type' => 'ABUSE',
'enabled' => true,
'fields' => [
'zone' => 'bl.spamcop.net',
'class' => 'RBL_LISTED',
'type' => 'ABUSE',
'enabled' => true,
'fields' => [
//
],
'filters' => [
'filters' => [
//
],
'information' => [
'information' => [
'delisting url' => 'https://www.spamcop.net/bl.shtml',
],
'codes' => [
'codes' => [
'127.0.0.2' => 'SCBL Listing - Contains: End-user reports, SPAM traps and other detection types',
'default' => 'SPAM Sending host'
],
'method' => 'dns',
'zonefile' => '',
'ignore_codes' => [
//
],
'method' => 'dns',
'zonefile' => '',
],
],
];
6 changes: 6 additions & 0 deletions src/Rbl.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Rbl extends Collector
'filters' => 'sometimes|array',
'information' => 'sometimes|array',
'codes' => 'required|array',
'ignore_codes' => 'sometimes|array',
'method' => 'required|string',
'zonefile' => 'sometimes|file',
];
Expand Down Expand Up @@ -298,6 +299,11 @@ private function scanAddress($address)

if ($result = gethostbyname($lookup)) {
if ($result != $lookup) {
// Stop processing if result on ignore_codes list
if (array_key_exists($result, $feedData['ignore_codes'])) {
continue;
}

// If config is empty, we fall back to this
$reason = 'SPAM Sending host';

Expand Down