Re: [Exim] batch emails

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Dan Egli
CC: exim-users
Subject: Re: [Exim] batch emails
On Tue, 21 Aug 2001, Dan Egli wrote:

> My system is relaying a LOT of mail to a particular address. I was
> wondering if there was a way I could configure exim to only send mail to
> user@??? between the hours of X and Y? If mail is recieved for
> that user before that time, it is held in the Queue till it's time.


1. This is messy in Exim 3 because there is no "smartuser" router. You have
to detect the situation in a router, artificially route the address to
localhost with "self = local" set, then pick it up in the directors with
a smartuser director that contains

new_address = :defer: The time isn't right.

You also have to arrange the retry rule so that it is likely to be tried
in the right hours (or use cron to force deliveries).

In Exim 4 this will be easier because the distinction between routers
and directors has been abolished.

How do you detect the time in a director or router? Answer: you do
something like this:

  condition = ${if and { \
                       {> {${substr_11_2:$tod_log}}{X}} \
                       {< {${substr_11_2:$tod_log}}{Y}} \
                       } \
               {yes}{no}}


2. If all this sounds like a lot of complication, have you considered using
the serialize_hosts option instead? This may slow done the rate at which
mail is sent to host1.com.

3. A "cleaner" way of doing this would be to arrange to deliver such
mail locally into files, in BSMTP format, when the time isn't right.
That way it is off Exim's queue and the retrying mechanism isn't wasting
its time. Then when the time is right, you have a cron job to re-submit
all the messages. This is very similar to the "best" way of handling
mail for dial-in hosts. There are words about this in the book.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.