
On Tue, Mar 13, 2012 at 03:41:30PM +1100, Daniel Jitnah wrote:
On 13/03/12 15:17, Mike Fabre wrote:
Hi, I have a postfix & dovecot server set up, and I have been given the task of making it put a arbitrary 5-10 minute delay for every email that comes through, whether it be for sent mail or received mail doesn't matter.
The first thing we thought of was to make all users use procmail, and set up a global procmail rule with a sleep in it, while this will almost certainly work, the users must not be able to run commands on the server, which they can do with a ~/.procmailrc file. I have tried to set up a postfix filter which would delay the mail (similar to this: http://pintant.cat/2010/04/14/how-to-delay-the-mails-postfix/) but that has an issue where it will only allow 5 of these filters to be running at a time, so if I where to send 10 messages with a 5 minute delay, the first 5 will take 5 minutes and the next 5 will take 10 minutes. I can change this limit within postfix but I would prefer to use a method that is more scalable. Anyone got any ideas?
Just guessing that mailscanner might do the trick. Although its a malware scanner, it is designed to queue up mail and batch process at specified interval. (If you dont want the scanning functions, you could probably disable these). Although it probably means that if an email gets on an empty or near empty queue just before the queue is flushed, it will be processed almost immediately. Is this a problem?
Looks like it should do the trick, seems to have too much bloat for my use case, but I'll look into it. Thanks. -- Mike Fabre