First part of my question: I successfully could limit outbound emails sent from remote clients using this main.cf testing configuration:
anvil_rate_time_unit = 60s smtpd_client_message_rate_limit = 1 This conf, however, cannot limit clients sending emails from within the host. I then found this man page conf and used it to void the default configuration ($mynetworks): smtpd_client_event_limit_exceptions = Local clients (bash scripts and PHP mailers in particular) are still not rate limited at all. How can I accomplish this? Second part of my question: Aside from a very generic error in maillog, I cannot find the "Too many mails" error the client receives upon being rate limited. How can I configure Postfix to leave a more recognizable error? Without a specific message it will be difficult to fix abuse in an efficient way. Background information: rate limiting external clients with stolen credentials is important but limiting malicious scripts ability to send many thousands of spam messages per minute equally so. Thanks.