0

We have a commercial, closed-source, and important server appliance, whose rudimentary email notification mechanism leaves a lot to be desired. Postfix does great as an internal relay, to forward the server’s email notifications to our staff (gmail).

Once in a while, based on events that happen, the server may generate hundreds of identical notifications - I’ve seen 800 identical emails in the span of 15 minutes. Of course it’s a major nuisance and I doubt Gmail is happy about it either; I’d like to use Postfix to intelligently filter those situations.

This isn’t your normal “protect against spammers” situation. The common rate limiters, smtpd_error_sleep_time and smtpd_soft_error_limit deal with erroneous clients.

  1. How do you set up a filter that triggers a body_check based on the frequency of incoming messages?

  2. I can see a few ways to go about it:

  • Drop (discard?) the message if an identical body message was sent in the last X seconds.
  • Compare all messages and consolidate based on identical body
  • Combine the identical messages into a digest (each email is only 4 lines long, I’d rather get 8 emails, each 400 lines long, instead of 800 4-line emails.)

However I'm a Postfix noob and considering this function & priorities, I'd go for the simple, straightforward solution. For example, deploying a "real content filter program" for heavy-duty after-queue inspection seems like overkill. Hopefully the built-in content inspection process will suffice.

Drew
  • 101
  • 1
  • Identical as in *byte-by-byte exact copies*? Or just multiple messages, generated at different times, each with their own `Message-ID:` header? – anx Oct 20 '21 at 04:18
  • Multiple messages, generated at different times, each with their own Message-ID: header. Just body's content matches. – Drew Oct 20 '21 at 20:00

1 Answers1

0

Was going to just bump this... but I'm getting a better understanding that as an MTA, postfix doesn't really deal with stuff like this. I see that one solution is to install Dovecot and Sieve/Pigeonhole. It has a deduplication extension.

As I think it through, still sounds like a complicated heap for what I'm trying to achieve, e.g. setting up IMAP and an intermediate email account (that Gmail will accept)... And Postfix does have built-in content inspection capabilities.

Drew
  • 101
  • 1