
Originally Posted by
[MuTe]
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!