How to limit number of recipients for outgoing mail using Postfix sendmail

This is not working because smtpd_recipient_limit only applies to the emails received by smtpd daemon through an SMTP transaction. The emails submitted using the sendmail command is queued in the maildrop queue by the postdrop command, which is picked up by pickup and fed to cleanup directly.

You can't restrict recipient count for the mails submitted through sendmail command. The only solution to this problem is force your applications to send mail only through an smtp transaction.