Re: [exim] holding up deliveries for a specific domain betwe…

Top Page
Delete this message
Reply to this message
Author: Jason_Meers
Date:  
To: exim-users
CC: Stefan Klatt
Subject: Re: [exim] holding up deliveries for a specific domain between 8am-8pm
Philip Hazel wrote:
> On Wed, 21 Feb 2007, Jason_Meers wrote:
>
>
>> In my mind the logical way to achieve something like this would be to
>> have some kind of option in a transport that dictated the hours in which
>> the transport was allowed to deliver messages. You could then specify
>> different transports for different messages based on the criteria
>> matched in a router (which could be any of the huge range of options
>> currently available in a router now).
>>
>
> The problem with this is that the messages clutter up your normal queue
> and use resources continually checking and finding that the time is
> wrong. Anything that leaves messages lying around on Exim's queue
> degrades its performance.
>
> A different way of doing this is to treat it like delivery to
> intermittently connected hosts. Deliver the messages using BSMTP into
> one or more files when it isn't an appropriate time. Then run a cron job
> at 8 p.m. to feed them back to Exim.
>
> Another way of doing this would be to deliver to a different instance of
> Exim that uses a different spool directory, and has queue_only set. Use
> cron to start its queue runners during the night. Or even don't run its
> daemon during the day - submit the messages using -bs - and have cron
> jobs to start/stop the daemon (which controls the queue runners).
>
>

OK, this seems to be working. I've temporarily setup another exim server
on my workstation as the "man-in-the-middle" to just queue these
messages up.
I'm a RedHat/Fedora/CentOS user so I've modified my /etc/sysconfig/exim
to look like this (to stop the queue runners):

DAEMON=yes
#QUEUE=1h

In my crontab I'm running an "exim -qf" on the hour from 8pm to 7am,
then an "exim -qff" as the last queue run just before 8am.

My exim.conf on the new box looks like this (deliberately obfusticated
in sections so that it can be used an example).
It also has a dnslookup router so that it can deliver error messages to
the administrator (who most likely has an email account on a different
domain than the one we are holding for).

######################################################################
#                       EXIM CONFIGURATION                           #
######################################################################


qualify_domain                  =      {replace with the domain name of 
the administrators account}
qualify_recipient               =       {replace with the domain name of 
the administrators account}
queue_only


domainlist relay_domains = {replace with the domain name(s) of the
domain your holding for}

acl_smtp_rcpt   =       acl_check_rcpt


######################################################################
#                       ACL CONFIGURATION                            #
######################################################################
begin acl


acl_check_rcpt:

  accept  domains       = +relay_domains
          endpass
          verify        = recipient


  deny    message       = relay not permitted for that domain


######################################################################
#                      ROUTERS CONFIGURATION                         #
######################################################################
begin routers


manual_route:
driver = manualroute
domains = +relay_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
route_list = * {replace with the IP address of the server for the
domain your holding for}
no_more

everything_else:
driver = dnslookup
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more

######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################
begin transports


remote_smtp:
driver = smtp

######################################################################
#                      RETRY CONFIGURATION                           #
######################################################################
begin retry


# Domain        Error        Retry..         Then..          Finaly..


  *             *            F,2h,10m;       F,6h,30m;        F,24h,1h


This is a heavily stripped down version to make it more readable, but it
seems to be working fine for me.
Thanks to all who helped. If anyone has any other suggestions I'd also
like to here them. I'll run this for a couple of days then post my
results back on Friday.

Thanks
Jason_Meers
--
http://www.exim-new-users.co.uk