Using Batch command

Hi All

I have a need due time constraint to issue the mail command in background. I have a script that sends a message to a mail address as follows :-
echo "$MLINE" | mail -s "$HOST - $TEXT" name@co.com &

The script runs frequently and I check to see if the script is active and if it is , it will wait until there is no script running to execute completely. The problem is that due to the time it takes for the above statement to complete, I end up with a lot of waiting scripts and as such end up never executing completely.

I have pushing the command in the background, but this did not help. I have searched and found references to the batch command, but cannot get this working. We are on AIx 52.

Thx
J

Is your mail command working propely without any problem ?

echo "$MLINE" | mail -s "$HOST - $TEXT" name@co.com

what you are getting for this?

There may be a problem to resolve domain name and sending mail. & mode will work normally. Give your workout on this.

What can I look at to identify where the bottleneck is ? I am a newbie to sendmail.
Thx

on AIX you can check the queue with 'mailq'.

Also you can watch the send directly with something like this:

echo testing | /usr/sbin/sendmail -v root (or whatever user)

Maybe from that you can tell if its taking a long time to send the data (is it alot of data?) or having trouble eastablishing connection with the smtp server or maybe even the dns lookup.

When I check the mailq, or try and send a mail out, It appears to hang and finally responds with the following :-
root@mybox#/exedir>echo "testing" | /usr/sbin/sendmail -v user@mycompany.com
WARNING: local host name (mybox) is not qualified; fix $j in config file

Thx
J

This is now becoming a sendmail problem, therefore I will open another thread for this.