Exim Bcc CC Limit?

[MuTe]

Member
Oct 4, 2004
14
0
151
Hey guys,

I would like to add a limit to the amount of bcc and cc address an email can have in its header.

Is there a way to do this google hasnt turned up much yet...

I would like to limit my users to only a few hunderd bcc and cc in emails. Also is there a way to if they try to send too many, reject the message and send them a message detailing their service isnt provided to spam people.

Thx

[MuTe]
 

ispro

Well-Known Member
Verifed Vendor
Apr 8, 2004
628
2
168
[MuTe] said:
Hey guys,

I would like to add a limit to the amount of bcc and cc address an email can have in its header.

Is there a way to do this google hasnt turned up much yet...

I would like to limit my users to only a few hunderd bcc and cc in emails. Also is there a way to if they try to send too many, reject the message and send them a message detailing their service isnt provided to spam people.

Thx

[MuTe]
You have two options. Both should be done via Exim Configuration Advanced edit.

One is global - limit max recipients per EACH outgoing and incoming message.
Just add the followin at the very first box of Advanced edit:


Code:
recipients_max = 15

recipients_max_reject = true
This will limit to 15 recipients per message. It is global limit and no one can override this.

If you would like more flexible ACL rules you need to edit Third box, at the section called "check_recipient" add the following:

Code:
# Limit the number of recipients in sent email
deny message      = Too many recipients, 15 maximum without SMTP Authentication
        condition    = ${if >{$recipients_count}{15} {yes}{no}}
        !authenticated= *
deny message      = Too many recipients, 200 maximum with SMTP Authentication
        condition    = ${if >{$recipients_count}{200} {yes}{no}}
This is the sample which limit non-authorized senders to 15 recipients and SMTP-authorized with 200 recipients.

Of course, you may enter any conditions you wish! You may use lsearch and have file with whitelisted senders/hosts/etc. Use anything which suits better for you.

Enjoy!
 

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
ispro said:
Code:
# Limit the number of recipients in sent email
deny message      = Too many recipients, 15 maximum without SMTP Authentication
        condition    = ${if >{$recipients_count}{15} {yes}{no}}
        !authenticated= *
deny message      = Too many recipients, 200 maximum with SMTP Authentication
        condition    = ${if >{$recipients_count}{200} {yes}{no}}
This rules also affect to my mailing list.

Every mailist send by my user that over 15 will be rejected.
 

ispro

Well-Known Member
Verifed Vendor
Apr 8, 2004
628
2
168
isputra said:
This rules also affect to my mailing list.

Every mailist send by my user that over 15 will be rejected.
Easy to solve!

Open this file for edit:
/usr/local/cpanel/3rdparty/mailman/Mailman/mm_cfg.py

And add the following at the end:
Code:
# Max recipients for each message
SMTP_MAX_RCPTS = 10

# Max messages sent in each SMTP connection
SMTP_MAX_SESSIONS_PER_CONNECTION = 10
This way Mailman will be compatible with Exim limit.

Enjoy!
 

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
ispro said:
Easy to solve!

Open this file for edit:
/usr/local/cpanel/3rdparty/mailman/Mailman/mm_cfg.py

And add the following at the end:
Code:
# Max recipients for each message
SMTP_MAX_RCPTS = 10

# Max messages sent in each SMTP connection
SMTP_MAX_SESSIONS_PER_CONNECTION = 10
This way Mailman will be compatible with Exim limit.

Enjoy!
After add that rules, do i need to restart mailman ?
If yes, how to restart mailman from shell ?
 

tuxguroo

Member
Aug 28, 2006
5
0
151
start mailman

You can start mailman by running the following script :

/usr/local/cpanel/3rdparty/mailman/bin/mailmanctl start

:D
 

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
Thanks to ispro and tuxguroo :D

Also for [Mute] that start this thread