Hey Robert,

It worked. Thanks a lot for your guidance. The method I used is:

-----------------------
1. Created the below given policy groups:

* internal_domains [ with member: @example.com ]
* internal_ips [ with member: 10.0.0.0/8 ]

A snippet of mysql db:

================
mysql> select * from policy_groups;
+----+------------------+----------+---------+
| ID | Name             | Disabled | Comment |
+----+------------------+----------+---------+
|  2 | internal_domains |        0 |         |
|  3 | internal_ips     |        0 |         |
+----+------------------+----------+---------+
2 rows in set (0.00 sec)

mysql> select * from policy_group_members;
+----+---------------+--------------+----------+---------+
| ID | PolicyGroupID | Member       | Disabled | Comment |
+----+---------------+--------------+----------+---------+
|  2 |             2 | @example.com |        0 |         |
|  3 |             3 | 10.0.0.0/8   |        0 |         |
+----+---------------+--------------+----------+---------+
2 rows in set (0.00 sec)

mysql>
================

2. Created policy 'Outbound Policy' with member:

--------
- Source : !%internal_ips,!%internal_domains
- Destination: any
--------

A snippet of mysql db:

================
mysql> select * from policies;
+----+-------------------------+----------+-------------------------+----------+
| ID | Name                    | Priority | Description             |
Disabled |
+----+-------------------------+----------+-------------------------+----------+
|  1 | Default                 |        0 | Default System Policy
|        0 |
|  3 | Outbound Policy |       10 | Outbound Policy |        0 |
+----+-------------------------+----------+-------------------------+----------+
2 rows in set (0.00 sec)

mysql> select * from policy_members;
+----+----------+-----------------------------------+-------------+---------+----------+
| ID | PolicyID | Source                            | Destination | Comment
| Disabled |
+----+----------+-----------------------------------+-------------+---------+----------+
|  2 |        3 | !%internal_ips,!%internal_domains | any         |
|        0 |
+----+----------+-----------------------------------+-------------+---------+----------+
1 row in set (0.00 sec)

mysql>
================

3. Created Quota for satistfying the below given rules:

* Email per sender per hour = 100
* Email per domain per hour = 100

A snippet of mysql db:

================
mysql> select * from quotas;
+----+----------+-------------------------+--------------------+--------+---------+-----------------------------------------+-------------------------+----------+
| ID | PolicyID | Name                    | Track              | Period |
Verdict | Data                                    | Comment
| Disabled |
+----+----------+-------------------------+--------------------+--------+---------+-----------------------------------------+-------------------------+----------+
|  1 |        3 | Global limit per sender | Sender:user@domain |   3600 |
REJECT  | 550 5.4.5 Email Sending Quota Exceeded  | Global limit per sender
|        0 |
|  2 |        3 | Global limit per domain | Sender:@domain     |   3600 |
REJECT  | 550 5.4.5 Domain Sending Quota Exceeded | Global limit per domain
|        0 |
+----+----------+-------------------------+--------------------+--------+---------+-----------------------------------------+-------------------------+----------+
2 rows in set (0.00 sec)

mysql> select * from quotas_limits;
+----+----------+--------------+--------------+---------------------------------+----------+
| ID | QuotasID | Type         | CounterLimit |
Comment                         | Disabled |
+----+----------+--------------+--------------+---------------------------------+----------+
|  1 |        1 | MessageCount |          100 | Email limit per sender per
hour |        0 |
|  2 |        2 | MessageCount |          300 | Email limit per domain per
hour |        0 |
+----+----------+--------------+--------------+---------------------------------+----------+
2 rows in set (0.00 sec)

mysql>
================

And it is working.  But have some issues.

As I have already said postfix+policyd server is a relay server. Thus if a
sender sends a mail from a php script then by default the from address will
be user@hostname. In this case @hostname will be also considered as a
domain and will be tracked.  And if so only 300 mails per hostname will be
able to send. Is there any way to tackle this situation?

Also are the details in the policyd log gathered from postfix logs?

Thanks in advance.

Regards,
Soumi

On Tue, Aug 21, 2012 at 6:20 PM, soumya tr <[email protected]> wrote:

>
>
> On Tue, Aug 21, 2012 at 6:03 PM, Robert Anderson <[email protected]>wrote:
>
>> If I may ask, what was the problem with policies.pm?
>
>
> Infact I had made some changes to file policies.pm, reverted back all the
> changes and loaded the default policies.pm, after which policy tracking
> was working fine.
>
>
>> Take a look here: http://wiki.policyd.org/policies#specifications ; If
>> the source were any you could track by user@domain. To restrict the pool
>> of users you can negate certain groups as shown in the default policies.
>>
>>
> Okay. Will change the policies accordingly and check.
>
>
>>
>> ______________________________**_________________
>> Users mailing list
>> [email protected]
>> http://lists.policyd.org/**mailman/listinfo/users_lists.**policyd.org<http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org>
>>
>
>
>
> --
> Regards,
> Soumya
>
>


-- 
Regards,
Soumya
Linux Sytem Administrator
DirectI
<http://poornam.com>
"I like the dreams of the future better than the history of the past."
_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org

Reply via email to