2

I want to move some Mailbox directories to a new disk while postfix and courier imap daemons are still running.

The question is ¿what happens if a new mail is recieved into the Mailbox while moving the files? ¿is it safe?

Thanks!

siete
  • 23
  • 5

2 Answers2

4

Don't do it if you're using Mailbox files. If you were using Maildir you could do at least some of the work without shutting the services down.

Every email that is delivered, and every IMAP access, will alter the Mailbox files. You may end up with corrupted files.

The best you can do is to shut off IMAP and local delivery, while still allowing postfix to queue incoming mails. Then, once the move is finished, turn local delivery back on and all the queued mails will be delivered.

Jenny D
  • 27,358
  • 21
  • 74
  • 110
0

No it's not safe.

Declare a service window and schedule downtime. Your secondary MX will cache incoming mail and your users can do without, for a couple of hours even, if you schedule your maintenance window well.

Use rsync to copy the existing mail spool to your new disk and time how long a second run takes to determine the needed downtime. If your incremental rsync run for instance takes 4 hours, you need 5 hours of scheduled downtime. Start an rsync again 5-6 hours before the start of your downtime. If it doesn't complete before the actual start of your maintenance window, that's a No Go and reschedule.

If it does, then start your scheduled maintenance

  • suspend and disable automatic restart of incoming mail & IMAP
  • possibly go to single user mode
  • run rsync again
  • change your mount points
  • reboot
  • check if the new disk mounts correctly
  • enable incoming e-mail an IMAP again
  • reboot
  • declare success, GoTO pub or home after calling your manager
HBruijn
  • 72,524
  • 21
  • 127
  • 192