?
Solved

Sendmail always timeout.

Posted on 2004-09-27
11
Medium Priority
?
878 Views
Last Modified: 2013-12-17
Im writing a PHP Mailing List Script. Then i loop for the email addresses in the database then email them each using sendmail. It's working but it always timeout. (30 sec) I'm using PHP,Apache,Sendmail for Windows
0
Comment
Question by:deepsweech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 3

Expert Comment

by:cagri
ID: 12168294
What gets timeout ? You collect addresses, you open a text file or a pipe to sendmail, put those adresses (or one of them) in to To: field (Cc or Bcc), send the e-mail. At this point it normally queues the e-mail. Although the case is not that clear to me, could you please setting the e-mail body in a text file and send this one later ? If there is a problem with the body or header, you will probably notice this looking at the text file.

Do you mind sharing the piece of code sending mails ?

Hope this helps,
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12170169
A 30 second timeout on each message could be the result of Sendmail's reverse lookup on the sender IP or Sendmail timing out an ident request. Ident request can, and usually should, be disables by including:

define(`confTO_IDENT', `0')dnl

in the sendmail.mc used to build sendmail.cf. Reverse DNS issues can be solved by making sure that there's a correct PTR record for the sender's IP or by properly defining the sender's IP/hostname in the hosts file of the Sendmail server.
0
 
LVL 6

Expert Comment

by:anfi
ID: 12174271
Which sendmail version do you use ?
http://www.sendmail.org/faq/section4.html#4.16
Q4.16 -- How do I find sendmail's version number?
0
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 

Author Comment

by:deepsweech
ID: 12187588
Thanks to you all here is the problem:
i retrieve email addresses from the database(mySQL) then in my PHP page, I have a Loop where i email each of the email addresses i have. its like:

do {
$to = $row_GetEmail['Email'];
$from =  ...
$header = ....
mail($to, $from, .....)
} while ($row_GetEmail = mysql_fetch_assoc($rsGetEmail));

but my page expires. i tried printing a counter and i saw that it can only send 2 - 5 emails. i even received an email so i know there's no error in the mail() function. I tried researching for solution and I read 1 site saying I must turn on the email queueing of the sendmail config in php.ini. but it's not available for sendmail for windows/apache/php.

Thanks.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12192668
Where is the Sendmail that you are using running,  the windows version of Sendmail on the local machine or some other host?

What happens if you do, on this system, a telnet on port 25 to the Sendmail server you use? Does that show the same 30 second delay?
0
 
LVL 4

Accepted Solution

by:
frankcheong earned 200 total points
ID: 12224924
I have similar exp when sending the mail on local host using sendmail directly, I got no delay.

While when sending using smtp on remote SMTP gateway, it would delay for at least 10 second each email (a rough guess as I don't have timed).

It is actually becoz the local sendmail only put your request on queue and thus can return to your program immediately while when sending using SMTP gateway, it will need to complete the job before closing your connection.
0
 
LVL 7

Expert Comment

by:HalldorG
ID: 12251497
This could be because of the sendmail is failing look up the destination email addresses.
That is to say check that name resolving is working on the server.

If that is not the case and it is resolving fine check the maillog
/var/log/maillog or /var/log/messages while you are sending

Suggest

tail -f /var/log/maillog /var/log/messages

Tweeking the queuing start at load in sendmail.cf  might help as if you see that sendmail is rejecting connections
in the log file
0
 
LVL 4

Expert Comment

by:frankcheong
ID: 12260526
I guess it is the standard behavior of modern SMTP (maybe customizable) coz I have setup a postfix as an SMTP server and the same thing applies too.

This have positive effect on delaying during spamming abuse.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question