* SUMMARY: resending mail
@ 1998-05-20 13:35 Bruce Taube
0 siblings, 0 replies; only message in thread
From: Bruce Taube @ 1998-05-20 13:35 UTC (permalink / raw)
To: tru64-unix-managers
Original question:
> Does anyone know of a script (or method) that will loop through all
mailboxes in /var/spool/mail and resend each message to the same
recipient at another domain. I can't simply append the mailboxes
because the other server at the new domain is VMS and doesn't use
text mailboxes. I also don't want to send the entire mailbox as
one message.
Thanks to these folks for their rapid useful response:
Stephen Dowdy
Matthias E. Johnson
Allan E Johannesen
Nestor Ruiz
Lucio Chiappetti
Brian O'Neill
And special thanks to Charles M Richmond
There were several suggestions to use procmail/formail and several people sent
perl/shell scripts. I ended up using these simple MH commands (slightly
modified) that were suggested by Charles Richmond:
mkdir /var/tmp/spools # Make a copy of spools for safety sake.
cp /usr/spool/mail/* /var/tmp/spools/.
for mspool in /var/tmp/spools/* # mspool is the username which is
do # also the name of the spol file
folder +$mspool # You will have to manually answer 'y'
inc +$mspool -file /var/tmp/spools/$mspool
for msg in ~/Mail/$mspool/* # now loop through msg's
do
cat ~/Mail/$mspool/$msg | sendmail $mspool@newmachine.address
done
done
The above depends on the users having the same user name on both machines.
If you want to use a decnet type address on the sendmail ( machine::$mspool )
then you can.
Use the man pages for 'inc' and 'folder' and understand what you are doing,
so that you can tailor it to your circumstance if needed. The really nice
thing about the above is that it preserves the original date and sender
fields.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-05-20 13:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-05-20 13:35 SUMMARY: resending mail Bruce Taube
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox