On Sun, Sep 18, 2022 at 06:03:47PM +0200, Matteo Cazzador wrote:

> If a device is in alarm it send one mail every 5 minutes using my 
> postfix smtp (customer can define is own mail address and receive this 
> email),
> 
> The risk is to reach limit and to be consider an abuse from customer 
> mail server or ISP.

The only way to reduce the volume of junk mail from a device that stays
in an alert state, or flaps often between alert and normal is to
selectively reject or discard some or most of the messages, based on
recent deliveries of similar messages.

> Is there some strategy that I can apply on my smtp server without manage 
> the code on device?

You'll need a content filter or milter to detect essentially duplicate
messages, and either quarantine or reject them.

> I read about
> 
> smtpd_client_message_rate_limit = 2
> anvil_rate_time_unit = 60s

These reject messages with a 4XX error, and won't help if the device
retries.  Also no reasonable interval will quench a steady stream of
duplicate events.

You need a deduplication filter, I don't know of a stock one you can
use.

You can probably write something using the Python milter libraries based
in part on matching envelope data or content in sample messages.

-- 
    Viktor.

Reply via email to