[exim] On queue run prefer small messages first, how?

Top Page
Delete this message
Reply to this message
Author: jori.hamalainen
Date:  
To: exim-users
Subject: [exim] On queue run prefer small messages first, how?
-----------------------
From FAQ
Q0625:  I wish to have large emails go out one at a time. 
A0625:  One possibility is to set up a router that defers all large messages, except in queue runs. Since queue runners deliver just one message at a time, if you limited the number of simultaneous queue runners to 1, you would get the effect you wanted. A suitable router might be 
   defer_if_large_unless_queue_run:
     driver = manualroute
     condition = ${if or{{queue_running}{<{$message_size}{200K}}}{no}{yes}}
     data = :defer: too large for immediate delivery
Of course, this would always delay any large message until the next queue runner, but if you run them fairly regularly, this shouldn't be a huge problem, and may even be desirable. 
-----------------------


But this isn't what I have in my mind. I am thinking about giving bigger priority for small messages if exim drops into queue mode because of load. Normally desirable operation mode is instant delivery without queueing.

I want something like:

if queue runner and retransmit time triggered then
if message_size < 3k then deliver
else wait until < 3k messages have been delivered, then start delivering big messages

I realize that I can make a router for small messages which says defer on big messages, but how I can stop deferring when there is only big messages left on queue?

For machine to machine communication I want small ACK messages to have priority, deliver them ASAP on slow links. It sounds impossible but it is?

Thanks in advance!