Although I can track how many emails a user have sent by counting the Sender
field in the session_tracking table, it is not entirely correct because each
matching policy only records a row to the session_tracking table. Whereas an
email can send to multiple recipients. I want to add a Recipient field to
session_tracking table so that I can track every recipient or preferable a
comma split list of recipients.
I've tried to modify the code in /usr/lib/policyd-2.0/cbp/tracking.pm by
inserting a Recipient field with some success, but with my very limited Perl
skill, it only records one of many recipients. Thanks in advance.



below is sample of Debug log:
[2010/11/04-13:52:25 - 14643] [TRACKING] DEBUG: No session tracking data
exists for request: $VAR1 = {
          'ccert_fingerprint' => '',
          'sasl_method' => 'LOGIN',
          'sasl_sender' => '',
          'size' => '0',
          '_timestamp' => 1288903945,
          'helo_name' => 'kkkkk',
          'reverse_client_name' => 'sau.home.com',
          'queue_id' => '',
          'encryption_cipher' => '',
          'encryption_protocol' => '',
          'etrn_domain' => '',
          'ccert_subject' => '',
          'request' => 'smtpd_access_policy',
          'protocol_state' => 'RCPT',
          'recipient' => '[email protected]',
          'sasl_username' => '[email protected]',
          'instance' => '113e.4cd31d09.36418.0',
          'protocol_name' => 'ESMTP',
          'encryption_keysize' => '0',
          'recipient_count' => '0',
          'ccert_issuer' => '',
          'sender' => '[email protected]',
          'client_name' => 'sau.home.com',
          'client_address' => '192.168.10.11',
          '_protocol_transport' => 'Postfix'
        };

2010/11/04-13:52:26 - 2519] [TRACKING] DEBUG: Request translated into
session data: $VAR1 = {
          'Recipient' => '[email protected]',
          'SASLUsername' => '[email protected]',
          'QueueID' => '',
          'RecipientData' => '/<[email protected]>#55=7;',
          'EncryptionCipher' => '',
          'Instance' => '113e.4cd31d09.36418.0',
          'Size' => '0',
          'EncryptionKeySize' => '0',
          'ParsedClientAddress' => {
                                     'Broadcast_Long' => 3342654190,
                                     'Network' => '192.168.10.11',
                                     'IP_Long' => 3342654190,
                                     'Broadcast' => '192.168.10.11',
                                     'IP' => '192.168.10.11',
                                     'Mask_Long' => 4294967295,
                                     'Network_Long' => 3342654190
                                   },
          'ProtocolTransport' => 'Postfix',
          'EncryptionProtocol' => '',
          'Helo' => 'kkkkk',
          'ClientAddress' => '192.168.10.11',
          'ClientName' => 'sau.home.com',
          'Sender' => '[email protected]',
          'SASLSender' => '',
          'Timestamp' => 1288903946,
          'ProtocolState' => 'RCPT',
          'Policy' => {
                        '55' => [
                                  '7'
                                ]
                      },
          'Protocol' => 'ESMTP',
          'ClientReverseName' => 'sau.home.com',
          'SASLMethod' => 'LOGIN'
        };
_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users

Reply via email to