Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anyone ever experience SendMail jam/hang up on them?

Status
Not open for further replies.

NeilFawcett

Programmer
Mar 19, 2004
30
0
0
GB
I'm currently suffering from a problem on my server (started last night), where any attempt I make to do a sendmail hangs... The process just sits there and goes no where...

Anyone ever had anything like this happen to them?

My server company will no doubt try and blame me for this "hanging", could this in anyway be the case?

I do have a scripts sending emails... Probably upto a max of several a minute... but on average maybe one a minute.


I've written a test program as follows, and even this currently hangs:-
Code:
#!/usr/bin/perl
#--------------
$|=1;

print "Content-type: text/html\n\nMail Test<BR>";

$var="my\@emailaddress.com";

open MAIL,"|/usr/sbin/sendmail -t" || &die;
print MAIL "To:$var\n";
print MAIL "From:test\@test.com\n";
print MAIL "Subject:Test Message\n\n";
print MAIL "This is a message.\n\n";
close MAIL || &die;

exit;

sub die{
	print "ERROR!";
	exit;
}
 
Hello Neil,

Can you use sendmail to send mail from the command line?

Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
WHat exactly do you mean by "hangs". Do you get any error messages? Is so, what are they? What do your error logs say? Maybe your email server is down? A lot of questions to get a solution....

There's always a better way. The fun is trying to find it!
 
No the script quite literally just sits there and never returns...

Something to do with SendMail on the server obviously screwed up a day or so ago...
 
Neil,

If you have command line access to the server you can test just sendmail like this:
Code:
/usr/sbin/sendmail someone@somewhere.com <<!
This is a test email
!


Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
I put my money on a reverse DNS issue. Set your webserver timeout to like 600 seconds so that it is longer then the dns timeout of 300 seconds.

Use Net::SMTP to get around this. its not OS dependant.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top