From owner-freebsd-isp Thu Oct 19 11: 7:25 2000 Delivered-To: freebsd-isp@freebsd.org Received: from mail.sai.co.za (ns1.amandla.co.za [196.33.40.1]) by hub.freebsd.org (Postfix) with ESMTP id 79F7937B479 for ; Thu, 19 Oct 2000 11:07:19 -0700 (PDT) Received: from fdisk (dave.sai.co.za [196.33.40.17]) by mail.sai.co.za (8.9.3/8.9.3) with SMTP id UAA73176; Thu, 19 Oct 2000 20:07:30 +0200 (SAST) (envelope-from davew@sai.co.za) Message-ID: <022d01c039f9$855d5460$112821c4@sai.co.za> From: "Dave Wilson" To: Cc: Subject: Moving mail to another server for 700 accounts Date: Thu, 19 Oct 2000 20:22:16 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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. Does anyone know how I can get all 700 accounts across in one go ? I have tried various bash variables etc. to get this working but don't seem to have any luck Don't laugh, but this is one way I tried ;-) : # awk -F: '$3 > 100 { print $1}' /etc/passwd > /etc/mail/everyone #Gets all users listed on /etc/mail/everyone # ALLUSERS=`cat /etc/mail/everyone` #Sets the variable for all my users # formail -b -Y -f -s /usr/sbin/sendmail -oi $ALLUSERS@new.mail.server < /var/mail/$ALLUSERS #Tries to mail the whole lot off. Doing the above led to sendmail or bash or something complaing about an "ambiguous redirect" ?? I donno, I'm really lost and don't feel like spending 5 hours moving each accounts' mail separately, please help if you can.... I would appreciate it a hell of a lot. Thanks Regards Dave Wilson The S.A. Internet (033) 3456777 0825496159 http://www.sai.co.za "Who is "General Failure", and what is he doing reading my hard disk ?" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message