Maybe this filter is usable by others
http://www.multitel.com.uy/eroldan/code/butcher.py

Overview (from the notes inside script):

The Butcher -- Enforce usage policies to users and domains
This filter only works with SMTP authenticated users. I designeed it to
control the users of the ISP I work. All our users do authenticated
SMTP,
no relay is allowed without authentication. If you allow relaying
without
autentication this filter can't track user's usage and becomes futile
The filter can enforce:
For users:
      maxTransferSize         TransferSize = MessageSize *
RecipientCount
      maxTotalTransferSize    The max total sum of transfers size
permitted
                              Each transfer sum to this counter.
      maxTotalRcptCount       The max total sum of recipients permitted
                              Each transfer sum to this counter
      maxRcptCount            The max recipient count per invocation
      maxMessageSize          The max message size per invocation
      maxMessagesByInterval   The maximum number of messages permitted
                              to be injected for INTERVAL seconds
For domains:
      maxTotalTransferSize    TransferSize = MessageSize *
RecipientCount
      maxTotalRcptCount       The max total sum of recipients permitted

_HINTS_
- The 'policy' directory may contain .ini files with a [main] section
that
      defines attributes to enforce for each user or domain. Sizes in
      bytes.
- Each DATA command generates an invocation of the script, (right?)
- There are two variables that define default policy. The 0 value means
      unlimited. The variables are POLICY_DEF_USER and
POLICY_DEF_DOMAIN.
- If filter is restarted, history information is lost, affecting the
rate
      limit functionality.
- A database recyle must be done to zero the 'maxTotal*' counters. For
now,
      do a rm * where dbm files are located, then restart filter.
- You can rewrite 'Functions dependent of storage mechanism' to
integrate
      a sql database for example. See the code.
- The DEFAULT_ACTION list indicates what to do for messages out of
policy.
  The list can contain:
                 refuse     Refuse message
                 setblock   Refuse message and run setBlock function
                 log        Log message with logIncident function




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to