[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Graceful way to move user's mail from one host to another?



You can use fetchmail on the new host to get the mail from the old host. I put this in a script and ran it periodically until the old mx records expired:

echo "poll oldhost.domain.com protocol POP3 username $login password $pass" | fetchmail --all --nokeep --mda "procmail -d $login" --auth password -f -

At least I think that's right. Just keep in mind that spammers don't always pay attention to ttl, so the mail coming into the old host never entirely stops. At some point you just cut it off.

Peter A. Dumpert
Innovative Computer Services, LLC
The Diamond Standard of Internet Business
P: 732-683-0092 x 102 F: 732-577-9390
http://innovativebusiness.net/



Adam Rosi-Kessel wrote:

I run a small ISP with two hosts. I need to move some user accounts from one
system to another. There will be no DNS change--the accounts are just moving
from subdomain to another.

In the past when I've done this, I've always done an awkward one-by-one
move, where first I rsync the user's home directory over, then I move the
messages from the user's mail spool into a file in their home directory and
immediately put a .forward file in place, re-rsync the home directory, then
on the target system, I go and copy all the messages from the spool file in
their home directory back into the real spool file in /var/mail. (In cases
where I'm also changing DNS, I then implement the DNS change, and the
.forward file on the first host takes care of messages delivered to the old
IP address until the DNS change propagates).

This is the only way I could think of to insure that no mail is lost in the
short time while the transition is taking place.

Is there a more graceful, and ideally scalable, way to do this?




Reply to: