[Mimedefang] rate-limiting for outbound mails per sender

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Mon Feb 10 01:08:38 EST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 9 Feb 2014, Marcus Schopen wrote:

> what would be a good way to implement rate-limiting for outbound mails
> per sender e.g. 50 recipients per smtp_auth sender per hour?

I do this in filter_begin. There I detect the sender, assign a "SenderID" 
based on different rules and query a SQL database about the sum of 
recipients of this SenderID in the last hour & day. If the SMTP quota is 
not exceeded, the tuple (scalar(@Recipients), SenderID, NOW()) as added to 
the database.

I purge old entries daily.

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBUvhs5pSHNCne69JnAQLikQf+Iqg9/E3QAhWSb9b0DMKlGBym5qKnO2uc
L1U3QHCh2cIyjbMfjtEGjtZkuN7MJoTcSc9uWqxLQXGIg4ujfnJ7yKCHYSRpd/v9
GgvjL6UbgVFYIZjfghK2azCSYeOLwHbo2rq2nWkJf5EQkhvLs1fct+3nnVfvkpF8
sFrN8ibgEoawasQ/NwYAnn4E3sMSIpy20ae/IH6kWkUcq2t0BbXwQyrK8sE3xfiu
j9qhATfhEJ/Uhepb9oF04r3e+iDVKTMT35vfCujipJxjmu4TXv/EBvrQEIc6p/d9
OBZLUmut/g/tcyMfZWW+jIVSm4Pl148VEg8Bx/9c8QWO34SWFlunZQ==
=6YV3
-----END PGP SIGNATURE-----



More information about the MIMEDefang mailing list