Check the ML first guys. Attached, the patchset for known issues with 2.0.8.

2.0.9 should be released soon.

-N


> Weird... there is no PROTO_OK I see anywhere in the code.  We're running 
> 2.0.7.
> What's in your cluebringer.conf file?
>
> Jim Wright wrote:
>   
>> A few steps closer to having this running here, but finally after  
>> creating the databases, getting PHP working correctly with the webui,  
>> and getting Postfix set to use policyd 2.0.8, I end up with this in  
>> the log:
>>
>>
>> [2009/11/28-21:25:02 - 268] [CBPOLICYD] ERROR: Error running module  
>> request_process(): Undefined subroutine &cbp::protocols::PROTO_OK  
>> called at /usr/local/lib/policyd-2.0/cbp/protocols/Postfix.pm line 126.
>> Undefined subroutine &cbp::protocols::PROTO_OK called at /usr/local/ 
>> lib/policyd-2.0/cbp/protocols/Postfix.pm line 126.
>> [2009/11/28-21:25:04 - 267] [CBPOLICYD] ERROR: Error running module  
>> request_process(): Undefined subroutine &cbp::protocols::PROTO_OK  
>> called at /usr/local/lib/policyd-2.0/cbp/protocols/Postfix.pm line 126.
>> Undefined subroutine &cbp::protocols::PROTO_OK called at /usr/local/ 
>> lib/policyd-2.0/cbp/protocols/Postfix.pm line 126.
>>
>>
>> Google found some past discussions of a similar error with earlier  
>> builds from many months ago, but nothing recent, so (again) I'm  
>> stumped as to what the problem might be.
>>
>> I'm still running policyd 1.82, and have 2.0.8 set to run on another  
>> port (10032), and it is being called prior to the older policyd.  I  
>> only have Greylisting configured, and have it set to run in training  
>> mode so I can start building a database and see how things are looking.

Index: cbp/protocols.pm
===================================================================
--- cbp/protocols.pm	(revision 481)
+++ cbp/protocols.pm	(revision 482)
@@ -59,13 +59,14 @@
 	CBP_SKIP => 2,
 
 	PROTO_PASS => 1,
-	PROTO_REJECT => 2,
-	PROTO_DEFER => 3,
-	PROTO_HOLD => 4,
-	PROTO_REDIRECT => 5,
-	PROTO_DISCARD => 6,
-	PROTO_FILTER => 7,
-	PROTO_PREPEND => 8,
+	PROTO_OK => 2,
+	PROTO_REJECT => 3,
+	PROTO_DEFER => 4,
+	PROTO_HOLD => 5,
+	PROTO_REDIRECT => 6,
+	PROTO_DISCARD => 7,
+	PROTO_FILTER => 8,
+	PROTO_PREPEND => 9,
 	
 	# Errors
 	PROTO_ERROR => -1001,
Index: cbp/system.pm
===================================================================
--- cbp/system.pm	(revision 482)
+++ cbp/system.pm	(revision 483)
@@ -113,13 +113,32 @@
 sub parseCIDR
 {
 	my $cidr = shift;
-	
+
 	# Regex CIDR
-	if ($cidr =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\/(\d{1,2}))?$/) {
-		my $ip = $1;
-		my $mask = ( defined($2) && $2 >= 1 && $2 <= 32 ) ? $2 : 32;
+	if ($cidr =~ /^(\d{1,3})(?:\.(\d{1,3})(?:\.(\d{1,3})(?:\.(\d{1,3}))?)?)?(?:\/(\d{1,2}))?$/) {
+		# Strip any ip blocks and mask from string
+		my ($a,$b,$c,$d,$mask) = ($1,$2,$3,$4,$5);
 
+		# Set undefined ip blocks and mask if missing
+		if (!defined($b)) {
+			$b = 0;
+			$mask = 8 if !defined($mask);
+		}
+		if (!defined($c)) {
+			$c = 0;
+			$mask = 16 if !defined($mask);
+		}
+		if (!defined($d)) {
+			$d = 0;
+			$mask = 24 if !defined($mask);
+		}
 
+		# Default mask
+		$mask = ( defined($mask) && $mask >= 1 && $mask <= 32 ) ? $mask : 32;
+
+		# Build ip
+		my $ip = "$a.$b.$c.$d";
+
 		# Pull long for IP we going to test
 		my $ip_long = ip_to_long($ip);
 		# Convert mask to longs
Index: cbp/modules/Greylisting.pm
===================================================================
--- cbp/modules/Greylisting.pm	(revision 484)
+++ cbp/modules/Greylisting.pm	(revision 485)
@@ -209,17 +209,14 @@
 					return $server->protocol_response(PROTO_PASS);
 				}
 			} else {
-				$server->log(LOG_ERR,"[GREYLISTING] Failed to parse address '$address' is invalid.");
-				DBFreeRes($sth);
-				return $server->protocol_response(PROTO_DATA_ERROR);
+				$server->log(LOG_WARN,"[GREYLISTING] Skipping invalid address '$address'.");
 			}
 
 		} else {
-			$server->log(LOG_ERR,"[GREYLISTING] Whitelist entry '".$row->{'source'}."' is invalid.");
-			DBFreeRes($sth);
-			return $server->protocol_response(PROTO_DATA_ERROR);
+			$server->log(LOG_WARN,"[GREYLISTING] Skipping invalid whitelist entry '".$row->{'source'}."'.");
 		}
 	}
+	DBFreeRes($sth);
 
 
 	#

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users

Reply via email to