Mailx command timeout Issue

Hi All,

I have a situation where we need to send out mails from our Unix server to different mailing ids inside our scripts.The mails are working fine.But we have occasional issues where we are getting time out errors from the SMTP server while sending out mails.

Command that we are using here:

( cat /tmp/body.txt
   uuencode /tmp/testfile.txt /tmp/testfile.txt) | mailx -s "Result run of the script checking the timeout issue " abc@gmail.com

Error Message:

r4A86TDJ44958032 5798072 Fri May 10 01:06 abc@gmail.com (Deferred: Connection timed out with app2-smtp-****)

I am sure there must be an option to increase the time out for the mailx command.Tried to go through the man pages but unable to find any solution.

Has anyone faced a similar issue and please help me out??

Most versions of mailx send through sendmail.
So you should look for sendmail.cf.
The following is needed in sendmail.cf:

O SuperSafe=True

There are also many Timeout values, but I wouldn't touch them...I would rather look for the root cause!

Thanks for your reply!!!.

I found this option as well.But we work in a Shared environment and a lot of people will start shouting if we change something that impacts their process.Can we do something that I can implement at command line level rather than changing the .cf file?

There is a serious problem with connection to your SMTP server.
Search for the root cause, and get it fixed!
A work-around might have drawbacks.
After reading "man sendmail" I have to add that sendmail when invoked by mailx will use submit.cf, that by defaults connects to localhost, connecting to the sendmail daemon (that uses sendmail.cf).
If your server admins modified submit.cf or sendmail.cf or decided to not run the sendmail daemon at all, they need to do the root cause analysis.