Hi all!
How do I transfer mail already stored in /var/spool/mail/xxx to another host ? (without using ftp, rcp or any other kind of copy/archiving utility
I'm using linux/sendmail
Any idea would be greatly appreciated!!!
Why this limitation? (without using ftp, rcp or any other kind of copy/archiving utility)...and why on earth does that limitation make sense to you?
Because i do not have access to those services on the remote mail server ...
Anyway, i discover i can send mail using 'cat mailfile | sendmail touser@somehost.com' but it only process one mail at a time and the mailbox has 150 msgs, so:
for i in `seq 150`
do
echo s $i file.$i >> forpipe
done
echo x >> forpipe
mail -f /var/spool/mail/usr_mbox < forpipe
for i in file.*
do
cat $i | sendmail touser@somehost.com
echo "Sent $i"
sleep some_time
done
And omitting of course the 1st don't delete mail ...
Well you could of course tar the files up, concatenate them all into a single file, or mail them one at a time! Choice is yours. I probably would use tar first though.