Is there a way to lock mail accounts for maintenance?


Verified User
Nov 4, 2005

Sometimes when we're moving accounts between DA servers, the admin backup/restores takes a long time, because the account contains lots of data. The majority of data is generally either inside domains/ somewhere, or inside imap/. In order to speed up the backup/restore and minimize the downtime, I was thinking about doing the migration in roughly these steps:

1. Rsync domains/ and imap/ to new server
2. Use custom httpd config to put their website in "maintenance mode"
3. Hold mail to the domain on our external MX servers
4. Something to avoid the customer to make changes to mailboxes on the server
5. Move domains/ and imap/ out from the home directory
6. Perform the admin backup
7. Perform the restore on new server
8. Move rsynced domains/ and imap/ into the new home directory
9. Release website from maintenance and unhold mails

This way the time spent in step 6 is minimized, since it doesn't need to back up several gigs of data. Since delivery of new mail is stopped, I won't have issues with incoming mail that might be missing from the backup, but there might be people with email clients out there, making changes to their mailboxes that may or may not be brought over to the new server, depending on the timing. So what I'm after is a way to prevent end users from accessing and making changes to their mailbox (step 4). I know I can change the passwords for all the accounts, but this would probably result in their IP address being blocked by LFD, which might not be desirable either. Any suggestions on how I could achieve this?

(The same risk of course goes for data in domains/, but I think the chance of changes there is smaller than for mail accounts.)