limit the mail the account can send
Results 1 to 6 of 6

Thread: limit the mail the account can send

  1. #1
    Active Member
    Join Date
    Dec 2012
    Posts
    4

    Angry limit the mail the account can send

    Hi,

    I wonder if i can limit per month the number of email a user can send, lets say in the account ifo@dte.gr to limit 50000 emails per month.
    is there a way to do that?
    I am using 8.0.1_GA_FOSS

    Thank you

  2. #2
    ZeXtras Community Manager ZeXtras Employee Cine's Avatar
    Join Date
    Apr 2011
    Posts
    2,342
    Hello ncostis!

    As far as I know there is no such feature in Zimbra itself, but you could easily achieve something similar to that using the Quotas module of CBPolicyD (included in Zimbra since version 7.1.x)...

    DISCLAIMER:
    CBPolicyD is a very powerful piece of software, and a misconfiguration might lead to legitimate emails to be dropped or rejected. As usual, be very careful when editing configuration settings that affect your MTA and only apply this configuration if you are familiar with CBPolicyD.
    This is not official ZeXtras documentation, but a contribution of mine as a Zimbra system administrator.

    - Create a new Group - we'll call it "Limited_Users" - and add all email addresses you want to limit to it. Once you're done, enable this group.
    - Create a new Policy -we'll call it "Limit_Policy" with a lower priority than your current "Default Outbound" so that it gets evaluated BEFORE it
    - Configure "Limit_Policy" so that source and destination are respectively "%Limited_Users" and "any"
    - Create a new "Quotas" rule - we'll call it "Limit_Quota" - and configure it so that it's applied to "Limit_Policy" and that "Sender:user@domain" is tracked for a period of "2592000" (which is 30 days in seconds). You can choose to either DISCARD or REJECT emails over the limit you set. Once you're done, enable this rule.
    - Create a new Limit for the "Limit_Quota" policy, setting the type to "MessageCount" and the Counter Limit to "50000". Once you're done, enable this limit.
    - Doublecheck all your settings and finally enable the "Limit_Policy".

    Check the /opt/zimbra/log/cbpolicyd.log file to make sure that everything is ok.
    As usual, run some tests before applying this change on a production server!

    Have a nice day,
    Cine
    IT Support Team Contact Form
    Sales Team Contact Form

    ZeXtras Website
    # ZeXtras Wiki # ZeXtras Store

    Have ZeXtras Suite or ZeXtras Migration Tool been helpful to you?
    Share your experience in the Zimbra Gallery!

    ZeXtras Suite on the Zimbra Gallery
    ZeXtras Migration Tool on the Zimbra Gallery

  3. #3
    Active Member
    Join Date
    Dec 2012
    Posts
    4
    Quote Originally Posted by Cine View Post
    Hello ncostis!
    ...
    - Create a new Group - we'll call it "Limited_Users" - and add all email addresses you want to limit to it. Once you're done, enable this group.
    - Create a new Policy -we'll call it "Limit_Policy" with a lower priority than your current "Default Outbound" so that it gets evaluated BEFORE it
    - Configure "Limit_Policy" so that source and destination are respectively "%Limited_Users" and "any"
    - Create a new "Quotas" rule - we'll call it "Limit_Quota" - and configure it so that it's applied to "Limit_Policy" and that "Sender:user@domain" is tracked for a period of "2592000" (which is 30 days in seconds). You can choose to either DISCARD or REJECT emails over the limit you set. Once you're done, enable this rule.
    - Create a new Limit for the "Limit_Quota" policy, setting the type to "MessageCount" and the Counter Limit to "50000". Once you're done, enable this limit.
    - Doublecheck all your settings and finally enable the "Limit_Policy".
    ...
    Thank you Cine.
    I have managed to install cbpolicyd through " zmprov ms <mta server> +zimbraServiceEnabled cbpolicyd "
    I restarted zimbra alnd in the ststus it show that cbpolicyd was enabled.
    All ok , but from where and how do i create groups, policies etc?

    Thank you once more.

  4. #4
    ZeXtras Community Manager ZeXtras Employee Cine's Avatar
    Join Date
    Apr 2011
    Posts
    2,342
    Hello ncostis!

    Official Zimbra documentation about cbpolicyd can be found at Postfix Policyd - Zimbra :: Wiki

    You can also check out my cbpolicyd guides on this very forums HERE (Zimbra 7.x) and HERE (Zimbra 8.x). This guide also contains instructions on how to download and enable the CBPolicyD web interface (which albeit being a non-official procedure I find very handy)...

    Have a nice day,
    Cine
    Last edited by Cine; 05-21-2013 at 02:51 PM.
    IT Support Team Contact Form
    Sales Team Contact Form

    ZeXtras Website
    # ZeXtras Wiki # ZeXtras Store

    Have ZeXtras Suite or ZeXtras Migration Tool been helpful to you?
    Share your experience in the Zimbra Gallery!

    ZeXtras Suite on the Zimbra Gallery
    ZeXtras Migration Tool on the Zimbra Gallery

  5. #5
    Junior Member
    Join Date
    Jun 2011
    Posts
    2
    Official Zimbra documentation just tell you how to enable policyd, but where is webgui to control/add quota limits?

    zmprov ms <mta server> +zimbraServiceEnabled cbpolicyd

    wget -c http://devlabs.linuxassist.net/attac...1111115.tar.gz

    tar -zxvf cluebringer-v2.1.x-201211111115.tar.gz

    cd cluebringer-v2.1.x-201211111115/webui/

    cp *.php *.css /opt/zimbra/cbpolicyd/share/webui/

    cd /opt/zimbra/httpd/htdocs/ && ln -s /opt/zimbra/cbpolicyd/share/webui/

    nano /opt/zimbra/cbpolicyd-2.1.0-beta/share/webui/includes/config.php

    change: $DB_DSN="mysql:host=localhost;dbname=cluebringer";

    to: $DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb";

    su – zimbra -c “zmapachectl restart”

    http://IpServerZimbra:7780/webui/index.php


    is this ok?!
    Last edited by yvespires; 06-03-2013 at 09:54 PM.

  6. #6
    ZeXtras Community Manager ZeXtras Employee Cine's Avatar
    Join Date
    Apr 2011
    Posts
    2,342
    Quote Originally Posted by yvespires View Post
    Official Zimbra documentation just tell you how to enable policyd, but where is webgui to control/add quota limits?

    zmprov ms <mta server> +zimbraServiceEnabled cbpolicyd

    wget -c http://devlabs.linuxassist.net/attac...1111115.tar.gz

    tar -zxvf cluebringer-v2.1.x-201211111115.tar.gz

    cd cluebringer-v2.1.x-201211111115/webui/

    cp *.php *.css /opt/zimbra/cbpolicyd/share/webui/

    cd /opt/zimbra/httpd/htdocs/ && ln -s /opt/zimbra/cbpolicyd/share/webui/

    nano /opt/zimbra/cbpolicyd-2.1.0-beta/share/webui/includes/config.php

    change: $DB_DSN="mysql:host=localhost;dbname=cluebringer";

    to: $DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb";

    su – zimbra -c “zmapachectl restart”

    http://IpServerZimbra:7780/webui/index.php


    is this ok?!
    Hello Yvespires,
    welcome to the forums!

    The commands you wrote seem good to me, but remember that Zimbra uses a custom built version of CBPolicyD and adding the Web UI to versions in which it is not included by default is not an officially supported procedure and can lead to unexpected results... I haven't had any issues in using this in Zimbra 8.0.0 and 8.0.1, didn't try 8.0.2+.

    Have a nice day,
    Cine
    the ZeXtras Team
    IT Support Team Contact Form
    Sales Team Contact Form

    ZeXtras Website
    # ZeXtras Wiki # ZeXtras Store

    Have ZeXtras Suite or ZeXtras Migration Tool been helpful to you?
    Share your experience in the Zimbra Gallery!

    ZeXtras Suite on the Zimbra Gallery
    ZeXtras Migration Tool on the Zimbra Gallery


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •