Re: Malfunction in bash script
From: Michael Tosch (eedmit_at_NO.eed.SPAM.ericsson.PLS.se)
Date: 01/29/04
- Next message: Jukka Salmi: "Re: how to output a control char with /bin/sh?"
- Previous message: Google Mike: "Re: Bash and background processes"
- In reply to: Adrian: "Malfunction in bash script"
- Next in thread: Adrian: "Re: Malfunction in bash script"
- Reply: Adrian: "Re: Malfunction in bash script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Jan 2004 15:49:34 GMT
In article <bvb6tm$6pf$3@atlantis.news.tpi.pl>, Adrian <adrianne54@poczta.onet.pl> writes:
> Hello!
> I've written script which should tar all files specified in command
> line, then split it, uuencode every part (all that WORKS) and than
> should part by part send all of them in separate e-mails waiting
> specified time before sending each e-mail.
> Program seems to work, it echos text for each file which he should send
> (I've added it for debug purposes) but I don't receive all of the parts
> (normally only half of them). I've set delay to 240 - still doesn't work
> as it should. My mail-program checks account every 2 minutes.
> Below I include section responsible for sending e-mails. $autoryzacja is
> set by default to "", it could include auth plain or auth login text.
> If someone please could write what's wrong I would be extremally
> grateful. It's my first so long script and now I cannot even concentrate
> on it.
>
> Adrian
>
>
> counter=1
> ls_parts=`ls $project_dir"/parts_encoded"`
> for split_part in $ls_parts
> do
> touch $temp_mail
> echo -e -n "EHLO $server\n$autoryzacja\nmail from: <$sender>\nrcpt to:
> <$receiver>\nDATA\nFrom: <$sender>\nTo:
> <$receiver>\nReply-to:<$sender>\nX-mailer: split_sender\nXsend-content:
> encoded_part\nXsend-project_name: $project_name\nSubject: $project_name
> part $split_part by split_sender\n" > $temp_mail
> cat $project_dir"/parts_encoded/"$split_part >> $temp_mail
> echo -e -n "\n.\nQUIT\n" >> $temp_mail
> echo "Sending part $counter ( "$project_name" ["$split_part"] )"
> cat $temp_mail | nc $server 25 > /dev/zero
What is >/dev/zero? Didnt you mean >/dev/null?
> rm -f $temp_mail
> counter=$(($counter+1))
> echo "Sleep for $delay seconds"
> sleep $delay
> done
You generally dont need a delay. It is polite to give the
mail server 1 second to take breath.
Rather assembling all the SMTP commands like EHLO,DATA,QUIT
you could simply pipe it to mail or /usr/lib/sendmail.
These programs also generate a log message for every mail sent.
All this has probably no influence on mail loss.
Check your mail system. Do you have M$-Exchange somewhere?
The SMTP gateways are famous for "swallowing" mails.
-- Michael Tosch IT Specialist HP Managed Services Germany Phone +49 2407 575 313
- Next message: Jukka Salmi: "Re: how to output a control char with /bin/sh?"
- Previous message: Google Mike: "Re: Bash and background processes"
- In reply to: Adrian: "Malfunction in bash script"
- Next in thread: Adrian: "Re: Malfunction in bash script"
- Reply: Adrian: "Re: Malfunction in bash script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|