Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2000 13:24:05 -0500
From:      Neil W Rickert <sendmail+rickert@Sendmail.ORG>
To:        "Dave Wilson" <davew@sai.co.za>
Cc:        freebsd-isp@FreeBSD.ORG, sendmail-questions@sendmail.org
Subject:   Re: Moving mail to another server for 700 accounts 
Message-ID:  <6704.971979845@euclid.cs.niu.edu>
In-Reply-To: Message from "Dave Wilson" <davew@sai.co.za>  of "Thu, 19 Oct 2000 20:22:16 %2B0200." <022d01c039f9$855d5460$112821c4@sai.co.za> 
References:  <022d01c039f9$855d5460$112821c4@sai.co.za> 

next in thread | previous in thread | raw e-mail | index | archive | help
"Dave Wilson" <davew@sai.co.za> wrote:

>Hi guys, howzit going ?

>I have been given the wonderful *not* job of moving 700 mail accounts to a
>non-unix mail server.
>I have a little script that Phillip(FreeBSD-ISP list *thanks*) helped me out
>with that allows me to move each mail accounts data to a specified SMTP
>server, the only problem is that I can only do it one account at a time
>....which would be a bit tiresome with 700 mail accounts
>This is the script Phillip gave me which works perfectly for one user at a
>time:

>formail -b -Y -f -s /usr/sbin/sendmail -oi $USERNAME@new.mail.server <
>/var/mail/$USERNAME

>So what I would type is:
>formail -b -Y -f -s /usr/sbin/sendmail -oi  user1@new.mail.server  <
>/var/mail/user1

>The problem is that I would have to do this for each account ie. user1,
>user2, user3 etc. all the way up to user700.

That sounds like a simple shell job

cd /var/mail
for USERNAME in *
do
  formail -b -Y -f -s /usr/sbin/sendmail -oi $USERNAME@new.mail.server < /var/mail/$USERNAME
done

This assume Bourne shell.

On the sendmail command, I would add '-odd' after the '-oi'.  That
defers all of this mail until the next queue run.  If you start up
too many delivery processes, all at the same time, you may overload
your system.

If there are files other than mailboxes in /var/mail, the above
may need a few changes.

 -NWR



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6704.971979845>