mailx problem

Hello,

I have a setup in Solaris 9, where in a multi threaded java program triggers mailx command to send emails.

"mailx" command is executed using Java's Runtime.exec() method.

Now the problem is, out of some 100 mailx command that is triggered, atleast 4 or 5 mailx command hangs. i.e., when you do a ps -ef for mailx command you can still see that 4 or 5 commands running. They are in that state permanatly untill I forcefully kill it.

All other mailx command gets executed sucessfully and mail is received by the intended recepient.

Now I am in a state of confusion about whether this due to problem of java program or some OS setting.

Please help me out of this..

Regards,

Prasanna

[744 byte] By [prasanna_ma] at [2007-11-27 9:53:18]
# 1
Hi there Which MTA you are using may be your MTA e.g Sendmail is busy .i.e its mail queue may be full . that is causing delay Regards
mtalhaa at 2007-7-13 0:22:31 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2

Hi,

Thanks for your reply.

I checked the mailq. It is not busy. The problem is mails that are sent after the hanging mailx command, sucessfully reached the recipients..

Since most of the mails are sent sucessfully, there is no problem with the mailx configuration as well!!

Regards,

Prasanna.

prasanna_ma at 2007-7-13 0:22:31 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 3

I'm glad you posted it yourself instead of someone asking - but if <sometimes> things work, and <sometimes> they don't, and you have a relyable relay on the backend and you're not seeing messages rejected or queued...

then it sounds like your wrapper code script is having difficulties at times

try executing that piece of code separately, or elsewhere and see if you obtain similar results -

hanging mailx, the only time I've seen that in successful situations is delay in the relay determining whether or not the address you've given it is a valid recipient. <assumption> try switching from emails that are externally defined to a few test ones that are local users on the machine and see if you obtain similar results </assumption> - jeff

jeffrey.sa at 2007-7-13 0:22:31 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 4

Hello Jeffery,

Thanks for your reply..

I tried executing a sample program by hard coding the email address. Both valid and invalid address. But the problem is not seen in these case.

Got a pstack for one of the hanging mailx process, looks like it is waiting to read some thing,

ff31e838 read (0, 46dec, 1400)

ff30ed0c _filbuf (43d00, 481ec, 0, ff33c008, 0, 0) + b4

0001dbf4 getline (1, 1400, 30, ffbed45c, 1400, ffbed460) + 80

0001afa8 collect (44800, 3f800, 7e, 0, 27, 43d00) + 518

00028c70 mail1 (ffbeeddc, 0, 0, 1, 81010100, ffbeeddc) + 44

00028ac8 mail (48df8, 20, 2c, ffbeef54, 43f50, 2c99c) + 118

000245ac main (43c00, 44800, ffbeef3c, 0, 0, 0) + 818

00013e6c _start (0, 0, 0, 0, 0, 0) + b8

Is this giving any clue?

Regards,

Prasanna.

prasanna_ma at 2007-7-13 0:22:31 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 5

I think what you've sent is a little deeper than what I was stating -

It doesn't sound like mailx is faulty or hanging (it is waiting, I do acknowledge what you're saying), however it sounds like the program thats invoking mailx in some cases isn't sending the appropriate EOF/EOT to the command, thus telling it that it's done with the mail message and to send off to the apropriate relay process.

does that help? - since you're not seeing it in a hard coded test, it most likely sounds like a coding issue in the calling program - not seeing the program, that sounds like the most plausible case - jeff

jeffrey.sa at 2007-7-13 0:22:31 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...