How to limit sending number of email address in per mail

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
arif.meman
Posts: 2
Joined: Thu Sep 27, 2018 12:26 pm

How to limit sending number of email address in per mail

Postby arif.meman » Fri Nov 09, 2018 5:00 am

Hi All,

How to limit number of email addresses one user can send per mail.

what i want to do is, i want to limit every user to restrict.

like, for one user, i want that, he can send only 50 email addresses in one mail, in To, CC or BCC.

is that possible?


afsher
Posts: 6
Joined: Mon Nov 14, 2016 8:52 am

Re: How to limit sending number of email address in per mail

Postby afsher » Fri Nov 09, 2018 8:38 am

After executing the below policy, users shall not be able to add more than 10 email addresses in a message to/cc/bcc field.

Step 1: Login as a Zimbra user and check current limit.

root@mail:~# su – zimbra

Check the current limit:

zimbra@mail:~$ postconf | grep smtpd_recipient_limit
smtpd_recipient_limit = 1000 ##This is the default recipient limit

Step 2: Restrict recipient limit to 10

zimbra@mail:~$ postconf -e 'smtpd_recipient_limit = 10'

It will restrict the recipient limit to 10. You may adjust the number based on your scenario.

Step 3: Apply Settings

zimbra@mail:~$ postfix reload

After applying this settings, you will get an error while sending a message greater than the
threshold value (in this case: 10).
alogicking
Posts: 31
Joined: Tue Aug 14, 2018 12:53 pm
Location: India
ZCS/ZD Version: 8.8.15_GA_3829.RHEL7_64_FOSS P12

Re: How to limit sending number of email address in per mail

Postby alogicking » Fri Oct 16, 2020 2:24 pm

Hi All,

I wanted to implement this (limiting the sending number of email address per mail) on my server for all incoming emails from external domains (any domains not hosted on our email server) but don't want the number of recipients restrictions if the emails are being sent from the domains hosted on our own server. Is it possible? If yes, then can you share some details how do we achieve it?

We are using: RHEL7_64 FOSS edition, 8.8.15 Patch 12

Regards
User avatar
L. Mark Stone
Elite member
Elite member
Posts: 2198
Joined: Wed Oct 09, 2013 11:35 am
Location: Portland, Maine, US
ZCS/ZD Version: 8.8.15 Network Edition
Contact:

Re: How to limit sending number of email address in per mail

Postby L. Mark Stone » Sat Oct 17, 2020 3:48 pm

alogicking wrote:Hi All,

I wanted to implement this (limiting the sending number of email address per mail) on my server for all incoming emails from external domains (any domains not hosted on our email server) but don't want the number of recipients restrictions if the emails are being sent from the domains hosted on our own server. Is it possible? If yes, then can you share some details how do we achieve it?

We are using: RHEL7_64 FOSS edition, 8.8.15 Patch 12

Regards


Check out CBPolicyd:
https://wiki.zimbra.com/wiki/How-to_for_cbpolicyd
https://wiki.zimbra.com/wiki/Cluebringer_Policy_Daemon
https://wiki.zimbra.com/wiki/King0770-N ... -CBPOLICYD

Hope that helps,
Mark
___________________________________
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
Zeta Alliance http://www.zetalliance.org/
alogicking
Posts: 31
Joined: Tue Aug 14, 2018 12:53 pm
Location: India
ZCS/ZD Version: 8.8.15_GA_3829.RHEL7_64_FOSS P12

Re: How to limit sending number of email address in per mail

Postby alogicking » Sun Oct 18, 2020 3:00 pm



Hi Mark,

Thanks for your response and sorry If I was not clear with what I wanted to achieve. I do have policyd enabled on my server and I am limiting the message delivery rates as per minutes/hours/day . let me know how I can achieve the below setup using policyd or with smtpd_recipient_limit

The requirement I have is to restrict the delivery of any email which has more than x number of recipient (can be 10 or 20 or something I wanted including to/cc/bcc) in any specific email message if the email is sent from external domain and not from the domains hosted on my mail server.

afsher mentioned the steps as below:

Restrict recipient limit to 10

Code: Select all

zimbra@mail:~$ postconf -e 'smtpd_recipient_limit = 10


I wanted to know if I use the above steps as mentioned by afsher on my email server, how to restrict it to work only for external domains mail ids and not the internal email ids.

Hope I am clear with the requirement this time.

Regards
User avatar
L. Mark Stone
Elite member
Elite member
Posts: 2198
Joined: Wed Oct 09, 2013 11:35 am
Location: Portland, Maine, US
ZCS/ZD Version: 8.8.15 Network Edition
Contact:

Re: How to limit sending number of email address in per mail

Postby L. Mark Stone » Mon Oct 19, 2020 4:26 pm

Ah, now I understand, thanks for clarifying!

So to restrict the number of recipients in each individual email to ten globally, you'll need to do as the zimbra user:

Code: Select all

postconf -e smtpd_recipient_limit=9
postconf -e smtpd_recipient_overshoot_limit=1


Both of those settings have a default value of 1,000, so just configuring smtpd_recipient_limit alone isn't sufficient.

If the user then puts eleven recipients in the to: and/or cc: and/or bcc: fields in the web client, and then hits the Send button, Zimbra will give them an error about too many recipients.

These settings will survive most Zimbra Patches, but if a Patch also includes a new MTA package, I would double check that the settings are still in place, like so:

Code: Select all

postconf -n | grep smtpd_recipient | grep limit
smtpd_recipient_limit = 9
smtpd_recipient_overshoot_limit = 1


To do the sending restrictions on a per-domain basis, you'll need to use cbpolicyd.

Hope that helps,
Mark
___________________________________
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
Zeta Alliance http://www.zetalliance.org/

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 17 guests