0

I have a Postfix 2.11 server listed as an MX-server for a wildcard domain, *.domain.com

I need to limit the incoming rate per particular subdomain/destination address. So if someone starts sending 1000s of emails to same address- there's a delay being added.

PS. I tried googling but all I can find is - rate-limiting of outgoing smtp-emails, not incoming (smtpd)...

serge
  • 123
  • 1
  • 8

3 Answers3

1

you use 3rd party policy plugins

http://www.postfix.org/addon.html

An example of a rate limiting with postfwd.

Jacob Evans
  • 7,886
  • 3
  • 29
  • 57
  • DKIM, SPF, greylists? The incoming emails are legit. Not spam. I just need to delay bulk emails, so the database server doesn't go crazy. – serge Jan 11 '17 at 16:07
  • then just the rate limiting, you gave no insight to your existing policies – Jacob Evans Jan 11 '17 at 16:09
  • I didn't, sorry, but I was pretty explicit tho: "if someone sends tons of email - ADD A DELAY" . Does SPF/DKIM/blacklists or dmarc add a delay? :)) – serge Jan 11 '17 at 16:13
0

Another option might be to use postfwd as policy_daemon; the site even has some examples:

http://postfwd.org/ratelimits.html

Ralf Hildebrandt
  • 489
  • 1
  • 3
  • 12
0

What you are looking for is a third party policy daemon.

Policyd v2.0, "Cluebringer", is able to do exactly what you want/need: http://wiki.policyd.org

Other daemons also have rate based limiting facilities, e.g. Rspamd and many others.

But face the truth: this is not what you really want.

What you really want is a dynamic blocking of senders which send too much mails per minute/etc.

This can be done by Postfix itself, take a look at anvil, herehttp://www.postfix.org/TUNING_README.html and here: http://www.postfix.org/anvil.8.html

Also putting postscreen in front of your real Postfix might help: http://www.postfix.org/POSTSCREEN_README.html

Marc Stürmer
  • 1,904
  • 13
  • 15