{"id":886,"date":"2013-07-12T12:50:31","date_gmt":"2013-07-12T11:50:31","guid":{"rendered":"http:\/\/blogs.silicontechnix.com\/?p=886"},"modified":"2013-07-12T12:50:31","modified_gmt":"2013-07-12T11:50:31","slug":"how-to-limit-the-number-of-recipients-in-postfix","status":"publish","type":"post","link":"https:\/\/blogs.silicontechnix.com\/?p=886","title":{"rendered":"How to limit the number of recipients in Postfix"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>1) If you wish to limit the total number of recipients in an email, you can do that using the variable: <\/p>\n<pre class=\"brush:bash\">\r\nsmtpd_recipient_limit=10\r\n<\/pre>\n<pre class=\"brush:bash\">\r\n# postconf -e 'smtpd_recipient_limit=10'\r\n<\/pre>\n<pre class=\"brush:bash\">\r\n# \/etc\/init.d\/postfix restart\r\n<\/pre>\n<p>2) If you wish to specifically limit the number if recipients in TO and CC. You can do that with the option in main.cf:<\/p>\n<pre class=\"brush:bash\">\r\nheader_checks = regexp:\/etc\/postfix\/header_checks\r\n<\/pre>\n<p>contents of \/etc\/postfix\/header_checks<\/p>\n<pre class=\"brush:bash\">\r\n\/^To:([^@]*@){50,}\/ REJECT Sorry, your message has too many recepients.\r\n\/^Cc:([^@]*@){50,}\/ REJECT Sorry, your message has too many recepients.\r\n<\/pre>\n<p>This will not work for BCC. By the time the message gets to header_checks, the BCC header will be already removed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; 1) 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 &#8216;smtpd_recipient_limit=10&#8217; # \/etc\/init.d\/postfix restart 2) 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"no","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[95],"tags":[242,402,405,403,404],"class_list":["post-886","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-mail","tag-postfix","tag-recipient","tag-recipient-limit","tag-smtpd"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p12j6H-ei","_links":{"self":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=886"}],"version-history":[{"count":2,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions"}],"predecessor-version":[{"id":888,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions\/888"}],"wp:attachment":[{"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.silicontechnix.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}