Ok im kinda confused as to how linux mail from the command works, it seems to have its own built in mailing thing i can send mail using echo "message" | mail -s "subject" email@example.com
so i thought i would make that in a batch script and whiped something out really quick it basically said
while [$i -lt 9999]
echo "message" | mail -s "subject" $firstname.lastname@example.org
echo "sending message to $email@example.com"
Well why in the hell would i do that, i dont know but hindsight is 20/20 right? Anyway my screen filled with text when i ran the script sending out emails at blazing fast speeds (or so i thought) after it got to around a thousand it stopped and i ctrl-c to get out of it. Then i couldnt send mail to anyone i tried using it from the command prompt and every way i could. So i left it alone and went to bed, the next morning i woke up and i still couldnt send mail so i restarted the box. As soon as i logged in beep, beep, beep ... new mail with the subject: WARNING could not send message for the past 4 hours its been about 30min and they are still coming in .. a little slower now but they are still coming. I would imagine these are returned mail that couldnt be sent?
My question is what the hell happened ? is there a limit ? I now have a sleep command before the done part of my script and im getting ready to run it again soon. any ideas ?
**UPDATE** i had let $i=$i+1 in my code but i was writing it here from memory so i didnt add that part, but now i added it to the above code. It did incrament when i ran it but i think it like ran too fast and didnt allow the process to complete before starting another mail instance ? but why do i get all this return mail to root ?