Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
- Requeue mailet allows specifying:
- a Mail Queue name (optional, default to spool)
- a target processor (optional, defaults to root)
- a delay (optional, defaults to none)
Eg:
<mailet matcher="All" class="Requeue"> <queue>spool</spool> <processor>transport</processor> <delay>2h</delay> </mailet>
This is a generic enough functionality that I think it can make sense by itself.
Combined with rate limiting mailet, it allows for a (very basic) throtler: smooth the traffic to the expected rate. Note that this is a naive approach: if you have a large amout of emails (say N) submitted at once, you would need O(N) requeues to eventually send all your mails, where the constant is the number of mail allowed over the time window. So this gives an overall complexity of O(N2), while careful planning could achieve this in O(N).
Eg: throttle senders to 10 mails per hour, smoothing the traffic as required.
<processor name="root"> <mailet matcher="All" class="PerSenderRateLimit"> <redisURL>redis://localhost:6379</redisURL> <keyPrefix>myPrefix</keyPrefix> <duration>1h</duration> <count>10</count> </mailet> <!-- Go to transport for instance --> </processor> <processor name="root"> <mailet matcher="All" class="Requeue"> <queue>spool</spool> <processor>root</processor> <delay>1h</delay> </mailet> </processor>
TODO:
- [ ] Write the JIRA ticket for throttling
- [ ] Write the Requeue mailet (`server/mailet/mailets`)
- [ ] And finally provide documentation and config samples for this naive throttler
Attachments
Issue Links
- links to