On 11/2/2012 6:45 AM, Prashanth P.Nair wrote:
> Hi Ralph
> 
> I was trying to build a custom script which has below main.cf
> <http://main.cf> entry
> 
> smtpd_recipient_restrictions = check_policy_service
> unix:private/policy,reject_unauth_destination
> 
> and
> 
> policy  unix  -       n       n       -       0       spawn
> user=nobody argv=/usr/libexec/postfix/perl.pl <http://perl.pl>
> 
> and script look like below.Am not sure how to get the input for my
> script ,i wrote something like this which is not working
> ----------------------
> #!/usr/bin/perl
> 
> $rcpt_threshold = 1;
> 
> lc $attr{"recipient_count"} ;


I'm sure you already looked at:
http://www.postfix.org/SMTPD_POLICY_README.html#protocol

you probably missed under "Notes" which says, in part:

"The "recipient_count" attribute (Postfix 2.3 and later) is non-zero
only in the "DATA" and "END-OF-MESSAGE" stages. It specifies the
number of recipients that Postfix accepted for the current message."


As for how to parse the input, there are numerous scripts to use for
examples under http://www.postfix.org/addon.html#policy

The postfwd policy server (the Swiss Army knife of policy servers)
should be able to check for some recipient count and return HOLD
with a simple config.

The "smtpd-policy-template skeleton policy server in Perl by Michael
Tokarev." is a bare-bones example you can modify as needed if you
want to write your own.


  -- Noel Jones

Reply via email to