> 
<snip />
> > I've turned on all cluebringer debugging and this is what I see:
> > 
> > [2008/06/26-14:32:38 - 5761] [CORE] INFO: 2008/06/26-14:32:38 CONNECT 
> > TCP Peer: "127.0.0.1:47941" Local: "127.0.0.1:10031"
> > [2008/06/26-14:32:38 - 5761] [PROTOCOLS/Postfix] DEBUG: Possible 
> > Postfix protocol
> > [2008/06/26-14:32:38 - 5761] [PROTOCOLS/Postfix] INFO: Identified 
> > Postfix protocol
> > [2008/06/26-14:32:38 - 5633] [CORE] INFO: Starting "1" children
> > [2008/06/26-14:32:38 - 5761] [CORE] ERROR: ''
> > [2008/06/26-14:32:38 - 5761] [CBPOLICYD] ERROR: Protocol data 
> > validation error, required parameter 'recipient' was not found or 
> > invalid format
> > [2008/06/26-14:32:38 - 6018] [CORE] DEBUG: Child Preforked (6018)
> > [2008/06/26-14:32:38 - 6018] [CBPOLICYD] DEBUG: Starting up caching 
> > engine
> 
> Where are you doing your check_policy_service?
This is my config:
> 
> smtpd_recipient_restrictions=
>         reject_unauth_pipelining,
>         permit_mynetworks,
>         permit_sasl_authenticated,
>         reject_non_fqdn_recipient,
>         reject_unauth_destination,
>         check_policy_service inet:127.0.0.1:10031,
>         permit
> 
> smtpd_end_of_data_restrictions =
>        check_policy_service inet:127.0.0.1:10031
> 

Can you try the attached patch and let me know if it fixes your problem?

-N

Index: cbpolicyd
===================================================================
--- cbpolicyd	(revision 251)
+++ cbpolicyd	(working copy)
@@ -395,8 +395,7 @@
 
 	# Data mangling...
 	$request->{'sender'} = lc($request->{'sender'});
-	$request->{'recipient'} = lc($request->{'recipient'});
-	$request->{'recipient'} = lc($request->{'recipient'});
+	$request->{'recipient'} = lc($request->{'recipient'}) if (defined($request->{'recipient'}));
 	$request->{'sasl_username'} = lc($request->{'sasl_username'}) if (defined($request->{'sasl_username'}));
 
 	# Internal data
Index: cbp/protocols/Postfix.pm
===================================================================
--- cbp/protocols/Postfix.pm	(revision 251)
+++ cbp/protocols/Postfix.pm	(working copy)
@@ -212,27 +212,34 @@
 	
 
 	# Check params
+	if (!defined($request->{'protocol_state'})) {
+		$server->log(LOG_ERR,"[PROTOCOLS/Postfix] Error, parameter 'protocol_state' must be defined" if ($log);
+		return "required parameter 'protocol_state' was not found";
+	}
+
 	if (!defined($request->{'client_address'}) || !($request->{'client_address'} =~ /^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$/) ) {
 		$server->log(LOG_ERR,"[PROTOCOLS/Postfix] Error, parameter 'client_address' cannot be ".
-			defined($request->{'client_address'}) ? "'".$request->{'client_address'}."'" : "undef") if ($log);
+				defined($request->{'client_address'}) ? "'".$request->{'client_address'}."'" : "undef") if ($log);
 		return "required parameter 'client_address' was not found or invalid format";
 	}
 
 	if (!defined($request->{'sender'}) || !($request->{'sender'} =~ /^(?:[EMAIL PROTECTED]|)$/) ) {
 		$server->log(LOG_ERR,"[PROTOCOLS/Postfix] Error, parameter 'sender' cannot be ".
-			defined($request->{'sender'}) ? "'".$request->{'sender'}."'" : "undef") if ($log);
+				defined($request->{'sender'}) ? "'".$request->{'sender'}."'" : "undef") if ($log);
 		return "required parameter 'sender' was not found or invalid format";
 	}
 
-	if (!defined($request->{'recipient'}) || !($request->{'recipient'} =~ /[EMAIL PROTECTED]/) ) {
-		$server->log(LOG_ERR,"[PROTOCOLS/Postfix] Error, parameter 'recipient' cannot be ".
-			defined($request->{'recipient'}) ? "'".$request->{'recipient'}."'" : "undef") if ($log);
-		return "required parameter 'recipient' was not found or invalid format";
+	if ($request->{'protocol_state'} eq "RCPT") {
+		if (!defined($request->{'recipient'}) || !($request->{'recipient'} =~ /[EMAIL PROTECTED]/) ) {
+			$server->log(LOG_ERR,"[PROTOCOLS/Postfix] Error, parameter 'recipient' cannot be ".
+					defined($request->{'recipient'}) ? "'".$request->{'recipient'}."'" : "undef") if ($log);
+			return "required parameter 'recipient' was not found or invalid format";
+		}
 	}
 
 	if (!defined($request->{'instance'}) || $request->{'instance'} eq "") {
 		$server->log(LOG_ERR,"[PROTOCOLS/Postfix] Error, parameter 'instance' cannot be ".
-			defined($request->{'instance'}) ? "'".$request->{'instance'}."'" : "undef") if ($log);
+				defined($request->{'instance'}) ? "'".$request->{'instance'}."'" : "undef") if ($log);
 		return "required parameter 'instance' was not found or invalid format";
 	}
 }

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
policyd-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/policyd-users

Reply via email to