--On 29 November 2007 09:55:19 -0500 Kevin Colagio <colagio@???>
wrote:
>
> We are in the planning stages of moving mail from one location (within
> home directories) to another (a separate storage space). During the
> move of an individual's Maildir directory, I would like to hold the
> messages for that person and then release them for delivery once the
> move is complete. I don't want to stop everyone's mail at one time, but
> I'm also not adverse to working through groups of users.
How is Exim determining the delivery location? If you're just testing for
presence of a directory, the stuff below might work. I've not done this,
but we have just migrated a few thousand people from mbox to cyrus
mailstore formats, and relied entirely on file system locks to prevent
delivery during the move.
If the destination is on the same file system, then the move should be
atomic, and you need take no special measures. Alternatively:
atomic: Move the maildir out of the way, replace with a dummy file and put
a dummy file in the destination location. You might want to play with
permissions of the dummy files, but the point is that their presence should
cause Exim to fail to deliver the email. Exim should queue the email, and
deliver later when it can. Your Exim config will tell you how long you have
before delivery delay warning messages are sent.
mv ~foo/Mail ~foo/Mail-to-be-moved; touch ~foo/Mail ; touch /Mail/foo
Move the email across the file systems (not atomic):
cp ~foo/Mail /Mail/foo-moved
Now, do checks to ensure that the copy worked properly. For example, you
could compare md5 hashes of all the files in the directory tree.
atomic:
mv /Mail/foo-moved /Mail/foo
Then delete your original copy. Perhaps leave it in place for a couple of
weeks in case you have any complaints.
>
> Ideally, Exim would use a text file as the indicator of which mail to
> hold. If the recipient is in that file, delivery to that address is not
> attempted. This makes it an easy process to update the file.
>
> Any ideas or implementations to do this would be great.
>
> Thanks in advance.
>
> --
> Kevin Colagio: Systems Analyst, Reef Geek, and Perpetual Student
> Computing and Information Technology, SUNY at Geneseo, South 124
> colagio@??? (585) 245-5577 http://www.geneseo.edu
> Experience is a harsh teacher, the tests are first, the lessons follow.
--
Ian Eiloart
IT Services, University of Sussex
x3148