|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Simone Felici (s.felici
alpikom.it)
Date: Tue Jul 03 2007 - 09:00:14 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
mouss ha scritto:
> Simone Felici wrote:
>>
>> Hi again,
>>
>> I've write a script in perl that can query the backend and the output
>> of the script is the using quota.
>> Now, the 'virtual_mailbox_limit_maps' will point to a sql db where all
>> quota limits for all mailboxes are set. Then, with
>> smtpd_recipient_restrictions I'll use this option:
>> check_policy_service unix:private/mailquota. 'mailquota' will be set
>> up into a master.cf like this:
>>
>> mailquota unix - n n - - spawn
>> user=nobody argv=/usr/bin/perl /etc/postfix/mailquota.pl
>>
>> But how can I pass to /etc/postfix/mailquota.pl the recipient argument?
>> The syntax to obtain the usage quota is /etc/postfix/mailquota.pl
>> <recipient-email>.
>> The output is the used quota of the <recipient-email> in bytes.
>
>
> you need to read the POLICY README document. but you certainly should
> use the policy server example distributed with postfix source code
> instead of reinventing the wheel.
>
>
I've read about the policy and have understood how it works.
Have someone an example on how collect the attr values sent from postfix to the external program?
These:
Jul 3 15:56:08 mx3 postfix/smtpd[18048]: send attr request = smtpd_access_policy
Jul 3 15:56:08 mx3 postfix/smtpd[18048]: send attr protocol_state = RCPT
Jul 3 15:56:08 mx3 postfix/smtpd[18048]: send attr protocol_name = SMTP
Jul 3 15:56:08 mx3 postfix/smtpd[18048]: send attr client_address = 127.0.0.1
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr client_name = mx3
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr reverse_client_name = mx3
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr helo_name = me
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr sender = bar
example.com
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr recipient = bar
example.com
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr recipient_count = 0
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr queue_id =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr instance = 4680.468a5511.4d6bc.0
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr size = 0
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr etrn_domain =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr sasl_method =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr sasl_username =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr sasl_sender =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr ccert_subject =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr ccert_issuer =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr ccert_fingerprint =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr encryption_protocol =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr encryption_cipher =
Jul 3 15:56:09 mx3 postfix/smtpd[18048]: send attr encryption_keysize = 0
I've no idea how to grep these infos into variable to use them into the perl-script. The script works, 'cause if I set a static action="DUNNO",
"REJECT", "OK" or wathever, the answer is accepted from postfix and he accept or reject the mails. My last problem is to pass the "send attr recipient
= bar
example.com" to a variable.
A little help?
I'm really new with perl too, btw someting is working ;)
Thank's
Simon
--
Simone Felici E-Mail: s.felici
alpikom.it
Divisione Tecnica Tel: 0461 030 111
Alpikom S.p.A. Fax: 0461 030 112
v.Fersina, 23 - 38100 Trento URL: http://www.alpikom.it
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]