New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Postfix local user rate limit
Hi,
I was asked by a friend to help him to add email ratelimits per hour per user on his webserver, the issue all the rate limiting guides are doing it via check_policy_service with is a smtpd restrictions which has zero effect of email send via phpmail or sendmail.
Dose anyone have any idea how you can implement that on Postfix, I know how to implement that kind of ratelimit in Exim.
I know the other option is you can just force user to send via smtp by disallowing email via phpmail but he prefer if he dose not need to do that.
Ryan
Comments
http://www.postfix.org/TUNING_README.html#conn_limit
Not that that kind of limit, am talking about e.g user x can only send 200 email per hour.
I haven't yet tried this, but it appears that if you used PHPMailer instead of the standard mail function of PHP, you could require PHPMailer to use smtp instead of sendmail. See https://github.com/PHPMailer/PHPMailer/blob/master/README.md .
Otherwise, the standard recommendation for Postfix is PolicyD ( https://wiki.policyd.org/ ), which is an add-on to Postfix, but which also uses smtp.
I have previously used https://github.com/onlime/ratelimit-policyd for this. Might be something useful for this case.