From owner-freebsd-questions Sat Apr 21 23:59:18 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mr200.netcologne.de (mr200.netcologne.de [194.8.194.109]) by hub.freebsd.org (Postfix) with ESMTP id C604937B42C for ; Sat, 21 Apr 2001 23:59:15 -0700 (PDT) (envelope-from pherman@frenchfries.net) Received: from husten.security.at12.de (dial-213-168-91-143.netcologne.de [213.168.91.143]) by mr200.netcologne.de (Mirapoint) with ESMTP id AEC90179; Sun, 22 Apr 2001 08:59:13 +0200 (CEST) Received: from localhost (localhost.security.at12.de [127.0.0.1]) by husten.security.at12.de (8.11.3/8.11.3) with ESMTP id f3M6x4q71959; Sun, 22 Apr 2001 08:59:04 +0200 (CEST) (envelope-from pherman@frenchfries.net) Date: Sun, 22 Apr 2001 08:59:03 +0200 (CEST) From: Paul Herman To: Odhiambo Washington Cc: FBSD-Q Subject: Re: Moving Mail servers In-Reply-To: <20010422051129.A33555@everest.wananchi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi Wash, On Sun, 22 Apr 2001, Odhiambo Washington wrote: > I am changing servers but I have users mails amounting to 3GB on > the old server. The mail is in /var/mail/$user. My new server is > siting next to the old. Is there someone who knows a way to tell > sendmail to send the mails out again????? If the users are the same, it's easy. First, copy the mailboxes over to the new machine (with tar/ftp, or NFS, etc...) into a temporary directory, say /tmp/mail. Then do something like: umask 077 cd /tmp/mail for mailbox in *; do if [ -e /var/mail/${mailbox}.lock ] then echo "Mailbox for ${mailbox} busy, please do by hand" else touch /var/mail/${mailbox}.lock cat ${mailbox} >> /var/mail/${mailbox} chown ${mailbox} /var/mail/${mailbox} > /dev/null 2>&1 rm /var/mail/${mailbox}.lock fi done There might be a race condition on very busy servers, but this should be OK for most. If for some reason an old user doesn't exist on the new machine, you can "find /var/mail -type f -user root" and deal with them accordingly. If the usernames are different, then this is more difficult. :-) -Paul. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message