Re: [exim] Move entire incoming queue to another server

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: blists
CC: exim-users
Subject: Re: [exim] Move entire incoming queue to another server
On 2013-09-21 at 00:18 -0700, blists@??? wrote:
> I had a drive failure and as a result all incoming mail ended up in the
> exim queue, about 7000 messages.
>
> We brught up the accounts on a spare server and pointed the IPs to the
> new server, and mail is again coming in, but clients want their email.
>
> First Question: How can I tell exim to keep the email in the queue and
> not send it back at expiry time?


Mess with the retry configuration in the config file.

> Second question: How can I get exim on the broken server to send those
> emails to another server? The deliveries were set to local when the
> mails came iin but now I don't know how to get them out to the new
> machine.


Either move the files across, or add a manualroute Router on the old
machine to direct the messages to the new machine.

> Third question: can I just tar up entire queue and move it the new
> machine and dump the files into the queue's directories there? And if
> so, do I have to massage any files so exim will know about them?


*If* you stop Exim briefly on the machine, then: Yes, if I am correctly
interpreting what you wrote, in that there was no Exim running on both
machines at the same time, so there's no risk of filename collisions:
the queue-ids embed a timestamp as part of the filename. If you want
more guarantees of safety with concurrent queues in future, set
"localhost_number" distinct on each machine in the Exim configuration.

If you want to leave the new Exim running, then untar the old spool area
to somewhere outside the normal Exim queue and use some shell for-loops
to move the files across into the running queue, handling the *-D, *-J
and *-H files in order, for each filename stem.

The -D files have the body, you want that moved across first.
The -J files are transient journals; *if* one exists, then you need to
move that next, so that when Exim opens the -H file it can see the -J is
already there, replay it to update the -H and then delete the -J.
Then, last, move the -H files.

The crude way is to just move all the *-D in bulk, then all the *-J and
last all the *-H.

See also "55. Format of spool files" in The Exim Specification.

-Phil