- If you wish to limit the total number of recipients in an email, you can do that using the variable:
smtpd_recipient_limit=10# postconf -e 'smtpd_recipient_limit=10'
# /etc/init.d/postfix restart
- If you wish to specifically limit the number if recipients in TO and CC. You can do that with the option in main.cf:
header_checks = regexp:/etc/postfix/header_checks
- Contents of /etc/postfix/header_checks:
/^To:([^@]*@){50,}/ REJECT Sorry, your message has too many recipients.
/^Cc:([^@]*@){50,}/ REJECT Sorry, your message has too many recepients.
This will not work for BCC. By the time the message gets to header_checks, the BCC header will be already removed.
--